diff --git a/stable/chaoskube/Chart.yaml b/stable/chaoskube/Chart.yaml index 65868072f5..787d740b09 100755 --- a/stable/chaoskube/Chart.yaml +++ b/stable/chaoskube/Chart.yaml @@ -1,5 +1,5 @@ name: chaoskube -version: 0.3.1-1 +version: 0.4.0 description: Chaoskube periodically kills random pods in your Kubernetes cluster. home: https://github.com/linki/chaoskube sources: diff --git a/stable/chaoskube/README.md b/stable/chaoskube/README.md index ef887d6884..539c27240f 100644 --- a/stable/chaoskube/README.md +++ b/stable/chaoskube/README.md @@ -41,9 +41,24 @@ $ helm install stable/chaoskube --set dryRun=false |---------------------------|-----------------------------------------------------|-----------------------------------| | `name` | container name | chaoskube | | `image` | docker image | quay.io/linki/chaoskube | -| `imageTag` | docker image tag | v0.3.1 | +| `imageTag` | docker image tag | v0.4.0 | | `replicas` | number of replicas to run | 1 | | `interval` | interval between pod terminations | 10m | +| `labels` | label selector to filter pods by | "" (matches everything) | +| `namespaces` | namespace selector to filter pods by | "" (all namespaces) | | `dryRun` | don't kill pods, only log what would have been done | true | | `resources.cpu` | cpu resource requests and limits | 10m | | `resources.memory` | memory resource requests and limits | 16Mi | + +Setting label and namespaces selectors from the shell can be tricky but is possible (example with zsh): + +```console +$ helm install \ + --set labels='app=mate\,stage!=prod',namespaces='!kube-system\,!production' \ + stable/chaoskube --debug --dry-run | grep -A4 args + args: + - --in-cluster + - --interval=10m + - --labels=app=foo,stage!=prod + - --namespaces=!kube-system,!production +``` diff --git a/stable/chaoskube/templates/deployment.yaml b/stable/chaoskube/templates/deployment.yaml index 541aba1d89..b8adfb56a5 100644 --- a/stable/chaoskube/templates/deployment.yaml +++ b/stable/chaoskube/templates/deployment.yaml @@ -23,6 +23,8 @@ spec: args: - --in-cluster - --interval={{ .Values.interval }} + - --labels={{ .Values.labels }} + - --namespaces={{ .Values.namespaces }} {{- if not .Values.dryRun}} - --no-dry-run {{- end }} diff --git a/stable/chaoskube/values.yaml b/stable/chaoskube/values.yaml index 2a81241c31..8339dc932a 100644 --- a/stable/chaoskube/values.yaml +++ b/stable/chaoskube/values.yaml @@ -5,7 +5,7 @@ name: chaoskube image: quay.io/linki/chaoskube # docker image tag -imageTag: v0.3.1 +imageTag: v0.4.0 # number of replicas to run replicas: 1 @@ -13,6 +13,12 @@ replicas: 1 # interval between pod terminations interval: 10m +# label selector to filter pods by, e.g. app=foo,stage!=prod +labels: + +# namespace selector to filter pods by, e.g. '!kube-system,!production' (use quotes) +namespaces: + # don't kill pods, only log what would have been done dryRun: true