Kubernetes Deployment Manifest: Difference between revisions
Line 64: | Line 64: | ||
The template describes the pods that will be created. Its structure is similar to that of a pod manifest. | The template describes the pods that will be created. Its structure is similar to that of a pod manifest. | ||
===Pod Names=== | |||
⚠️ The pod template manifest allows specifying a pod name, however it will be ignored. The pod names will be generated based on the deployment name, appending random sequences of characters: | ⚠️ The pod template manifest allows specifying a pod name, however it will be ignored. The pod names will be generated based on the deployment name, appending random sequences of characters: | ||
<syntaxhighlight lang='text'> | <syntaxhighlight lang='text'> |
Revision as of 19:11, 15 October 2020
External
Internal
Overview
Example
apiVersion: apps/v1 kind: Deployment metadata: name: archaeopteryx labels: color: blue spec: replicas: 1 selector: matchLabels: function: 'builder' strategy: revisionHistoryLimit: progressDeadlineSeconds: template: metadata: # see pod manifest ... spec: # see pod manifest ...
.spec Elements
replicas
Specifies the number of desired pods. Defaults to 1.
selector
Specifies the label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.
strategy
Specifies the deployment strategy to use to replace existing pods with new ones.
revisionHistoryLimit
The number of old ReplicaSets to retain to allow rollback. Defaults to 10.
progressDeadlineSeconds
The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.
template
The template describes the pods that will be created. Its structure is similar to that of a pod manifest.
Pod Names
⚠️ The pod template manifest allows specifying a pod name, however it will be ignored. The pod names will be generated based on the deployment name, appending random sequences of characters:
httpd-6b8bb7895d-m9bzt