Cracking the Code of Cloud Efficiency: Hands-On Cost-Saving Solutions

<p>Do not believe anybody saying, saving cost is not important in a cloud. It was important in the past and will be in the future. That always will be the case. This is the matter of time when a budget alarm goes off. This happened to me as well. Significant part of our costs is generated by the Kubernetes cluster. What AWS EKS Kubernetes cluster actually is? It is a fleet of EC2 instances. Keeping this in mind I tried to understand what affects the expenses. The findings I roughly divided into two categories &mdash; changeable and unchangeable. Changeable &mdash; instance type, number of worker nodes. Unchangeable &mdash; number of deployments (deployment as k8s object), traffic generated by pods , services pods use (like RDS, S3 etc.). Leaving unchangeable aside, I explored the aspects I could modify. Success hinges on maintaining moderate instance utilization. Low utilization leads to resource wastage, while excessive utilization jeopardizes stability and performance. In this context, &ldquo;moderately high&rdquo; means having the same number of deployments and traffic generated by pods; reducing the number of worker nodes; and, where possible, employing more cost-effective instance types. I delegated the task of picking optimal instance type to karpenter (<a href="https://karpenter.sh/" rel="noopener ugc nofollow" target="_blank">https://karpenter.sh/</a>). Usually we don&#39;t schedule all pods manually, instead we let kubernetes scheduler do this for us. It (scheduler) needs resource mem and cpu requests to be correctly defined. Karpenter watches what scheduler does and if it sees pods in a Pending mode a new worker node is added to the cluster immediately. On top of that consolidation option can be enabled if you want karpenter be responsible for having only the cheapest instance types in the cluster and keeping the lowest number of worker nodes.</p> <p><a href="https://medium.com/@magelan09/cracking-the-code-of-cloud-efficiency-hands-on-cost-saving-solutions-b44d18348abc"><strong>Visit Now</strong></a></p>
Tags: Cost Saving