Difference between revisions of "Kubernetes restartPolicy"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
* https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
 
* https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
  
* <code>[[restartPolicy]]:</code> <code>Always, OnFailure</code>, and <code>Never</code>.
+
* <code>[[restartPolicy]]:</code> for pods <code>Always, OnFailure</code>, and <code>Never</code>.
 +
* <code>[[restartPolicy]]:</code> for [[Pod templates]] in [[Deployments]] only <code>Always</code>
  
 
* [[kind: Pod]]
 
* [[kind: Pod]]

Revision as of 12:44, 7 February 2024

  • PodStatus: PodScheduled, ContainersReady, Initialized, Ready

Container restartPolicy

 apiVersion: v1
kind: Pod
metadata:
  name: secret-env-pod
spec:
  containers:
  - name: mycontainer
    image: redis
    env:
      - name: SECRET_USERNAME
        valueFrom:
          secretKeyRef:
            name: mysecret
            key: username
            optional: false # same as default; "mysecret" must exist
                            # and include a key named "username"
      - name: SECRET_PASSWORD
        valueFrom:
          secretKeyRef:
            name: mysecret
            key: password
            optional: false # same as default; "mysecret" must exist
                            # and include a key named "password"
  restartPolicy: Never

Related

See also

Advertising: