forked from grafana/k6-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
576 additions
and
869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
domain: k6.io | ||
domain: io | ||
layout: go.kubebuilder.io/v2 | ||
projectName: operator | ||
repo: github.com/k6io/operator | ||
resources: | ||
- group: test | ||
- group: k6 | ||
kind: K6 | ||
version: v1alpha1 | ||
version: "2" | ||
- group: k6 | ||
kind: K6Test | ||
version: v1alpha1 | ||
version: 3-alpha | ||
plugins: | ||
go.sdk.operatorframework.io/v2-alpha: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
# operator | ||
![data flow](assets/data-flow.png) | ||
|
||
# k6 Operator | ||
|
||
> ### ⚠️ Experimental | ||
> | ||
> This project is **experimental** and changes a lot | ||
> between commits. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
resources: | ||
- manager.yaml | ||
images: | ||
- name: controller | ||
newName: ghcr.io/k6io/operator | ||
newTag: latest | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: k6 | ||
name: k6-test | ||
data: | ||
test.js: | | ||
import http from 'k6/http'; | ||
import { Rate } from 'k6/metrics'; | ||
import { check, sleep } from 'k6'; | ||
import { | ||
getExecutionSegments, | ||
logSegment, | ||
} from 'https://jslib.k6.io/k8s-distributed-execution/0.0.1/index.js'; | ||
const failRate = new Rate('failed_requests'); | ||
export function setup() { | ||
logSegment(); | ||
} | ||
export let options = Object.assign({ | ||
stages: [ | ||
{ target: 200, duration: '30s' }, | ||
{ target: 0, duration: '30s' }, | ||
], | ||
threshold: { | ||
failed_requests: ['rate<=0'], | ||
http_req_duration: ['p(95)<500'], | ||
}, | ||
}, getExecutionSegments()); | ||
export default function () { | ||
const result = http.get('https://test-api.k6.io/public/crocodiles/'); | ||
check(result, { | ||
'http response status code is 200': result.status === 200, | ||
}); | ||
failRate.add(result.status !== 200); | ||
sleep(1); | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: k6.io/v1alpha1 | ||
kind: K6 | ||
metadata: | ||
namespace: k6 | ||
name: k6-sample | ||
spec: | ||
parallelism: 4 | ||
script: k6-test | ||
separate: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Append samples you want in your CSV to this file as resources ## | ||
resources: | ||
- k6_v1alpha1_configmap.yaml | ||
- k6_v1alpha1_k6.yaml | ||
# +kubebuilder:scaffold:manifestskustomizesamples |
Oops, something went wrong.