Difference between revisions of "Kubernetes restartPolicy"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 3: Line 3:
 
* <code>[[restartPolicy]]:</code> <code>Always, OnFailure</code>, and <code>Never</code>.
 
* <code>[[restartPolicy]]:</code> <code>Always, OnFailure</code>, and <code>Never</code>.
  
 +
* [[kind: Pod]]
 +
* [[kind: Deployment]]
  
 
* <code>[[PodStatus]]: PodScheduled, ContainersReady, Initialized, Ready</code>
 
* <code>[[PodStatus]]: PodScheduled, ContainersReady, Initialized, Ready</code>

Revision as of 11:09, 10 October 2023

  • 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: