Middle — Middle+
What approaches should be used if updating a Kubernetes cluster leads to service unavailability?
sobes.tech AI
Answer from AI
If a Kubernetes cluster update leads to service unavailability, the following approaches should be applied:
- Rolling Update: update pods one by one or in small batches to always keep available instances.
- Check readiness and liveness probes: ensure that probes are correctly configured so that Kubernetes does not route traffic to unready pods.
- Use update strategies with maxUnavailable and maxSurge: configure parameters to limit the number of pods that are unavailable at the same time.
- Check dependencies between services: ensure that the update does not break interactions between components.
- Monitoring and rollback: have the ability to quickly revert the update if problems occur.
- Test the update in a staging environment: reproduce the update process before production.
Example of rolling update configuration in Deployment:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
This allows updating one pod at a time, minimizing service downtime.