Kubernetes v1.36: Mastering In-Place Vertical Scaling for Pods
In the fast-paced world of cloud-native applications, resource management is critical. Kubernetes v1.36 addresses this need with in-place vertical scaling for pod-level resources, allowing you to modify resource limits on the fly. This feature minimizes downtime and enhances efficiency, enabling you to respond to changing workloads without the overhead of restarting containers.
When you initiate a pod-level resize, the Kubelet interprets this as a resize event for all containers within that pod. The key here is the resizePolicy defined for each container. If the policy is set to NotRequired, the Kubelet dynamically updates the cgroup limits via the Container Runtime Interface (CRI). However, if the policy is set to RestartContainer, the container will restart to safely apply the new resource limits. This flexibility allows for a tailored approach to resource management based on your application’s needs.
In production, understanding the implications of the restartPolicy is crucial. The default is NotRequired, which is beneficial for minimizing disruptions. However, be cautious when using RestartContainer, as it can lead to temporary unavailability of your application. Always test these configurations in a staging environment before rolling them out to production. This feature is still in beta, so keep an eye on updates and community feedback to ensure stability and performance in your deployments.
Key takeaways
- →Utilize the InPlacePodLevelResourcesVerticalScaling feature to adjust resource budgets without restarts.
- →Set the restartPolicy to NotRequired for minimal disruption during resource updates.
- →Understand the implications of RestartContainer to avoid unnecessary downtime.
Why it matters
This feature significantly reduces downtime during resource adjustments, allowing for more responsive scaling in production environments. It enables teams to manage resources more effectively, leading to better application performance and resource utilization.
Code examples
kubectl patch pod shared-pool-app --subresource resize --patch
'{When NOT to use this
The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.
Want the complete reference?
Read official docsIndustry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.
Get CKA certified →Kubernetes v1.37: Mastering the New Features for Resilience and Efficiency
Kubernetes v1.37 introduces critical features that enhance resilience and efficiency in your clusters. Notably, the HorizontalPodAutoscaler can now scale down to zero Pods when idle, optimizing resource usage. Dive in to understand how these updates can transform your production environment.
Mastering Advanced Kubernetes Control Plane Config in Amazon EKS
Unlock the full potential of your Kubernetes control plane with advanced configuration options in Amazon EKS. Learn how to optimize pod scheduling with scoring strategies like MostAllocated and LeastAllocated, and fine-tune your Horizontal Pod Autoscaler for rapid scaling.
Mastering EKS Auto Mode: Automated Node Failure Management
Node failures can cripple your Kubernetes clusters, but Amazon EKS Auto Mode offers a robust solution. It automatically detects, drains, and replaces failing nodes, leveraging the Node Monitoring Agent and Karpenter for seamless operation.
Get the daily digest
One email. 5 articles. Every morning.
No spam. Unsubscribe anytime.