Added chaosmesh

This commit is contained in:
Justine Pelletreau 2022-08-26 17:06:14 +02:00
parent 49d8ad4ed6
commit f6166a4319
5 changed files with 86 additions and 1 deletions

View File

@ -0,0 +1,16 @@
kind: PodChaos
apiVersion: chaos-mesh.org/v1alpha1
metadata:
namespace: default
name: killtest
spec:
selector:
namespaces:
- default
labelSelectors:
run: linx
mode: one
action: pod-failure
duration: 30s
gracePeriod: 0

14
chaos-mesh/README.md Normal file
View File

@ -0,0 +1,14 @@
# Install
helm repo add chaos-mesh https://charts.chaos-mesh.org
helm repo update
helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --create-namespace --set dashboard.create=true
# Get the token
See the dashboard folder, it is the same method:
```
sudo k3s kubectl -n kubernetes-dashboard create token admin-user
```
...gives a token named admin-user

View File

@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: chaos-ingr
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 500m
spec:
ingressClassName: nginx
rules:
- host: chaos.sq.lan
http:
paths:
- pathType: Prefix
backend:
service:
name: chaos-dashboard
port:
number: 2333
path: /

36
chaos-mesh/rbac.yaml Normal file
View File

@ -0,0 +1,36 @@
kind: ServiceAccount
apiVersion: v1
metadata:
namespace: default
name: account-default-manager-goovh
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: default
name: role-default-manager-goovh
rules:
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["get", "watch", "list"]
- apiGroups:
- chaos-mesh.org
resources: [ "*" ]
verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: bind-default-manager-goovh
namespace: default
subjects:
- kind: ServiceAccount
name: account-default-manager-goovh
namespace: default
roleRef:
kind: Role
name: role-default-manager-goovh
apiGroup: rbac.authorization.k8s.io

View File

@ -5,7 +5,7 @@ metadata:
run: linx run: linx
name: linx name: linx
spec: spec:
replicas: 1 replicas: 3
selector: selector:
matchLabels: matchLabels:
run: linx run: linx