diff --git a/charts/generic/generic.chartserviceversion.yaml b/charts/generic/generic.chartserviceversion.yaml index e7cdc9f..f4289eb 100644 --- a/charts/generic/generic.chartserviceversion.yaml +++ b/charts/generic/generic.chartserviceversion.yaml @@ -26,6 +26,8 @@ spec: - node-memory-hog - pod-memory-hog - kubelet-service-kill + - pod-network-duplication + keywords: - Kubernetes diff --git a/charts/generic/generic.package.yaml b/charts/generic/generic.package.yaml index 8434511..05a4364 100644 --- a/charts/generic/generic.package.yaml +++ b/charts/generic/generic.package.yaml @@ -39,4 +39,6 @@ experiments: - name: kubelet-service-kill CSV: kubelet-service-kill.chartserviceversion.yaml desc: "kubelet-service-kill" - \ No newline at end of file + - name: pod-network-duplication + CSV: pod-network-duplication.chartserviceversion.yaml + desc: "pod-network-duplication" diff --git a/charts/generic/icons/pod-network-duplication.png b/charts/generic/icons/pod-network-duplication.png new file mode 100644 index 0000000..5d13f6b Binary files /dev/null and b/charts/generic/icons/pod-network-duplication.png differ diff --git a/charts/generic/pod-network-duplication/engine.yaml b/charts/generic/pod-network-duplication/engine.yaml new file mode 100644 index 0000000..7f1c613 --- /dev/null +++ b/charts/generic/pod-network-duplication/engine.yaml @@ -0,0 +1,43 @@ +# chaosengine.yaml +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: nginx-network-chaos + namespace: default +spec: + # It can be delete/retain + jobCleanUpPolicy: 'delete' + # It can be true/false + annotationCheck: 'true' + # It can be active/stop + engineState: 'active' + #ex. values: ns1:name=percona,ns2:run=nginx + auxiliaryAppInfo: '' + monitoring: false + appinfo: + appns: 'default' + # FYI, To see app label, apply kubectl get pods --show-labels + applabel: 'app=nginx' + appkind: 'deployment' + chaosServiceAccount: pod-network-duplication-sa + experiments: + - name: pod-network-duplication + spec: + components: + env: + - name: TOTAL_CHAOS_DURATION + value: '60' # in seconds + + - name: LIB_IMAGE + value: 'gaiaadm/pumba:0.6.5' + + #Network interface inside target container + - name: NETWORK_INTERFACE + value: 'eth0' + + - name: NETWORK_PACKET_DUPLICATION_PERCENTAGE + value: '100' + + #If not provided it will take the first container of the target pod + - name: TARGET_CONTAINER + value: '' diff --git a/charts/generic/pod-network-duplication/experiment.yaml b/charts/generic/pod-network-duplication/experiment.yaml new file mode 100644 index 0000000..5a0bee2 --- /dev/null +++ b/charts/generic/pod-network-duplication/experiment.yaml @@ -0,0 +1,54 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + Injects network packet duplication on pods belonging to an app deployment +kind: ChaosExperiment +metadata: + name: pod-network-duplication + version: 0.1.0 +spec: + definition: + scope: Namespaced + permissions: + - apiGroups: + - "" + - "batch" + - "litmuschaos.io" + resources: + - "jobs" + - "pods" + - "pods/log" + - "events" + - "chaosengines" + - "chaosexperiments" + - "chaosresults" + verbs: + - "get" + - "list" + - "patch" + - "create" + - "update" + - "delete" + image: "litmuschaos/go-runner:latest" + args: + - -c + - ./experiments/pod-network-duplication + command: + - /bin/bash + env: + - name: TOTAL_CHAOS_DURATION + value: '60' + - name: RAMP_TIME + value: '' + - name: TARGET_CONTAINER + value: '' + - name: NETWORK_INTERFACE + value: 'eth0' + - name: NETWORK_PACKET_DUPLICATION_PERCENTAGE + value: '100' # in percentage + - name: LIB + value: 'pumba' + - name: LIB_IMAGE + value: 'gaiaadm/pumba:0.6.5' + labels: + name: pod-network-duplication diff --git a/charts/generic/pod-network-duplication/pod-network-duplication.chartserviceversion.yaml b/charts/generic/pod-network-duplication/pod-network-duplication.chartserviceversion.yaml new file mode 100644 index 0000000..3d29db9 --- /dev/null +++ b/charts/generic/pod-network-duplication/pod-network-duplication.chartserviceversion.yaml @@ -0,0 +1,43 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2020-07-01T10:28:08Z + name: pod-network-duplication + version: 0.1.0 + annotations: + categories: Kubernetes + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: pod-network-duplication + categoryDescription: | + Pod-network-duplication contains chaos to disrupt network connectivity to kubernetes pods. Experiments can inject percentage packet duplication on the app replica pods. + - Causes lossy access to application replica by injecting packet duplication using pumba. + - The application pod should be healthy once chaos is stopped. Service-requests should be served (say, via alternate replicas) despite chaos. + keywords: + - Kubernetes + - Network + - Duplication + platforms: + - GKE + - Minikube + - Packet(Kubeadm) + - EKS + maturity: alpha + maintainers: + - name: Udit Gaurav + email: udit.gaurav@mayadata.io + minKubeVersion: 1.12.0 + provider: + name: Mayadata + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/generic/pod-network-duplication + - name: Documentation + url: https://docs.litmuschaos.io/docs/pod-network-duplication/ + - name: Video + url: + icon: + - base64data: "" + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/pod-network-duplication/experiment.yaml diff --git a/charts/generic/pod-network-duplication/rbac.yaml b/charts/generic/pod-network-duplication/rbac.yaml new file mode 100644 index 0000000..cd4ee0e --- /dev/null +++ b/charts/generic/pod-network-duplication/rbac.yaml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: pod-network-duplication-sa + namespace: default + labels: + name: pod-network-duplication-sa +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: Role +metadata: + name: pod-network-duplication-sa + namespace: default + labels: + name: pod-network-duplication-sa +rules: +- apiGroups: ["","litmuschaos.io","batch"] + resources: ["pods","jobs","events","pods/log","chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + name: pod-network-duplication-sa + namespace: default + labels: + name: pod-network-duplication-sa +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: pod-network-duplication-sa +subjects: +- kind: ServiceAccount + name: pod-network-duplication-sa + namespace: default