apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Detaching an ebs volume from ec2 instance.
kind: ChaosExperiment
metadata:
  name: ebs-loss
  labels:
    name: ebs-loss
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "batch"
          - "litmuschaos.io"
        resources:
          - "jobs"
          - "pods"
          - "events"
          - "pods/log"
          - "pods/exec"
          - "secrets"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "list"
          - "get"
          - "patch"
          - "update"
          - "delete"
    image: "litmuschaos/go-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ./experiments -name ebs-loss
    command:
    - /bin/bash
    env:
    - name: TOTAL_CHAOS_DURATION
      value: '60'

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

    - name: EC2_INSTANCE_ID
      value: ''

    - name: EBS_VOL_ID
      value: ''

    - name: REGION
      value: ''

    # Provide the path of aws credentials mounted from secret
    - name: AWS_SHARED_CREDENTIALS_FILE
      value: '/tmp/cloud_config.yml'

    # provide the LIB
    # only litmus supported
    - name: LIB
      value: 'litmus'  
          
    - name: DEVICE_NAME
      value: '' 
          
    labels:
      name: ebs-loss
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    secrets:
    - name: cloud-secret
      mountPath: /tmp/
