Deployment controllers implement a crucial function in Kubernetes clusters: horizontal pod scaling (expansion and contraction). This capability is essential for modern cloud platforms.
When encountering a business scenario requiring database modifications and Pod restarts, we need to temporarily pause the application’s updates to the table while data is being adjusted, then resume the Pod after the adjustments are complete
Are there other ways to achieve a similar effect to pausing, besides forcefully deleting Deployments?
kubectl scale --replicas=0 deployment/<your-deployment>
Before seeing the answer, many people probably wouldn’t have thought of it. Once they see it, a smile comes to mind – their thinking hasn’t caught up, still stuck in an era focused on directly manipulating processes and wanting to operate business processes that way.