What is autonomous cloud cost optimization and what can you gain from it?
Tags: cloud, kubernetes, cloudskills, cloudnative
Published: 2021-12-01 13:06:12

<!-- wp:paragraph -->
<p>You’ve probably heard about automated cloud cost optimization - but what about autonomous cloud cost optimization?&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>How does this type of optimization actually work? What mechanisms does it use to reduce cloud bills?&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Keep on reading to find out.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Here’s a quick guide to autonomous cloud cost optimization:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<ul><li><a href="#whatisautonomouscloudcostoptimization">What is autonomous cloud cost optimization?</a></li>
<li><a href="#hereshowanautonomouskubernetesplatfromworks">Here’s how an autonomous Kubernetes platform works</a><ul>
<li><a href="#automatedanalysis">Step 1: Automated analysis</a></li>
<li><a href="#reachingtheidealstatewithinstantrebalancing">Step 2: Reaching the ideal state with Instant Rebalancing</a></li>
<li><a href="#stayingoptimizedautomatically">Step 3: Staying optimized automatically</a></li></ul></li></ul>
<!-- /wp:html -->

<!-- wp:html -->
<h2 id="whatisautonomouscloudcostoptimization">What is autonomous cloud cost optimization?</h2>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Autonomous optimization means that all the optimization tasks are triggered without any active involvement from the DevOps or cloud engineer. But it’s more than automation.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>An autonomous solution connects multiple areas of automation together to work in one smooth flow:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><li>Automated analysis of the cloud resources that identifies areas for optimization,</li><li>Getting you to the optimized state automatically,</li><li>Keeping the optimized state under changing conditions automatically, without involving engineers in proactively managing the infrastructure.&nbsp;</li></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>A platform should do all three things to be considered autonomous.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="hereshowanautonomouskubernetesplatfromworks">Here’s how an autonomous Kubernetes platform works</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>CAST AI is a fully autonomous cloud cost optimization platform that supports Kubernetes clusters running on AWS, Google Cloud Platform, and Microsoft Azure Cloud. Here’s a step by step guide to how it optimizes Kubernetes clusters.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="automatedanalysis">Step 1: Automated analysis</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>To find out how much we could save through the Cluster Analyzer, we need to connect our cluster to CAST AI. So, we create a free account on <a href="https://cast.ai/">https://cast.ai </a>and select the <em>Connect your cluster </em>option. To connect the cluster, we need to run a small script in our AWS, GCP, or Azure terminal.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>How secure is connecting a cluster to CAST AI?</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To deliver meaningful results to you, CAST AI needs minimal cluster access. The platform was created by security specialists and has achieved both <a href="https://cast.ai/blog/cast-ai-is-officially-soc-2-type-ii-compliant/">SOC 2 Type II</a> and ISO27001 certifications so it follows the principle of least privilege.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The read-only agent launched when you run a script we provide in your terminal <strong>cannot change any cluster configuration or access sensitive data</strong>. The agent code is open-source and you can see it in <a href="https://github.com/castai/k8s-agent">our GitHub repository</a>.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>To learn more about how the agent works, take a look here: <a href="https://cast.ai/blog/how-does-the-read-only-cast-ai-agent-work-and-what-data-can-it-read/">How does the read-only CAST AI agent work and what data can it read?</a></li><li>For more on security features, check out this <a href="https://cast.ai/blog/a-quick-guide-to-data-and-security-in-cast-ai/">guide to security and privacy in CAST AI</a></li></ul>
<!-- /wp:list -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/qm0dr8tm4oaNHqkl6lWFm1cQ7McgaEp__iUnJcb-DcSVowbTJY8SRy7Ik-ZzSYPer3BZcs4wppq6K9WlBkfSgi-f7sGrsQgO1ETnwDUOHD2ghJehBdXUBVTFYI1bvc6-OSTIbxOh" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The Savings Report shows what the CAST AI engine would do if we put it in charge of managing our nodes.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This is what the report looks like - note the contrast between the ‘Current Cluster’ and the ‘Optimized Cluster’ at the bottom:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/GA9acxwqsm5zW9vjsBYNycIw6XREr5bR0uhxJt8KqbCE5qMLVdr1Bl0T13oJxgYcvpZx67KfN54fYilJ5UCUnllX3LsTk_pnXAI5o8FVuCXJmlxH4zlt2y7420Et79HNwcHUNf6c" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>In this example, the platform shows that we’re overprovisioning our cluster. We can see how three virtual machines (nodes) could do the exact same jobs as the six machines we’re using -&nbsp; for<strong> a fraction of the cost</strong>!</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>At this point, we can choose between two options:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><li><strong>Turn autonomous optimization on </strong>- the platform will then rebalance our cluster to achieve savings and allow for continued optimization around the clock, finding the best opportunities for <strong>getting the performance we need for 40% of the price</strong> (or less).</li><li><strong>Change our setup manually to what CAST AI suggested</strong> - doing that also means that we’d have to run the reports and do all the required actions manually on a regular basis. Not all of the optimizations can be implemented manually with a similar level of efficiency (for example, autoscaling or managing spot instances).</li></ol>
<!-- /wp:list -->

<!-- wp:heading -->
<h2 id="reachingtheidealstatewithinstantrebalancing">Step 2: Reaching the ideal state with Instant Rebalancing</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>CAST AI uses the cluster Instant Rebalancing feature to achieve the optimal configuration in a few minutes.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In our example, six nodes were reduced to three nodes with zero trade-offs on performance. The platform achieved that by seamlessly moving our workloads from the existing 6 nodes to 3 nodes achieving greater resource utilization. The cluster now costs $168.63 per month, instead of the initial $420.48 (<strong>59.9% savings!</strong>).</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/uAMyIr8MIVyr3WuHuyi0n-kfnSwMImlze5l2Ot4qr184dvHVO7Sj-nI7kutCBDCm5O08DvyhI7cv1VHlKTARy9jS436nOAchavCt5YQaVu4dPZTSxXGgElb20x4RiTdXYeDyU43l" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p><strong>Let’s take a look at our cluster before and after rebalancing</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Before rebalancing: The cluster has six nodes and costs $420.48 per month.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After rebalancing: The cluster has three nodes that ensure the exact same level of performance as before, only for $168.63 per month.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":4510,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cast.ai/wp-content/uploads/2021/11/1200x628.png" alt="" class="wp-image-4510"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Once the process is completed, we get a report summarizing what has been done:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":4509,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://cast.ai/wp-content/uploads/2021/11/image8-1200x445.png" alt="" class="wp-image-4509"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"level":3} -->
<h3>Cluster Rebalancing with spot instances</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If we decide to use spot instances in our cluster, we can enable the corresponding policy in the CAST AI console, so the engine includes spot instances in its search for the most optimal compute resources.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Spot instances are virtual machines sitting idle and cloud service providers offer them for a greatly discounted price - even 90% off the on-demand cost. The only catch is that the provider can reclaim these resources at any time. Naturally, an autonomous platform first checks if and how many of the workloads are spot-friendly.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In our example, CAST AI discovered that 29 pods are spot-friendly. This means that the workloads running on those pods will be able to handle the interruption gracefully. By allowing the platform to use spot instances, we drove the monthly bill down to $100.08 per month, a further ~40% decrease from our optimized setup.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":4508,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cast.ai/wp-content/uploads/2021/11/1080x850.png" alt="cloud savings report" class="wp-image-4508"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p><strong>Try rebalancing now to see your cluster go from zero to optimized in minutes.</strong> It’s available in all of our paid plans. You can either <a href="https://console.cast.ai/?screen_hint=SIGNUP" target="_blank" rel="noreferrer noopener">sign up yourself</a> or <a onclick="Calendly.initPopupWidget({url: 'https://calendly.com/emilio-28?amp;background_color=f1f1f1&amp;text_color=082939&amp;primary_color=2acd7f'});return false;" href="">talk to someone in our team </a>beforehand.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="stayingoptimizedautomatically">Step 3: Staying optimized automatically</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Once it achieves an optimized state of the cluster, CAST AI engages Day 2 Ops strategies that continuously optimize the cluster in a feedback loop.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>CAST AI analyzes the configuration in real time and makes predictions about cluster requirements. It rightsizes our cluster to the right number, type, and size of compute resources.</p>
<!-- /wp:paragraph -->

<!-- wp:quote {"className":"is-style-large"} -->
<blockquote class="wp-block-quote is-style-large"><p>For spot instances, CAST AI includes the Spot Fallback feature that guarantees capacity by temporarily moving workloads to other nodes until there are new spot instances available.</p></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>Every time a scale-up event occurs (for example, your application gets lots of traffic because of an ad), CAST AI chooses the best resources for the job. This includes on-demand instances and spot instances that work with any Reserved Instances or Savings Plans that we might have at the moment.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The platform uses a number of tactics to ensure continuous optimization of the cluster:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Smart selection of the most efficient virtual machines for the job,</li><li>Automatic selection of spot instances for any spot-friendly pods,</li><li>Constant checks for pods that could be reshuffled to empty and delete nodes,</li><li>Autoscaling resources to meet the application’s demands,</li><li>Seamless transitioning of your legacy nodes to optimized ones.</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3>See all of this live at AWS re:Invent 2021 booth #400</h3>
<!-- /wp:heading -->

<!-- wp:image {"id":4507,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cast.ai/wp-content/uploads/2021/11/visit_reinvent_booth_400.png" alt="" class="wp-image-4507"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>You can also <strong><a onclick="Calendly.initPopupWidget({url: 'https://calendly.com/emilio-28?amp;background_color=f1f1f1&amp;text_color=082939&amp;primary_color=2acd7f'});return false;" href="">book a call here</a></strong> if you’re not attending this year.</p>
<!-- /wp:paragraph -->