maxsurge-deployment-parameter¶
The maxSurge deployment parameter is a configuration setting used within the kubernetes [[deployment]] strategy, specifically for the RollingUpdate type^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md]. It functions as a rate-limiting control to manage the speed and stability of new application versions during a rollout^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md].
Definition and Syntax¶
The parameter is defined within the spec.strategy configuration of a Deployment manifest^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md].
- Field:
spec.strategy.rollingUpdate.maxSurge - Purpose: It defines the maximum number of Pods that can be created above the desired number of
replicasduring the update process^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md].
Functionality¶
When a rolling update is initiated, the maxSurge parameter determines how many new instances (Pods) can be started simultaneously before old instances are terminated^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md]. This allows the deployment controller to spin up new resources to ensure capacity is maintained before scaling down the old version.
For example, if maxSurge is set to 1, the deployment controller will ensure that no more than one extra Pod is created at any given moment above the total replica count defined in the specification^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md].
Relationship with maxUnavailable¶
maxSurge is typically used in conjunction with maxUnavailable to balance resource availability against resource usage^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md].
maxSurge: Controls the upper limit of Pods (temporary increase in cluster capacity).maxUnavailable: Controls the lower limit of Pods (how many Pods are allowed to be down during the update).
Related Concepts¶
- [[Rolling Update]]
- Kubernetes Deployment
- [[Recreate Strategy]]
Sources¶
^[400-devops__06-Kubernetes__k8s-ithelp__Day13__README.md]