Pumba is a chaos testing tool for Docker and Kubernetes (hence OpenShift too). It allows you to add some chaos on containers instances such as stopping, killing or removing containers randomly. But it also adding some network chaos such as delaying, packet loss or re-ordering.
You can see in next screen recording how to add Pumba on OpenShift cluster and add some chaos on it.
The security calls that you need to run before deploying Pumba are the next ones:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oc adm policy --as system:admin add-cluster-role-to-user cluster-admin developer | |
oc adm policy add-scc-to-user privileged system:serviceaccount:fasttest:default | |
oc edit scc restrict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you are running Kubernetes >= 1.1.0. You can take advantage of DaemonSets to automatically deploy the Pumba on all your nodes. | |
# On 1.1.x you'll need to explicitly enable the DaemonSets extension, see http://kubernetes.io/v1.1/docs/admin/daemons.html#caveats. | |
# You'll then be able to deploy the DaemonSet with the command | |
# `kubectl create -f pumba_kube.yaml` | |
# If you are not running Kubernetes >= 1.1.0 or do not want to use DaemonSets, you can also run the Pumba as a regular docker container on each node you want to make chaos. | |
# `docker run -d -v /var/run/docker.sock:/var/run/docker.sock gaiaadm/pumba pumba --random --interval 3m kill --signal SIGKILL"` | |
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: pumba | |
spec: | |
template: | |
metadata: | |
labels: | |
app: pumba | |
name: pumba | |
spec: | |
containers: | |
- image: gaiaadm/pumba:master | |
imagePullPolicy: Always | |
name: pumba | |
command: ["pumba"] | |
args: ["--random", "--debug", "--interval", "30s", "kill", "--signal", "SIGKILL", "re2:.*hello.*"] | |
securityContext: | |
runAsUser: 0 | |
volumeMounts: | |
- name: dockersocket | |
mountPath: /var/run/docker.sock | |
volumes: | |
- hostPath: | |
path: /var/run/docker.sock | |
name: dockersocket |
I have sent a PR to upstream Pumba project with this file but meanwhile is not accepted you can use it this one.
I'd like to say thank you to Slava Semushin and Jorge Morales for helping me on understanding the OpenShift security model.
We keep learning,
Alex.
Ce joli rajolinet, que les oques tonifique, si le fique en une pique, mantindra le pompis net (El baró de Bidet - La Trinca)Music: https://www.youtube.com/watch?v=4JWIbKGe4gA
Follow me at https://twitter.com/alexsotob