Difference between revisions of "Kubernetes restartPolicy"
Jump to navigation
Jump to search
(27 intermediate revisions by 4 users not shown) | |||
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> 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: Deployment]] | ||
+ | |||
+ | * <code>[[PodStatus]]: PodScheduled, ContainersReady, Initialized, Ready</code> | ||
+ | |||
+ | * <code>[[kubectl get deployments -o json -A]] | grep restartPolicy</code> | ||
+ | |||
+ | == Container restartPolicy == | ||
+ | {{K8s secret official example}} | ||
+ | |||
+ | == Related == | ||
+ | * [[Docker restartPolicy]] | ||
+ | * [[Kubernetes Pod Lifecycle]] | ||
+ | * <code>[[resources:]]</code> | ||
+ | * <code>[[autoScaler:]]</code> | ||
+ | * <code>[[kubectl get pods -o json]]</code> | ||
+ | * <code>[[dnsPolicy]]</code> | ||
+ | * [[Kubernetes probes]] | ||
+ | * [[CrashLoopBackOff]] | ||
+ | * [[Liveness-exec with sidecar container]] | ||
== See also == | == See also == | ||
− | * {{K8s}} | + | * {{Kubernetes restartPolicy}} |
+ | * {{Kubernetes deployments}} | ||
+ | * {{K8s pods}} | ||
[[Category:K8s]] | [[Category:K8s]] |
Latest revision as of 11:10, 22 October 2024
restartPolicy:
for podsAlways, OnFailure
, andNever
.restartPolicy:
for Pod templates in Deployments onlyAlways
PodStatus: PodScheduled, ContainersReady, Initialized, Ready
kubectl get deployments -o json -A | grep restartPolicy
Container restartPolicy[edit]
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[edit]
- Docker restartPolicy
- Kubernetes Pod Lifecycle
resources:
autoScaler:
kubectl get pods -o json
dnsPolicy
- Kubernetes probes
- CrashLoopBackOff
- Liveness-exec with sidecar container
See also[edit]
- Kubernetes restartPolicy,
resources:, autoScaler:
- Kubernetes deployments, strategies:
kind: Deployment
, Strategies:Recreate
orRollingUpdate
,kubectl
[create | describe | get | scale | rollout | deployment/
], Kubernetes Canary Deployments,deployment.kubernetes.io
- Pods:
kubectl apply
,kubectl [ pod get | top | delete | describe pods ]
,InitContainers, PodInitializing, CrashLoopBackOff, ImagePullPolicy:, NodeAffinity, NodeSelector, Terminated
Advertising: