Refactoring of charts for byoc (#488)

* refactoring charts for byoc

Signed-off-by: Oum Kale <oumkale@chaosnative.com>
This commit is contained in:
OUM NIVRATHI KALE
2021-07-15 23:53:39 +05:30
committed by GitHub
parent a2faee68a1
commit e808bfcbc0
110 changed files with 458 additions and 486 deletions

View File

@@ -344,119 +344,4 @@ spec:
secrets:
- name: cloud-secret
mountPath: /tmp/
---
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Deletes an aws instance belonging to a deployment/statefulset/daemonset
kind: ChaosExperiment
metadata:
name: k8-aws-ec2-terminate
labels:
name: k8-aws-ec2-terminate
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: chaosexperiment
app.kubernetes.io/version: latest
spec:
definition:
scope: Namespaced
permissions:
- apiGroups:
- ""
- "apps"
- "batch"
- "litmuschaos.io"
resources:
- "deployments"
- "jobs"
- "pods"
- "configmaps"
- "chaosengines"
- "chaosexperiments"
- "chaosresults"
verbs:
- "create"
- "list"
- "get"
- "patch"
- "update"
- "delete"
- apiGroups:
- ""
resources:
- "nodes"
verbs :
- "get"
- "list"
image: "litmuschaos/chaostoolkit:latest"
args:
- -c
- python /app/chaos/chaostest/aws/aws_wrapper.py ; exit 0
command:
- /bin/bash
env:
- name: CHAOSTOOLKIT_IN_POD
value: 'true'
- name: FILE
value: 'ec2-delete.json'
- name: NAME_SPACE
value: 'default'
- name: LABEL_NAME
value: 'app=nginx'
- name: APP_ENDPOINT
value: 'localhost'
# Period to wait before injection of chaos in sec
- name: PERCENTAGE
value: '50'
# Variable to set for custom report upload
- name: REPORT
value: 'false'
# Variable to set for report upload endpoint
- name: REPORT_ENDPOINT
value: 'none'
# Variable to set for AWS account
- name: AWS_ACCOUNT
value: '000000000000'
# Variable to set for AWS role, Make sure you have created this role and have give access
- name: AWS_ROLE
value: 'chaosec2access'
# Variable to set for AWS region
- name: AWS_REGION
value: 'us-west-2'
# Variable to set for AWS AZ
- name: AWS_AZ
value: 'us-west-2c'
# Variable to set for AWS RESOURCE
- name: AWS_RESOURCE
value: 'ec2-iks'
# Variable to set for AWS SSL
- name: AWS_SSL
value: 'false'
# Variable which indicates where the test results CRs will be persisted
- name: TEST_NAMESPACE
value: 'default'
labels:
name: k8-aws-ec2-terminate
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: experiment-job
app.kubernetes.io/version: latest
---

View File

@@ -1,20 +0,0 @@
# Pre-requisite
_In Namespace Changes_
- This experiment assume that you are using AWS with kubernetes
- This experiment assume your namespace has right role for aws to make aws api calls
- This experiment also assume you are using Instance group for your name space or aware that if you are using share node group, it will impact other pods running on this ec2 instance
# Procedure
- Apply experiments for k8 - `kubectl apply -f experiments.yaml`
- Validate the experiments for k8 - `kubectl get chaosexperiment`
- Setup RBAC - for pod delete RBAC - `kubectl apply -f rbac.yaml`
- Create pod Experiment - for health experiment -`kubectl create -f engine.yaml`
- Validate experiment - `kubectl get pods -o wide`
- Validate logs - `kubectl logs -f <delete pod>`
- Clean up chaosexperiment -`kubectl delete -f engine.yaml`
- Clean up rbac -`kubectl delete -f rbac.yaml`

View File

@@ -1,49 +0,0 @@
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: k8-aws-ec2-terminate
namespace: default
spec:
appinfo:
appns: 'default'
applabel: 'app=nginx'
appkind: 'deployment'
engineState: 'active'
chaosServiceAccount: chaos-admin
components:
runner:
runnerannotation:
iam.amazonaws.com/role: "k8s-chaosec2access"
experiments:
- name: k8-aws-ec2-terminate
spec:
components:
experimentannotation:
iam.amazonaws.com/role: "k8s-chaosec2access"
env:
- name: NAME_SPACE
value: default
- name: LABEL_NAME
value: app=nginx
- name: APP_ENDPOINT
value: localhost
- name: FILE
value: 'ec2-delete.json'
- name: AWS_ROLE
value: 'chaosec2access'
- name: AWS_ACCOUNT
value: '0000000000'
- name: AWS_REGION
value: 'us-west-2'
- name: AWS_AZ
value: 'us-west-2c'
- name: AWS_RESOURCE
value: 'ec2-iks'
- name: AWS_SSL
value: 'false'
- name: REPORT
value: 'true'
- name: REPORT_ENDPOINT
value: 'none'
- name: TEST_NAMESPACE
value: 'default'

View File

@@ -1,112 +0,0 @@
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Deletes an aws instance belonging to a deployment/statefulset/daemonset
kind: ChaosExperiment
metadata:
name: k8-aws-ec2-terminate
labels:
name: k8-aws-ec2-terminate
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: chaosexperiment
app.kubernetes.io/version: latest
spec:
definition:
scope: Namespaced
permissions:
- apiGroups:
- ""
- "apps"
- "batch"
- "litmuschaos.io"
resources:
- "deployments"
- "jobs"
- "pods"
- "configmaps"
- "chaosengines"
- "chaosexperiments"
- "chaosresults"
verbs:
- "create"
- "list"
- "get"
- "patch"
- "update"
- "delete"
- apiGroups:
- ""
resources:
- "nodes"
verbs :
- "get"
- "list"
image: "litmuschaos/chaostoolkit:latest"
args:
- -c
- python /app/chaos/chaostest/aws/aws_wrapper.py ; exit 0
command:
- /bin/bash
env:
- name: CHAOSTOOLKIT_IN_POD
value: 'true'
- name: FILE
value: 'ec2-delete.json'
- name: NAME_SPACE
value: 'default'
- name: LABEL_NAME
value: 'app=nginx'
- name: APP_ENDPOINT
value: 'localhost'
# Period to wait before injection of chaos in sec
- name: PERCENTAGE
value: '50'
# Variable to set for custom report upload
- name: REPORT
value: 'false'
# Variable to set for report upload endpoint
- name: REPORT_ENDPOINT
value: 'none'
# Variable to set for AWS account
- name: AWS_ACCOUNT
value: '000000000000'
# Variable to set for AWS role, Make sure you have created this role and have give access
- name: AWS_ROLE
value: 'chaosec2access'
# Variable to set for AWS region
- name: AWS_REGION
value: 'us-west-2'
# Variable to set for AWS AZ
- name: AWS_AZ
value: 'us-west-2c'
# Variable to set for AWS RESOURCE
- name: AWS_RESOURCE
value: 'ec2-iks'
# Variable to set for AWS SSL
- name: AWS_SSL
value: 'false'
# Variable which indicates where the test results CRs will be persisted
- name: TEST_NAMESPACE
value: 'default'
labels:
name: k8-aws-ec2-terminate
app.kubernetes.io/part-of: litmus
app.kubernetes.io/component: experiment-job
app.kubernetes.io/version: latest

View File

@@ -1,38 +0,0 @@
apiVersion: litmuchaos.io/v1alpha1
kind: ChartServiceVersion
metadata:
name: k8-aws-ec2-terminate
version: 0.0.1
annotations:
categories: Kubernetes
vendor: CNCF
createdAt: 2020-02-24T10:28:08Z
support: https://slack.kubernetes.io/
spec:
displayName: k8-aws-ec2-terminate
categoryDescription: |
AWS EC2 terminate contains chaos to disrupt state of aws resources running part of kuberntes cluster workload. It uses chaostoolkit to inject ec2 instance termination against a specified applications
keywords:
- Kubernetes
- AWS
- EC2
- State
platforms:
- Minikube
maturity: alpha
maintainers:
- name: sumit
email: sumit_nagal@intuit.com
minKubeVersion: 1.12.0
provider:
name: Intuit
labels:
app.kubernetes.io/component: chartserviceversion
app.kubernetes.io/version: latest
links:
- name: Source Code
url: https://github.com/litmuschaos/litmus-python/tree/master/chaos-test
icon:
- url:
mediatype: ""
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/kube-aws/k8-aws-ec2-terminate/experiment.yaml

View File

@@ -1,38 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: k8-aws-ec2-terminate-sa
labels:
name: k8-aws-ec2-terminate-sa
app.kubernetes.io/part-of: litmus
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: k8-aws-ec2-terminate-sa
labels:
name: k8-aws-ec2-terminate-sa
app.kubernetes.io/part-of: litmus
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/v1
kind: ClusterRoleBinding
metadata:
name: k8-aws-ec2-terminate-sa
labels:
name: k8-aws-ec2-terminate-sa
app.kubernetes.io/part-of: litmus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: k8-aws-ec2-terminate-sa
subjects:
- kind: ServiceAccount
name: k8-aws-ec2-terminate-sa
namespace: default

View File

@@ -12,7 +12,6 @@ spec:
categoryDescription: >
kube-aws contains chaos to disrupt state of aws resources running part of kubernetes cluster
experiments:
- k8-aws-ec2-terminate
- ec2-terminate-by-id
- ec2-terminate-by-tag
- ebs-loss-by-id
@@ -22,8 +21,8 @@ spec:
- EC2
- State
maintainers:
- name: sumit
email: sumit_nagal@intuit.com
- name: ksatchit
email: karthik.s@mayadata.io
provider:
name: Intuit
links:

View File

@@ -1,8 +1,5 @@
packageName: kube-aws
experiments:
- name: k8-aws-ec2-terminate
CSV: k8-aws-ec2-terminate.chartserviceversion.yaml
desc: "k8-aws-ec2-terminate"
- name: ec2-terminate-by-id
CSV: ec2-terminate-by-id.chartserviceversion.yaml
desc: "ec2-terminate-by-id"