apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: crash-loop
  labels:
    name: crash-loop
    app: crash-app
spec:
  selector:
    matchLabels:
      name: crash-loop
      app: crash-app
  template:
    metadata:
      labels:
        name: crash-loop
        app: crash-app
    spec:
      containers:
      - name: crash-loop-back-off
        image: busybox
        imagePullPolicy: IfNotPresent
        command: ["sh", "-c", "echo 'this is a log from the crashing container' && test 0 -eq 1"]
        readinessProbe:
          exec:
            command:
            - "test -d /not/a/directory"
          initialDelaySeconds: 0
          periodSeconds: 1
          timeoutSeconds: 1
          failureThreshold: 1
