chaoskube

by joaquinito2051

Helm chartv3.1.0App 0.14.0

Chaoskube periodically kills random pods in your Kubernetes cluster.

About this chart

Chaoskube Helm Chart

chaoskube periodically kills random pods in your Kubernetes cluster.

TL;DR;

$ helm install <helm-repo>/chaoskube

$ helm install stable/chaoskube

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/chaoskube

$ helm install --name my-release stable/chaoskube The command deploys chaoskube on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

By default chaoskube runs in dry-run mode so it doesn't actually kill anything. If you're sure you want to use it run helm with:

$ helm install <helm-repo>/chaoskube --set dryRun=false

$ helm install stable/chaoskube --set dryRun=false

ParameterDescriptionDefault
namecontainer namechaoskube
imagedocker imagequay.io/linki/chaoskube
imageTagdocker image tagv0.11.0
replicasnumber of replicas to run1
intervalinterval between pod terminations10m
labelslabel selector to filter pods by"" (matches everything)
annotationsannotation selector to filter pods by"" (matches everything)
namespacesnamespace selector to filter pods by"" (all namespaces)
dryRundon't kill pods, only log what would have been donetrue
logFormatOptions to choose log format(i.e. "text" or "json")"text"
debugEnable debug logging mode, for detailed logsfalse
timezoneSet timezone for running actions (Optional)"" (UTC)
excludedWeekdaysSet Days of the Week to avoid actions (Optional)"" (Don't skip any weekdays)
excludedTimesOfDaySet Time Range to avoid actions (Optional)"" (Don't skip any times of day)
excludedDaysOfYearSet Days of the Year to avoid actions (Optional)"" (Don't skip any days)
priorityClassNamepriorityClassNamenil
rbac.createcreate rbac service account and rolesfalse
rbac.serviceAccountNamename of serviceAccount to use when create is falsedefault
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
affinityAffinity settings for pod assignment{}
minimumAgeSet minimum pod age to filter pod by0s
podAnnotationsAnnotations for the chaoskube pod{}
gracePeriodgrace period to give pods when terminating them-1s (pod decides)
metrics.enabledEnable metrics handlerfalse
metrics.portListening port for metrics handler8080
metrics.service.typeMetrics service typeClusterIP
metrics.service.portMetrics service port8080
metrics.serviceMonitor.enabledSet this to true to create ServiceMonitor for Prometheus operatorfalse
metrics.serviceMonitor.additionalLabelsAdditional labels that can be used so ServiceMonitor will be discovered by Prometheus{}

Setting label and namespaces selectors from the shell can be tricky but is possible (example with zsh):

$ helm install \
  --set labels='app=mate\,stage!=prod',namespaces='!kube-system\,!production' \
  <helm-repo>/chaoskube --debug --dry-run | grep -A7 args
$ helm install \
    args:
    - --interval=10m
    - --labels=app=foo,stage!=prod
    - --namespaces=!kube-system,!production
    - --timezone=America/New_York
    - --excludedWeekdays="Sat,Tue"
    - --excludedTimesOfDay="12:00-18:00"
    - --excludedDaysOfYear="Apr1,Dec24"

Deploy chaoskube with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has chaoskube on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartchaoskube is pinned at v3.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply