diff --git a/charts/generic/experiments.yaml b/charts/generic/experiments.yaml index b669e86..8b9903e 100644 --- a/charts/generic/experiments.yaml +++ b/charts/generic/experiments.yaml @@ -2813,7 +2813,6 @@ spec: # Period to wait before and after injection of chaos in sec - name: RAMP_TIME value: '' - labels: name: node-drain app.kubernetes.io/part-of: litmus diff --git a/charts/kube-aws/aws-az-chaos/aws-az-chaos.chartserviceversion.yaml b/charts/kube-aws/aws-az-chaos/aws-az-chaos.chartserviceversion.yaml new file mode 100755 index 0000000..1632138 --- /dev/null +++ b/charts/kube-aws/aws-az-chaos/aws-az-chaos.chartserviceversion.yaml @@ -0,0 +1,35 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + name: aws-az-chaos + version: 0.1.0 + annotations: + categories: Kubernetes + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: aws-az-chaos + categoryDescription: > + Execute aws-az chaos to detach the target zones from the load balancer + keywords: + - "zone" + - "load-balancer" + - "aws" + platforms: + - "AWS" + maturity: alpha + maintainers: + - name: oumkale + email: imkaleoum@gmail.com + labels: + app.kubernetes.io/component: chartserviceversion + app.kubernetes.io/version: latest + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-python/tree/master/experiments/aws_az + - name: Documentation + url: https://litmuschaos.github.io/litmus/experiments/categories/aws/aws-az-chaos/ + icon: + - url: + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/kube-aws/aws-az-chaos/experiment.yaml diff --git a/charts/kube-aws/aws-az-chaos/engine.yaml b/charts/kube-aws/aws-az-chaos/engine.yaml new file mode 100755 index 0000000..a7afbbc --- /dev/null +++ b/charts/kube-aws/aws-az-chaos/engine.yaml @@ -0,0 +1,27 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: aws-az-chaos +spec: + # It can be active/stop + engineState: 'active' + chaosServiceAccount: aws-az-chaos-sa + experiments: + - name: aws-az-chaos + spec: + components: + env: + - name: TOTAL_CHAOS_DURATION + value: '30' + - name: CHAOS_INTERVAL + value: '30' + #LOAD_BALANCER_NAME name of the load balancer + - name: LOAD_BALANCER_NAME + value: "" + #LOAD_BALANCER_ZONES can be multiple, provide it by comma separated + - name: LOAD_BALANCER_ZONES + value: "" + - name: LOAD_BALANCERNAME_ARN + value: "na" + - name: AWS_SHARED_CREDENTIALS_FILE + value: "/tmp/cloud_config.yml" diff --git a/charts/kube-aws/aws-az-chaos/experiment.yaml b/charts/kube-aws/aws-az-chaos/experiment.yaml new file mode 100755 index 0000000..921723b --- /dev/null +++ b/charts/kube-aws/aws-az-chaos/experiment.yaml @@ -0,0 +1,76 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + Execute aws-az chaos to detach the target zones from the load balancer +kind: ChaosExperiment +metadata: + name: aws-az-chaos + labels: + name: aws-az-chaos + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Fetch configmaps & secrets details and mount it to the experiment pod (if specified) + - apiGroups: [""] + resources: ["secrets","configmaps"] + verbs: ["get","list",] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute comands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] + image: "litmuschaos/py-runner:latest" + imagePullPolicy: Always + args: + - -c + - python3 -u experiment -name aws-az-chaos + command: + - /bin/bash + env: + - name: TOTAL_CHAOS_DURATION + value: '30' + - name: CHAOS_INTERVAL + value: '30' + - name: LIB + value: 'litmus' + - name: LOAD_BALANCER_NAME + value: '' + - name: LOAD_BALANCER_ZONES + value: '' + - name: LOAD_BALANCERNAME_ARN + value: 'na' + - name: AWS_SHARED_CREDENTIALS_FILE + value: "/tmp/cloud_config.yml" + - name: RAMP_TIME + value: '' + labels: + name: aws-az-chaos + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest + secrets: + - name: cloud-secret + mountPath: /tmp/ diff --git a/charts/kube-aws/aws-az-chaos/rbac.yaml b/charts/kube-aws/aws-az-chaos/rbac.yaml new file mode 100755 index 0000000..3d2284c --- /dev/null +++ b/charts/kube-aws/aws-az-chaos/rbac.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: aws-az-chaos-sa + namespace: default + labels: + name: aws-az-chaos-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: Role +metadata: + name: aws-az-chaos-sa + namespace: default + labels: + name: aws-az-chaos-sa + app.kubernetes.io/part-of: litmus +rules: +# Create and monitor the experiment & helper pods +- apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] +# Performs CRUD operations on the events inside chaosengine and chaosresult +- apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] +# Fetch configmaps & secrets details and mount it to the experiment pod (if specified) +- apiGroups: [""] + resources: ["secrets","configmaps"] + verbs: ["get","list",] +# Track and get the runner, experiment, and helper pods log +- apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] +# for configuring and monitor the experiment job by the chaos-runner pod +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] +# for creation, status polling and deletion of litmus chaos resources used within a chaos workflow +- apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + name: aws-az-chaos-sa + namespace: default + labels: + name: aws-az-chaos-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: aws-az-chaos-sa +subjects: +- kind: ServiceAccount + name: aws-az-chaos-sa + namespace: default \ No newline at end of file diff --git a/charts/kube-aws/experiments.yaml b/charts/kube-aws/experiments.yaml index 62215f9..91ca0fb 100644 --- a/charts/kube-aws/experiments.yaml +++ b/charts/kube-aws/experiments.yaml @@ -382,3 +382,81 @@ spec: mountPath: /tmp/ --- +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + Execute aws-az chaos to detach the target zones from the load balancer +kind: ChaosExperiment +metadata: + name: aws-az-chaos + labels: + name: aws-az-chaos + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Fetch configmaps & secrets details and mount it to the experiment pod (if specified) + - apiGroups: [""] + resources: ["secrets","configmaps"] + verbs: ["get","list",] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute comands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] + image: "litmuschaos/py-runner:latest" + imagePullPolicy: Always + args: + - -c + - python3 -u experiment -name aws-az-chaos + command: + - /bin/bash + env: + - name: TOTAL_CHAOS_DURATION + value: '30' + - name: CHAOS_INTERVAL + value: '30' + - name: LIB + value: 'litmus' + - name: LOAD_BALANCER_NAME + value: '' + - name: LOAD_BALANCER_ZONES + value: '' + - name: LOAD_BALANCERNAME_ARN + value: 'na' + - name: AWS_SHARED_CREDENTIALS_FILE + value: "/tmp/cloud_config.yml" + - name: RAMP_TIME + value: '' + labels: + name: aws-az-chaos + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest + secrets: + - name: cloud-secret + mountPath: /tmp/ + +--- \ No newline at end of file diff --git a/charts/kube-aws/icons/aws-az-chaos.png b/charts/kube-aws/icons/aws-az-chaos.png new file mode 100644 index 0000000..fd09e34 Binary files /dev/null and b/charts/kube-aws/icons/aws-az-chaos.png differ diff --git a/charts/kube-aws/kube-aws.chartserviceversion.yaml b/charts/kube-aws/kube-aws.chartserviceversion.yaml index a2e9bb7..cb18e72 100644 --- a/charts/kube-aws/kube-aws.chartserviceversion.yaml +++ b/charts/kube-aws/kube-aws.chartserviceversion.yaml @@ -16,20 +16,24 @@ spec: - ec2-terminate-by-tag - ebs-loss-by-id - ebs-loss-by-tag + - aws-az-chaos keywords: - AWS - EC2 - EBS + - AZ maintainers: - name: ksatchit email: karthik.s@mayadata.io - provider: - name: Intuit + - name: oumkale + email: imkaleoum@gmail.com links: - name: Kubernetes Website url: https://kubernetes.io - name: Source Code - url: https://github.com/litmuschaos/litmus-python/tree/master/chaos-test + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/kube-aws + - name: Source Code + url: https://github.com/litmuschaos/litmus-python/tree/master/experiments/aws_az - name: Kubernetes Slack url: https://slack.kubernetes.io/ icon: diff --git a/charts/kube-aws/kube-aws.package.yaml b/charts/kube-aws/kube-aws.package.yaml index 24f4cc0..db03f2e 100644 --- a/charts/kube-aws/kube-aws.package.yaml +++ b/charts/kube-aws/kube-aws.package.yaml @@ -11,4 +11,7 @@ experiments: desc: "ebs-loss-by-id" - name: ebs-loss-by-tag CSV: ebs-loss-by-tag.chartserviceversion.yaml - desc: "ebs-loss-by-tag" + desc: "ebs-loss-by-tag" + - name: aws-az-chaos + CSV: aws-az-chaos.chartserviceversion.yaml + desc: "aws-az-chaos"