apiVersion: apps/v1
kind: Deployment
metadata:
  name: crash-loop
  labels:
    name: crash-loop
    app: crash-app
spec:
  replicas: 2
  selector:
    matchLabels:
      name: crash-loop
      app: crash-app
  progressDeadlineSeconds: 60
  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
