Changes for report support and python package (#208)

* Changes for report support and python package

* Changes for report support and python package

* Changes for report support and python package

* changes to port with new module call
This commit is contained in:
sumit Nagal
2020-04-15 10:39:15 -07:00
committed by GitHub
parent 08159e73f5
commit 9f024007d9
7 changed files with 97 additions and 9 deletions

View File

@@ -3,10 +3,10 @@ kind: ChartServiceVersion
metadata: metadata:
createdAt: 2020-02-24T10:28:08Z createdAt: 2020-02-24T10:28:08Z
name: chaostoolkit name: chaostoolkit
version: 0.0.3 version: 0.0.4
annotations: annotations:
categories: Kubernetes categories: Kubernetes
chartDescription: Injects chaostoolkit chaos chartDescription: Injects chaostoolkit chaos
spec: spec:
displayName: chaostoolkit chaos displayName: chaostoolkit chaos
categoryDescription: categoryDescription:
@@ -15,7 +15,7 @@ spec:
keywords: keywords:
- Kubernetes - Kubernetes
- pod - pod
- State - State
maintainers: maintainers:
- name: sumit - name: sumit
email: sumit_nagal@intuit.com email: sumit_nagal@intuit.com

View File

@@ -35,7 +35,7 @@ spec:
image: "litmuschaos/chaostoolkit:latest" image: "litmuschaos/chaostoolkit:latest"
args: args:
- -c - -c
- python /app/data/k8_wrapper.py; exit 0 - python /app/chaos/chaostest/kubernetes/k8_wrapper.py; exit 0
command: command:
- /bin/bash - /bin/bash
env: env:
@@ -57,6 +57,12 @@ spec:
- name: PERCENTAGE - name: PERCENTAGE
value: '50' value: '50'
- name: REPORT
value: 'true'
- name: REPORT_ENDPOINT
value: 'none'
labels: labels:
name: k8-pod-delete name: k8-pod-delete

View File

@@ -0,0 +1,36 @@
# chaosengine.yaml
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: k8-kiam-delete-count
namespace: default
spec:
#ex. values: ns1:name=percona,ns2:run=nginx
appinfo:
appns: kube-system
# FYI, To see app label, apply kubectl get pods --show-labels
#applabel: "app=nginx"
applabel: "app=kiam"
appkind: deployment
jobCleanUpPolicy: retain
monitoring: false
annotationCheck: 'false'
engineState: 'active'
chaosServiceAccount: chaos-admin
experiments:
- name: k8-pod-delete
spec:
components:
env:
- name: NAME_SPACE
value: kube-system
- name: LABEL_NAME
value: kiam
- name: APP_ENDPOINT
value: 'localhost'
- name: FILE
value: 'pod-app-kill-count.json'
- name: REPORT
value: 'true'
- name: REPORT_ENDPOINT
value: 'none'

View File

@@ -24,8 +24,13 @@ spec:
# set chaos label name # set chaos label name
- name: LABEL_NAME - name: LABEL_NAME
value: 'nginx' value: 'nginx'
# pod endpoint # pod endpoint
- name: APP_ENDPOINT - name: APP_ENDPOINT
value: 'localhost' value: 'localhost'
- name: FILE - name: FILE
value: 'pod-app-kill-count.json' value: 'pod-app-kill-count.json'
- name: REPORT
value: 'true'
- name: REPORT_ENDPOINT
value: 'none'

View File

@@ -33,7 +33,7 @@ spec:
image: "litmuschaos/chaostoolkit:latest" image: "litmuschaos/chaostoolkit:latest"
args: args:
- -c - -c
- python /app/data/k8_wrapper.py; exit 0 - python /app/chaos/chaostest/kubernetes/k8_wrapper.py; exit 0
command: command:
- /bin/bash - /bin/bash
env: env:
@@ -55,5 +55,11 @@ spec:
- name: PERCENTAGE - name: PERCENTAGE
value: '50' value: '50'
- name: REPORT
value: 'true'
- name: REPORT_ENDPOINT
value: 'none'
labels: labels:
name: k8-pod-delete name: k8-pod-delete

View File

@@ -2,7 +2,7 @@ apiVersion: litmuchaos.io/v1alpha1
kind: ChartServiceVersion kind: ChartServiceVersion
metadata: metadata:
name: k8-pod-delete name: k8-pod-delete
version: 0.0.3 version: 0.0.4
annotations: annotations:
categories: Kubernetes categories: Kubernetes
vendor: CNCF vendor: CNCF
@@ -14,7 +14,7 @@ spec:
K8 Pod delete contains chaos to disrupt state of kubernetes resources. It uses chaostoolkit to inject random pod delete failures against specified applications K8 Pod delete contains chaos to disrupt state of kubernetes resources. It uses chaostoolkit to inject random pod delete failures against specified applications
keywords: keywords:
- Kubernetes - Kubernetes
- State - State
platforms: platforms:
- Minikube - Minikube
maturity: alpha maturity: alpha
@@ -28,6 +28,6 @@ spec:
- name: Source Code - name: Source Code
url: https://github.com/litmuschaos/litmus/tree/master/experiments/chaostoolkit/kubernetes/pod-delete url: https://github.com/litmuschaos/litmus/tree/master/experiments/chaostoolkit/kubernetes/pod-delete
icon: icon:
- url: - url:
mediatype: "" mediatype: ""
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/chaostoolkit/k8-pod-delete/experiment.yaml chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/chaostoolkit/k8-pod-delete/experiment.yaml

View File

@@ -0,0 +1,35 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: chaos-admin
labels:
name: chaos-admin
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: chaos-admin
labels:
name: chaos-admin
rules:
- apiGroups: ["","apps","batch","extensions","litmuschaos.io","openebs.io","storage.k8s.io"]
resources: ["chaosengines","chaosexperiments","chaosresults","configmaps","cstorpools","cstorvolumereplicas","events","jobs","persistentvolumeclaims","persistentvolumes","pods","pods/exec","pods/log","secrets","storageclasses","chaosengines","chaosexperiments","chaosresults","configmaps","cstorpools","cstorvolumereplicas","daemonsets","deployments","events","jobs","persistentvolumeclaims","persistentvolumes","pods","pods/eviction","pods/exec","pods/log","replicasets","secrets","services","statefulsets","storageclasses"]
verbs: ["create","delete","get","list","patch","update"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get","list","patch"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: chaos-admin
labels:
name: chaos-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: chaos-admin
subjects:
- kind: ServiceAccount
name: chaos-admin
namespace: msaasfmea4-perf-infra-usw2-ppd-pfi