chore(new_chart): Add Chaos Charts for pod autoscaler experiment (#286)

* Add pod autoscaler charts

Signed-off-by: Udit Gaurav <udit.gaurav@mayadata.io>
This commit is contained in:
UDIT GAURAV
2020-08-15 18:59:22 +05:30
committed by GitHub
parent fbbc16c2a3
commit 7e62c050e8
7 changed files with 186 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ spec:
- pod-network-duplication
- node-taint
- docker-service-kill
- pod-autoscaler
keywords:
- Kubernetes

View File

@@ -47,4 +47,7 @@ experiments:
desc: "node-taint"
- name: docker-service-kill
CSV: docker-service-kill.chartserviceversion.yaml
desc: "docker-service-kill"
desc: "docker-service-kill"
- name: pod-autoscaler
CSV: pod-autoscaler.chartserviceversion.yaml
desc: "pod-autoscaler"

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,33 @@
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: nginx-chaos
namespace: default
spec:
# It can be true/false
annotationCheck: 'false'
# It can be active/stop
engineState: 'active'
#ex. values: ns1:name=percona,ns2:run=nginx
auxiliaryAppInfo: ''
appinfo:
appns: 'default'
applabel: 'app=nginx'
appkind: 'deployment'
chaosServiceAccount: pod-autoscaler-sa
monitoring: false
# It can be delete/retain
jobCleanUpPolicy: 'delete'
experiments:
- name: pod-autoscaler
spec:
components:
env:
# set chaos duration (in sec) as desired
- name: TOTAL_CHAOS_DURATION
value: '60'
# number of replicas to scale
- name: REPLICA_COUNT
value: '5'

View File

@@ -0,0 +1,67 @@
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Scale the application replicas and test the node autoscaling on cluster
kind: ChaosExperiment
metadata:
name: pod-autoscaler
version: 0.1.0
spec:
definition:
scope: Cluster
permissions:
- apiGroups:
- ""
- "batch"
- "apps"
- "litmuschaos.io"
resources:
- "jobs"
- "pods"
- "pods/log"
- "deployments"
- "events"
- "chaosengines"
- "chaosexperiments"
- "chaosresults"
verbs:
- "create"
- "list"
- "get"
- "patch"
- "update"
- "delete"
- apiGroups:
- ""
resources:
- "nodes"
verbs:
- "get"
- "list"
image: "litmuschaos/go-runner:latest"
imagePullPolicy: Always
args:
- -c
- ./experiments/pod-autoscaler
command:
- /bin/bash
env:
- name: TOTAL_CHAOS_DURATION
value: '60'
# Period to wait before and after injection of chaos in sec
- name: RAMP_TIME
value: ''
# Number of replicas to scale
- name: REPLICA_COUNT
value: '5'
# PROVIDE THE LIB HERE
# ONLY LITMUS SUPPORTED
- name: LIB
value: 'litmus'
labels:
name: pod-autoscaler

View File

@@ -0,0 +1,44 @@
apiVersion: litmuchaos.io/v1alpha1
kind: ChartServiceVersion
metadata:
createdAt: 2020-08-08T10:28:08Z
name: pod-autoscaler
version: 0.1.0
annotations:
categories: Kubernetes
vendor: CNCF
support: https://slack.kubernetes.io/
spec:
displayName: pod-autoscaler
categoryDescription: |
The experiment aims to check the ability of nodes to accommodate the number of replicas a given application pod.
This experiment can be used for other scenarios as well, such as for checking the Node auto-scaling feature. For example, check if the pods are successfully rescheduled within a specified period in cases where the existing nodes are already running at the specified limits.
keywords:
- Kubernetes
- Scale
- State
- Node
- Replicas
platforms:
- GKE
- EKS
- Minikube
maturity: alpha
chaosType: infra
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-autoscaler
- name: Documentation
url: https://docs.litmuschaos.io/docs/pod-autoscaler/
- name: Video
url:
icon:
- url:
mediatype: ""
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/pod-autoscaler/experiment.yaml

View File

@@ -0,0 +1,37 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-autoscaler-sa
namespace: default
labels:
name: pod-autoscaler-sa
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: pod-autoscaler-sa
labels:
name: pod-autoscaler-sa
rules:
- apiGroups: ["","litmuschaos.io","batch","apps"]
resources: ["pods","deployments","jobs","events","chaosengines","pods/log","chaosexperiments","chaosresults"]
verbs: ["create","list","get","patch","update","delete"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get","list"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: pod-autoscaler-sa
labels:
name: pod-autoscaler-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: pod-autoscaler-sa
subjects:
- kind: ServiceAccount
name: pod-autoscaler-sa
namespace: default