Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaoskube does not kill pods and cannot target the chaoskube to specific namespaces #556

Closed
Dorsosiv opened this issue Aug 8, 2023 · 1 comment

Comments

@Dorsosiv
Copy link

Dorsosiv commented Aug 8, 2023

I deployed chaos kube with the following helm commands:

#! /bin/bash
helm repo add chaoskube https://linki.github.io/chaoskube/
helm install chaoskube chaoskube/chaoskube --atomic --namespace=chaoskube --create-namespace \
  -f values.yaml --set namespaces='test-namespace' --set labels='app=test' ;

and the values.yaml is

---
# replicaCount configures the number of replicas to run
replicaCount: 1

# image specifies image location, tag and pullPolicy
image:
  repository: ghcr.io/linki/chaoskube
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

# chaoskube is used to configure chaoskube
chaoskube:
  env: {}
  envFromConfigMapRefs: []
    # - 'configmap-a'
  args: 
    ######
    # Example configuration, uncomment and adjust to your needs.
    # Be sure to read: https://github.com/linki/chaoskube#flags
    ######
    # kill a pod every 10 minutes
    interval: "1m"
    # only target pods in the test environment
    #labels: "environment=test"
    # only consider pods with this annotation
    #annotations: "chaos.alpha.kubernetes.io/enabled=true"
    # exclude all DaemonSet pods
    #kinds: "!DaemonSet"
    # exclude all pods in the kube-system namespace
    #namespaces: "!kube-system"
    # don't kill anything on weekends
    #excluded-weekdays: "Sat,Sun"
    # don't kill anything during the night or at lunchtime
    #excluded-times-of-day: "22:00-08:00,11:00-13:00"
    # don't kill anything as a joke or on christmas eve
    #excluded-days-of-year: "Apr1,Dec24"
    # let's make sure we all agree on what the above times mean
    #timezone: "UTC"
    # exclude all pods that haven't been running for at least one hour
    #minimum-age: "1h"
    # terminate pods for real: this disables dry-run mode which is on by default
    #no-dry-run: ""

# serviceAccount can be used to customize the service account which will be crated and used by chaoskube
serviceAccount:
  create: true
  name: ""
  annotations: {}

# podAnnotations can be used to add additional annotations to the pod
podAnnotations: {}

# additionalLabels can be used to add additional labels to the pod
additionalLabels: {}

# podSecurityContext is used to customize the security context of the pod
podSecurityContext:
  runAsNonRoot: true
  runAsUser: 65534
  readOnlyRootFilesystem: true
  capabilities:
    drop: ["ALL"]

# resources can be used to limit pod compute resources (limits/requests)
resources: 
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 10m
    memory: 16Mi

# tolerations can be used to configure tolerations for the pods
tolerations: []

I have a few issues:

  • The chaoskube is not terminating the pods at all its just writing in the logs that its going to remove it but its not doing anything.
  • Its not working with the values and the set flags. Its trying to remove pods from namespaces that are not in the filter ...

Please help

@linki
Copy link
Owner

linki commented Sep 8, 2023

  • The chaoskube is not terminating the pods at all its just writing in the logs that its going to remove it but its not doing anything.

That's a safety feature, you also need to set no-dry-run: "" in your values.yaml or via the --set flag, see https://github.com/linki/chaoskube/blob/master/chart/chaoskube/README.md#example-helm-values

  • Its not working with the values and the set flags. Its trying to remove pods from namespaces that are not in the filter ...

Please try the following:

helm install ... -f values.yaml --set namespaces=test-namespace,labels=app=test

Also see this comment: helm/helm#3351 (comment)

@linki linki closed this as completed Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants