...

/

Running One-Shot Experiments

Running One-Shot Experiments

In this lesson, we will learn about Kubernetes jobs and apply a job to our cluster for one-shot experiments.

For now, we’re going to focus on one-shot experiments that we’ll run manually, or through pipelines, or any other means that we might see fit.

Inspecting the once.yaml file

Let’s take a look at yet another Kubernetes YAML file.

Press + to interact
cat k8s/chaos/once.yaml

The output is as follows.

---

apiVersion: batch/v1
kind: Job
metadata:
  name: go-demo-8-chaos
spec:
  activeDeadlineSeconds: 600
  backoffLimit: 0
  template:
    metadata:
      labels:
        app: go-demo-8-chaos
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      serviceAccountName: chaostoolkit
      restartPolicy: Never
      containers:
      - name: chaostoolkit
        image: vfarcic/chaostoolkit:1.4.1-2
        args:
        - --verbose
        - run
        - /experiment/health-http.yaml
        env:
        - name: CHAOSTOOLKIT_IN_POD
          value: "true"
        volumeMounts:
        - name: config
          mountPath: /experiment
          readOnly: true
        resources:
          limits:
            cpu: 20m
            memory: 64Mi
          requests:
            cpu: 20m
            memory: 64Mi
      volumes:
      - name:
...
Access this course and 1400+ top-rated courses and projects.