Kubernetes ends up with long running pods when an image specified for a container is purged from an image repository. These deployments are created by a continuous integration system and sometimes pipelines are run or rerun when images have been purged.
The status from kubectl get pods shows ImagePullBackOff.
What should be set in the kube config yaml file to stop these pods from running for days? Ideally we just want the Image to be pulled a couple of times and then fail if it's unsuccessful.
The pod definition is
apiVersion: v1
kind: Pod
metadata:
  name: test-missing-image
spec:
  containers:
  - image: missingimage
    name: test
    resources:
      limits:
        memory: "10000Mi"
    readinessProbe:
      httpGet:
        port: 5678
        path: /somePath
      initialDelaySeconds: 360
      periodSeconds: 30
      timeoutSeconds: 30
  restartPolicy: Never
  terminationGracePeriodSeconds: 0
Thanks!
 
    