Skip to content

Commit

Permalink
Merge branch 'master' into feat/subs
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamRatnaparkhi authored Nov 1, 2023
2 parents 0fc65c4 + f2275e4 commit 42fb128
Show file tree
Hide file tree
Showing 38 changed files with 2,029 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inducing chaos tests in a controlled way. Developers & SREs can practice Chaos E
Chaos Engineering principles & community collaborated. It is 100% open source & a CNCF project.

LitmusChaos takes a cloud-native approach to create, manage and monitor chaos. The platform itself runs as a set of microservices and uses Kubernetes
custom resources to define the chaos intent, as well as the steady state hypothesis.
custom resources (CRs) to define the chaos intent, as well as the steady state hypothesis.

At a high-level, Litmus comprises of:

Expand Down

Large diffs are not rendered by default.

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: ''
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'
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
Loading

0 comments on commit 42fb128

Please sign in to comment.