Deployment Configuration Spec
There are two spec declarations for the deployment. The first will modify the ReplicaSet created, while the second will pass along the Pod configuration.
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: dev-web
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdateLearn more details about the elements present in our example.
spec
A declaration that the following items will configure the object being created.
progressDeadlineSeconds
Time in seconds until a progress error is reported during a change. Reasons could be quotas, image issues, or limit ranges.
replicas
As the object being created is a ReplicaSet, this parameter determines how many Pods should be created. If you were to use kubectl edit and change this value to two, a second Pod would be generated.
revisionHistoryLimit
How many old ReplicaSet specifications to retain for rollback.
selector
A collection of values ANDed together. All must be satisfied for the replica to match. Do not create Pods which match these selectors, as the deployment controller may try to control the resource, leading to issues.
matchLabels
Set-based requirements of the Pod selector. Often found with the matchExpressions statement, to further designate where the resource should be scheduled.
strategy
A header for values having to do with updating Pods. Works with the later listed type. Could also be set to Recreate, which would delete all existing pods before new pods are created. With RollingUpdate, you can control how many Pods are deleted at a time with the following parameters.
maxsurge
Maximum number of Pods over desired number of Pods to create. Can be a percentage, default of 25%, or an absolute number. This creates a certain number of new Pods before deleting old ones, for continued access.
maxUnavailable
A number or percentage of Pods which can be in a state other than Ready during the update process.
type
Even though listed last in the section, due to the level of white space indentation, it is read as the type of object being configured. (e.g. RollingUpdate).
Last updated