adding bank-of-anthos predefined workflow (#481)
Signed-off-by: Oum Kale <oumkale@chaosnative.com>
This commit is contained in:
committed by
GitHub
parent
844a1453ee
commit
c808dfc90b
@@ -0,0 +1,39 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
name: bank-of-anthos
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: bank-of-anthos
|
||||
chartDescription: Injects chaos on bank-of-anthos application using http probe.
|
||||
spec:
|
||||
displayName: bank-of-anthos-Chaos
|
||||
categoryDescription: >
|
||||
It install bank-of-anthos application, generate loads, inject chaos on bank-of-anthos,
|
||||
uninstall the application and revert the chaos
|
||||
experiments:
|
||||
- pod-network-loss
|
||||
keywords:
|
||||
- Kubernetes
|
||||
- bank-of-anthos
|
||||
- Pod
|
||||
- Network
|
||||
platforms:
|
||||
- GKE
|
||||
- Minikube
|
||||
- Packet(Kubeadm)
|
||||
- EKS
|
||||
- AKS
|
||||
maintainers:
|
||||
- name: oumkale
|
||||
email: oumkale@chaosnative.com
|
||||
provider:
|
||||
name: ChaosNative
|
||||
links:
|
||||
- name: Kubernetes Slack
|
||||
url: https://slack.kubernetes.io/
|
||||
- name: Documentation
|
||||
url: https://docs.litmuschaos.io/docs/chaoshub/#generic-chaos
|
||||
icon:
|
||||
- url: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/workflows/icons/bank-of-anthos.svg
|
||||
mediatype: image/png
|
118
workflows/bank-of-anthos/workflow.yaml
Normal file
118
workflows/bank-of-anthos/workflow.yaml
Normal file
@@ -0,0 +1,118 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: argowf-chaos-bank-of-anthos-resiliency-
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.appNamespace}}_bank-of-anthos"
|
||||
spec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: appNamespace
|
||||
value: "bank"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-application
|
||||
template: install-application
|
||||
- - name: install-chaos-experiments
|
||||
template: install-chaos-experiments
|
||||
- - name: pod-network-loss
|
||||
template: pod-network-loss
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
- name: delete-application
|
||||
template: delete-application
|
||||
|
||||
- name: install-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace=bank","-typeName=resilient","-operation=apply","-timeout=400", "-app=bank-of-anthos","-scope=cluster"] #for weak provide type flagName as resilient(-typeName=weak)
|
||||
|
||||
- name: install-chaos-experiments
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
- "kubectl apply -f https://hub.litmuschaos.io/api/chaos/master?file=charts/generic/experiments.yaml -n
|
||||
{{workflow.parameters.adminModeNamespace}} ; sleep 30"
|
||||
|
||||
- name: pod-network-loss
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: pod-network-loss
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: pod-network-loss-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.appNamespace}}_bank-of-anthos"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: 'bank'
|
||||
applabel: 'name in (balancereader,transactionhistory)'
|
||||
appkind: 'deployment'
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
components:
|
||||
runner:
|
||||
imagePullPolicy: Always
|
||||
experiments:
|
||||
- name: pod-network-loss
|
||||
spec:
|
||||
probe:
|
||||
- name: "check-frontend-access-url"
|
||||
type: "httpProbe"
|
||||
httpProbe/inputs:
|
||||
url: "http://frontend.bank.svc.cluster.local:80"
|
||||
responseTimeout: 100
|
||||
method:
|
||||
get:
|
||||
criteria: "=="
|
||||
responseCode: "200"
|
||||
mode: "Continuous"
|
||||
runProperties:
|
||||
probeTimeout: 2
|
||||
interval: 1
|
||||
retry: 2
|
||||
components:
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '90'
|
||||
- name: NETWORK_INTERFACE
|
||||
value: 'eth0'
|
||||
- name: NETWORK_PACKET_LOSS_PERCENTAGE
|
||||
value: '100'
|
||||
- name: CONTAINER_RUNTIME
|
||||
value: 'docker'
|
||||
- name: SOCKET_PATH
|
||||
value: '/var/run/docker.sock'
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: delete-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace=bank","-typeName=resilient","-operation=delete", "-app=bank-of-anthos"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine pod-network-loss-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
122
workflows/bank-of-anthos/workflow_cron.yaml
Normal file
122
workflows/bank-of-anthos/workflow_cron.yaml
Normal file
@@ -0,0 +1,122 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: CronWorkflow
|
||||
metadata:
|
||||
generateName: argowf-chaos-bank-of-anthos-resiliency-cron-wf-
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.appNamespace}}_bank-of-anthos"
|
||||
spec:
|
||||
schedule: "0 * * * *"
|
||||
concurrencyPolicy: "Forbid"
|
||||
startingDeadlineSeconds: 0
|
||||
workflowSpec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: appNamespace
|
||||
value: "bank"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-application
|
||||
template: install-application
|
||||
- - name: install-chaos-experiments
|
||||
template: install-chaos-experiments
|
||||
- - name: pod-network-loss
|
||||
template: pod-network-loss
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
- name: delete-application
|
||||
template: delete-application
|
||||
|
||||
- name: install-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace=bank","-typeName=resilient","-operation=apply","-timeout=400", "-app=bank-of-anthos","-scope=cluster"] #for weak provide type flagName as resilient(-typeName=weak)
|
||||
|
||||
- name: install-chaos-experiments
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
- "kubectl apply -f https://hub.litmuschaos.io/api/chaos/master?file=charts/generic/experiments.yaml -n
|
||||
{{workflow.parameters.adminModeNamespace}} ; sleep 30"
|
||||
|
||||
- name: pod-network-loss
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: pod-network-loss
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: pod-network-loss-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.appNamespace}}_bank-of-anthos"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: 'bank'
|
||||
applabel: 'name in (balancereader,transactionhistory)'
|
||||
appkind: 'deployment'
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
components:
|
||||
runner:
|
||||
imagePullPolicy: Always
|
||||
experiments:
|
||||
- name: pod-network-loss
|
||||
spec:
|
||||
probe:
|
||||
- name: "check-frontend-access-url"
|
||||
type: "httpProbe"
|
||||
httpProbe/inputs:
|
||||
url: "http://frontend.bank.svc.cluster.local:80"
|
||||
responseTimeout: 100
|
||||
method:
|
||||
get:
|
||||
criteria: "=="
|
||||
responseCode: "200"
|
||||
mode: "Continuous"
|
||||
runProperties:
|
||||
probeTimeout: 2
|
||||
interval: 1
|
||||
retry: 2
|
||||
components:
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
- name: NETWORK_INTERFACE
|
||||
value: 'eth0'
|
||||
- name: NETWORK_PACKET_LOSS_PERCENTAGE
|
||||
value: '100'
|
||||
- name: CONTAINER_RUNTIME
|
||||
value: 'docker'
|
||||
- name: SOCKET_PATH
|
||||
value: '/var/run/docker.sock'
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: delete-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace=bank","-typeName=resilient","-operation=delete", "-app=bank-of-anthos"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine pod-network-loss-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
19
workflows/icons/bank-of-anthos.svg
Normal file
19
workflows/icons/bank-of-anthos.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 24.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 300 280" enable-background="new 0 0 300 280" xml:space="preserve">
|
||||
<g>
|
||||
<polygon fill="#2AAB4F" points="253.53,226.3 250.52,221.02 249.89,219.92 248.72,217.89 150,217.89 51.28,217.89 50.11,219.92
|
||||
49.48,221.02 46.47,226.3 41.76,234.54 150,234.54 258.24,234.54 "/>
|
||||
<polygon fill="#FBBA14" points="253.53,226.3 250.52,221.02 249.89,219.92 248.72,217.89 150,45.46 51.28,217.89 50.11,219.92
|
||||
49.48,221.02 46.47,226.3 41.76,234.54 55.95,234.54 62.16,232.53 70.54,217.89 74.02,211.82 74.05,211.8 76.1,208.18
|
||||
95.71,173.93 150,79.11 204.29,173.93 223.9,208.18 225.95,211.8 225.98,211.82 229.46,217.89 237.84,232.53 244.05,234.54
|
||||
258.24,234.54 "/>
|
||||
<polygon fill="#EE3D2C" points="250.52,221.02 249.07,219.55 247.43,217.89 204.29,173.93 150,118.64 95.71,173.93 52.57,217.89
|
||||
50.93,219.55 49.48,221.02 46.47,226.3 62.42,217.89 74.02,211.82 74.05,211.8 91.32,202.69 93.68,200.24 150,141.73
|
||||
206.32,200.24 208.68,202.69 225.95,211.8 225.98,211.82 237.58,217.89 253.53,226.3 "/>
|
||||
<polygon fill="#517ABD" points="253.53,226.3 250.52,221.02 249.89,219.92 249.07,219.55 245.4,217.89 223.9,208.18 206.32,200.24
|
||||
150,174.81 93.68,200.24 76.1,208.18 54.6,217.89 50.93,219.55 50.11,219.92 49.48,221.02 46.47,226.3 41.76,234.54 57.73,234.54
|
||||
62.16,232.53 94.59,217.89 150,192.88 205.41,217.89 237.84,232.53 242.27,234.54 258.24,234.54 "/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user