What deployment strategies exist in Kubernetes?
sobes.tech AI
Answer from AI
In Kubernetes, there are several main deployment strategies that help update applications without downtime:
-
Rolling Update — the standard update method where new pods are created gradually, and old ones are removed as the new ones become ready. This ensures continuous service operation.
-
Recreate — all old pods are deleted first, then new ones are created. Used when it is not possible to run old and new versions simultaneously.
-
Blue-Green Deployment — two environments (blue and green) are deployed. The new version runs in the "green" environment, and after verification, traffic is switched from "blue" to "green".
-
Canary Deployment — the new version is launched on a small subset of pods to test stability, then gradually the share of the new version increases.
-
A/B Testing — similar to canary, but with traffic split between different versions for testing.
Example of Rolling Update in a Deployment manifest:
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1