apiVersion: litmuschaos.io/v1alpha1
description:
  message: "Kills a container belonging to an application pod \n"
kind: ChaosExperiment
metadata:
  name: container-kill
  labels:
    name: container-kill
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
spec:
  definition:
    scope: Namespaced
    permissions:
      - apiGroups:
          - ""
          - "apps"
          - "batch"
          - "litmuschaos.io"
        resources:
          - "jobs"
          - "pods"
          - "pods/log"
          - "events"
          - "pods/exec"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "list"
          - "get"
          - "update"
          - "patch"
          - "delete"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/generic/container_kill/container_kill_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:

    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: TARGET_CONTAINER
      value: ''

    # Period to wait before injection of chaos in sec
    - name: RAMP_TIME
      value: ''

    # It supports pumba and containerd 
    - name: LIB
      value: 'pumba'

    # provide the chaos interval
    - name: CHAOS_INTERVAL
      value: '10'

    # provide the container runtime path for containerd
    # applicable only for containerd runtime
    - name: CONTAINER_PATH
      value: '/run/containerd/containerd.sock'

    # provide the total chaos duration
    - name: TOTAL_CHAOS_DURATION
      value: '20'

    # LIB_IMAGE can be - gaiaadm/pumba:0.6.5, litmuschaos/container-kill-helper:latest
    # For pumba image use: gaiaadm/pumba:0.6.5
    # For containerd image use: litmuschaos/container-kill-helper:latest
    - name: LIB_IMAGE  
      value: 'gaiaadm/pumba:0.6.5' 

    labels:
      name: container-kill
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
