😅 The Problem Every DevOps Knows
Imagine this: It's midnight, your app has too many users, and your Pods need more CPU and memory. But in Kubernetes, changing resources means:
- Delete and restart the Pods (bye-bye, active connections!)
- Wait for a rolling update (more waiting time)
- Hope there's no downtime (but there's always some)
Until now, changing Pod resources required a restart. But with Kubernetes 1.33, this is no longer true! 🎉
🚀 What's New? Pods That Grow Without Restarting!
Now you can:
✅ Increase/Decrease CPU and memory without restarting
✅ Works with StatefulSets (great for databases!)
✅ Choose if the Pod restarts on errors
Real-life example:
- Problem: An API gets 10x more traffic than usual
- Old way: Rolling update → 30 seconds of downtime
-
New way:
kubectl patch
→ 0 downtime
💡 How to Use It? (Easy Code Example 🛠️)
1. Create a Pod with resize policy
apiVersion: v1
kind: Pod
metadata:
name: scalable-app
spec:
containers:
- name: web
image: nginx
resources:
requests:
cpu: "1"
memory: "1Gi"
limits:
cpu: "2"
memory: "2Gi"
resizePolicy: # The magic is here!
- resourceName: cpu
restartPolicy: NotRequired # No restart if it fails
- resourceName: memory
restartPolicy: NotRequired
2. Change resources while running
kubectl patch pod scalable-app -p '{
"spec": {
"containers": [{
"name": "web",
"resources": {
"requests": {"cpu": "2", "memory": "2Gi"},
"limits": {"cpu": "3", "memory": "3Gi"}
}
}]
}
}'
Done! The Pod keeps running with more resources.
🏢 Why Is This Good for Companies?
- 🔄 Less downtime → Better for important apps
- 💰 Save cloud costs → Reduce resources when not needed
- 📈 Handle traffic spikes fast → No waiting for deployments
- 🗃️ Better for databases → No restarts to change memory
⚠️ Any Problems?
- Not all runtimes support it yet (check your CRI)
-
You need to configure it (add
resizePolicy
) - New feature = possible bugs (test first in staging)
🔚 Conclusion: A Big Step for Kubernetes
Now you can change Pod resources without restarting. No more choosing between "low resources" or "risky restarts".
Will you try it? Tell me in the comments! 👇
📌 Did you like this? Share and follow for more Kubernetes/DevOps posts. 🚀
🤝 Let's Connect!
If you find this repository useful and want to see more content like this, follow me on LinkedIn to stay updated on more projects and resources!
If you’d like to support my work, you can buy me a coffee. Thank you for your support!
Thank you for reading! 😊
Top comments (1)
Awesomeeee