-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/subs
- Loading branch information
Showing
38 changed files
with
2,029 additions
and
65 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
769 changes: 769 additions & 0 deletions
769
chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler_test.go
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
chaoscenter/graphql/server/pkg/chaos_experiment/model/mocks/chaos_engine.yaml
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,34 @@ | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
generateName: nginx-chaos | ||
name: nginx-chaos | ||
namespace: default | ||
spec: | ||
appinfo: | ||
appns: 'default' | ||
applabel: 'app=nginx' | ||
appkind: 'deployment' | ||
# It can be active/stop | ||
engineState: 'active' | ||
chaosServiceAccount: pod-delete-sa | ||
experiments: | ||
- name: pod-delete | ||
spec: | ||
components: | ||
env: | ||
# set chaos duration (in sec) as desired | ||
- name: TOTAL_CHAOS_DURATION | ||
value: '30' | ||
|
||
# set chaos interval (in sec) as desired | ||
- name: CHAOS_INTERVAL | ||
value: '10' | ||
|
||
# pod failures without '--force' & default terminationGracePeriodSeconds | ||
- name: FORCE | ||
value: 'false' | ||
|
||
## percentage of total pods to target | ||
- name: PODS_AFFECTED_PERC | ||
value: '' |
33 changes: 33 additions & 0 deletions
33
chaoscenter/graphql/server/pkg/chaos_experiment/model/mocks/chaos_schedule.yaml
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,33 @@ | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosSchedule | ||
metadata: | ||
name: schedule-nginx | ||
generateName: schedule-nginx | ||
spec: | ||
schedule: | ||
now: true | ||
engineTemplateSpec: | ||
engineState: 'active' | ||
appinfo: | ||
appns: 'default' | ||
applabel: 'app=nginx' | ||
appkind: 'deployment' | ||
annotationCheck: 'true' | ||
chaosServiceAccount: pod-delete-sa | ||
jobCleanUpPolicy: 'delete' | ||
experiments: | ||
- name: pod-delete | ||
spec: | ||
components: | ||
env: | ||
# set chaos duration (in sec) as desired | ||
- name: TOTAL_CHAOS_DURATION | ||
value: '30' | ||
|
||
# set chaos interval (in sec) as desired | ||
- name: CHAOS_INTERVAL | ||
value: '10' | ||
|
||
# pod failures without '--force' & default terminationGracePeriodSeconds | ||
- name: FORCE | ||
value: 'false' |
177 changes: 177 additions & 0 deletions
177
chaoscenter/graphql/server/pkg/chaos_experiment/model/mocks/cron_workflow.yaml
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,177 @@ | ||
kind: CronWorkflow | ||
apiVersion: argoproj.io/v1alpha1 | ||
metadata: | ||
name: test-podtato-head-1682669740 | ||
namespace: litmus | ||
creationTimestamp: null | ||
labels: | ||
subject: podtato-head_litmus | ||
workflows.argoproj.io/controller-instanceid: 83c20016-f7ec-4c5d-bb84-3a067a7010c2 | ||
spec: | ||
workflowSpec: | ||
templates: | ||
- name: argowf-chaos | ||
inputs: {} | ||
outputs: {} | ||
metadata: {} | ||
steps: | ||
- - name: install-application | ||
template: install-application | ||
arguments: {} | ||
- - name: install-chaos-experiments | ||
template: install-chaos-experiments | ||
arguments: {} | ||
- - name: pod-delete | ||
template: pod-delete | ||
arguments: {} | ||
- - name: revert-chaos | ||
template: revert-chaos | ||
arguments: {} | ||
- name: delete-application | ||
template: delete-application | ||
arguments: {} | ||
- name: install-application | ||
inputs: {} | ||
outputs: {} | ||
metadata: {} | ||
container: | ||
name: "" | ||
image: litmuschaos/litmus-app-deployer:latest | ||
args: | ||
- -namespace={{workflow.parameters.adminModeNamespace}} | ||
- -typeName=resilient | ||
- -operation=apply | ||
- -timeout=400 | ||
- -app=podtato-head | ||
- -scope=namespace | ||
resources: {} | ||
- name: install-chaos-experiments | ||
inputs: {} | ||
outputs: {} | ||
metadata: {} | ||
container: | ||
name: "" | ||
image: litmuschaos/k8s:latest | ||
command: | ||
- sh | ||
- -c | ||
args: | ||
- kubectl apply -f | ||
https://hub.litmuschaos.io/api/chaos/3.0.0-beta3?file=charts/generic/experiments.yaml | ||
-n {{workflow.parameters.adminModeNamespace}} ; sleep 30 | ||
resources: {} | ||
- name: pod-delete | ||
inputs: | ||
artifacts: | ||
- name: pod-delete | ||
path: /tmp/chaosengine.yaml | ||
raw: | ||
data: > | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
namespace: "{{workflow.parameters.adminModeNamespace}}" | ||
labels: | ||
workflow_run_id: "{{workflow.uid}}" | ||
workflow_name: podtato-head-1683012309 | ||
generateName: podtato-main-pod-delete-chaos | ||
spec: | ||
appinfo: | ||
appns: "{{workflow.parameters.adminModeNamespace}}" | ||
applabel: name=podtato-main | ||
appkind: deployment | ||
engineState: active | ||
chaosServiceAccount: litmus-admin | ||
jobCleanUpPolicy: retain | ||
components: | ||
runner: | ||
imagePullPolicy: Always | ||
experiments: | ||
- name: pod-delete | ||
spec: | ||
probe: | ||
- name: check-podtato-main-access-url | ||
type: httpProbe | ||
httpProbe/inputs: | ||
url: http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000 | ||
insecureSkipVerify: false | ||
method: | ||
get: | ||
criteria: == | ||
responseCode: "200" | ||
mode: Continuous | ||
runProperties: | ||
probeTimeout: 1 | ||
interval: 1 | ||
retry: 1 | ||
components: | ||
env: | ||
- name: TOTAL_CHAOS_DURATION | ||
value: "30" | ||
- name: CHAOS_INTERVAL | ||
value: "10" | ||
- name: FORCE | ||
value: "false" | ||
outputs: {} | ||
metadata: | ||
labels: | ||
weight: "10" | ||
container: | ||
name: "" | ||
image: litmuschaos/litmus-checker:latest | ||
args: | ||
- -file=/tmp/chaosengine.yaml | ||
- -saveName=/tmp/engine-name | ||
resources: {} | ||
- name: delete-application | ||
inputs: {} | ||
outputs: {} | ||
metadata: {} | ||
container: | ||
name: "" | ||
image: litmuschaos/litmus-app-deployer:latest | ||
args: | ||
- -namespace={{workflow.parameters.adminModeNamespace}} | ||
- -typeName=resilient | ||
- -operation=delete | ||
- -app=podtato-head | ||
resources: {} | ||
- name: revert-chaos | ||
inputs: {} | ||
outputs: {} | ||
metadata: {} | ||
container: | ||
name: "" | ||
image: litmuschaos/k8s:latest | ||
command: | ||
- sh | ||
- -c | ||
args: | ||
- kubectl delete chaosengine -l workflow_run_id={{workflow.uid}} -n | ||
{{workflow.parameters.adminModeNamespace}} | ||
resources: {} | ||
entrypoint: argowf-chaos | ||
arguments: | ||
parameters: | ||
- name: adminModeNamespace | ||
value: litmus | ||
serviceAccountName: argo-chaos | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsNonRoot: true | ||
schedule: 28 16 * * 0-6 | ||
concurrencyPolicy: Forbid | ||
startingDeadlineSeconds: 0 | ||
timezone: Asia/Seoul | ||
workflowMetadata: | ||
creationTimestamp: null | ||
labels: | ||
cluster_id: 83c20016-f7ec-4c5d-bb84-3a067a7010c2 | ||
workflow_id: eb7eb07f-5a60-470a-89e8-7b98ab7e6b11 | ||
workflows.argoproj.io/controller-instanceid: 83c20016-f7ec-4c5d-bb84-3a067a7010c2 | ||
status: | ||
? active | ||
? lastScheduledTime | ||
? conditions |
Oops, something went wrong.