Getting Started with Cloud Cost Optimization

Today, you can take Cloud Cost Management for a no risk spin to remove the challenge around cloud cost optimization. Start gaining insights and saving, today!

Published on
9/24/20

With the introduction of Cloud Cost Management and now the Cloud Cost Management trial, everyone has access to cloud cost optimization. If you are curious about how to get started and even if you are new to the Harness Platform, we have you covered. 

In this example, I am leveraging Amazon Elastic Kubernetes Service and have access to my billing module inside of AWS. Let’s get started and get Cloud Cost Management wired in. Like always, you can follow along with the blog and/or watch the video.

Getting Started - Sign up for Harness

If you have not yet, sign up for a Harness Account. For this example, we will be leveraging the free Community Edition of the Harness CD Platform. 

Get Started with Harness

Once you logged into your account, you are greeted with the Harness Dashboard. 

Harness Trial

The first thing to do with leveraging Harness is to install a Harness Delegate, which is a worker node performing actions on your behalf. 

Switching gears quickly, I do have an awaiting Amazon EKS Cluster. So the Harness Delegate that would be prudent would be a Kubernetes Delegate.  

EKS Cluster

Back in the Harness Platform installing a Delegate is simple. 

Setup -> Harness Delegates -> Install Delegate. Select Kubernetes YAML and give a name like “keep-costs-low”. 

Harness Delegate

Once the TAR has downloaded, expand the TAR and then enter into the expanded folder. 

Harness Delegate Download

Inside the Delegate folder, there is a readme with the KubeCTL instructions. Running

kubectl apply -f harness-delegate.yaml will install the Harness Delegate. 

Install Harness Delegate

In a few moments, can validate on the Delegate UI that the Harness Delegate has wired up.

Harness Delegate Success

With the Harness Delegate out of the way, let’s prep the EKS cluster to start being observed by Cloud Cost Management.   

Kubernetes Cluster Prep

Cloud Cost Management uses Kubernetes Metric Server as a datapoint. Depending on your Kubernetes provider, this might or might not be installed for you when you instantiate a cluster. In the case of EKS, this is not there by default. 

You can install the Kubernetes Metric Server by running “kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml”.

Kubernetes Metric Server

Can run a quick test of if the Kubernetes Metric Server is running by running “kubectl top nodes”.

KubeCTL Top Nodes

With your Kubernetes/EKS cluster prepped, time to activate your Cloud Cost Management trial. 

Activate Your Cloud Cost Management Trial

Activating a Cloud Cost Management trial is straightforward.  Navigate in the left navigation pane. Click on “Continuous Efficiency” and can sign up for a Cloud Cost Management trial inside the platform. 

Activate Trial

Once you hit Start Free Trial, can start to wiring in configurations. If you need to come back to the setup, can navigate back to Continuous Efficiency -> Settings. 

Set up Trial

With the Kubernetes Delegate running wiring in the EKS cluster is a breeze. Select Kubernetes Cluster from the Cloud Cost Management Settings menu. 

Add the Kubernetes Cluster to the Harness Platform in two steps. First name the Kubernetes Cluster something like “Big Money Cluster”, click Test then Next. 

Wire Kubernetes Delegate

Once you hit Next, on the Continuous Efficiency enablement menu, check Enable Continuous Efficiency. 

Enable Continuous Efficiency

Click Submit and you are configured to monitor for Kubernetes usage. 

Cloud Cost Management does take 2-3 hours to complete its initial assessment. You will get an email when the cloud spend data is available. 

Continuous Efficiency e-mail

If there are existing workloads, usage data will start to be reported also. Though if this is your first time interacting with the Kubernetes Cluster or your first time going through the example, you can easily seed some workloads with Harness CD. 

Seeding Kubernetes Workloads

If your Kubernetes Cluster is empty like mine in the example, leveraging Harness CD to deploy a sample workload is a great next step.  Harness works on a CD Abstraction Model with the basis of that model as a Harness Application.

Add a Harness Application by going to: 

Setup -> Applications + Add Application

Harness Application

Can add an Application with a name of “Not Expensive App”.

Harness Application Name

Once you click Submit, can start filling out the pieces of the abstraction model. 

CD Abstraction Model

The first piece to set up an Harness Environment to deploy to. 

Setup -> Not Expensive App -> Environments + Add Environment. Create a Non-Production environment called “Sandbox”.

Harness Environment

We can let Harness know as part of the “Sandbox” environment is our Kubernetes Cluster we just wired in with an Infrastructure Definition.

Harness Environment Setup

Click on + Add Infrastructure Definition. Can name the Defination “K8s Cluster” as a Kubernetes Cluster Type and will be a Kubernetes Deployment. 

Harness Infrastructure Definition

Click Submit and now it’s time to define what you are actually deploying by creating a Harness Service

Setup -> Not Expensive App -> Services + Add Service

Harness Service

Once clicking on Add Service, can add a Kubernetes Service named “Nginx”.

Harness Add Service

Once in the Service, can wire an artifact source for Nginx which will be public Docker Hub with + Add Artifact Source. Harness comes pre-wired with public Docker Hub as a source. 

Harness Nginx

Wire in “library/nginx” as the Artifact Source and hit Submit. 

Docker Registry

Once you hit Submit, your image is wired to Harness with default scaffolding which is more than sufficient for this example. 

Nginx Deployment

Before you deploy, will need to create a Harness Workflow to instruct Harness on what to do with your application. 

Setup -> Not Expensive App -> Workflows + Add Workflows

Add Workflow

Add a Workflow named “Deploy Nginx” as a Rolling Deployment. Select the Environment, Service, and Infrastructure Definition created before. 

Harness Workflow

Once you click Submit, you are ready to deploy. 

Rolling Deployment Workflow

Click Deploy. Select a Tag such as “latest” and hit Submit. 

Docker Tags

In a few moments, your fearless Nginx will be deployed to your K8s cluster!

Harness Deployment

With your first deployment out of the way, you can also sit back and wait for the initial 2-3 hour seeding period.

Understanding Your First Cluster Cost Breakdown

Once you get the email that your data is ready, time to navigate back to Cloud Cost Management. 

Continuous Efficiency setup e-mail

Head back to the Harness Platform and then on the left navigation head to Cloud Cost Management. The Budget and Explorer links will be active. Can click on Explorer to visualize your first set of Kubernetes Cluster spend. 

Continuous Efficiency Dashboard

Taking a closer look at how efficient the “big-money-cluster” is, we can see the breakdown in how Cloud Cost Management breaks down Kubernetes container usage

Continuous Efficiency Costs

Overall there are certainly ways to tune this cluster. For our example workloads and Harness Delegate, we are way over-provisioned and if this was a cluster that would be long-running, we could re-size the Kubernetes Cluster and re-deploy the workload(s). For myself, I do have several other services that I maintain for the team on AWS, we can also wire Cloud Cost Management to AWS itself. 

Get More Dollar and Cents - Cloud Provider Wiring 

My Kubernetes Workload cost is just part of the picture that Cloud Cost Management can provide. You can garner additional insights into wiring a cloud provider billing API into Cloud Cost Management.  This will really help with cloud cost optimization.

Your AWS Account does need to be part of an Organization. Can validate in the AWS Organization Console.

AWS Organizations

Looking at the documentation and/or navigating to Continuous Efficiency -> Settings -> Connect to Your AWS Account, there are a few steps involved in exporting usage data from AWS. The Cloud Cost Management wizard will guide you along. 

Continuous Efficiency Connect AWS

The first step is to create a Cost and Usage Report [CUR] in your AWS Account. Can launch the AWS Console or leverage the button from Cloud Cost Management. 

AWS CUR

In the AWS Console, click Create Report.

Create CUR

Can give a name of the CUR report, for example, “my-cur-report”. Make sure to select Include resource IDs and Automatically refresh. 

CUR Report

Aftering hitting next, create a S3 Bucket to store the CUR report. 

CUR S3

Can give a name of the new bucket. Though S3 buckets have to be unique across the availability zone, my bucket name “bigmoney-cur-bucket” would not be unique since I am leveraging. 

S3

Once you hit next, the default policy is ok. Back on the Delivery options menu, change the Report path prefix to something e.g “ce”,  Time granularity to hourly, Report versioning to overwrite existing reports, and GZIP for compression. 

CUR Configured

Click through Review and Complete. Once that is set up, your first CUR will be delivered by AWS within 24 hours. 

CUR List

In the meantime, can wire the new report and bucket into the Cloud Cost Management setup. 

AWS Master Account

The next step would be to grant Cloud Cost Management access to the CUR report to analyze the contents. This will be done with an Identity and Access Management [IAM] role. 

IAM Role

By clicking on the Launch Template button, you will be brought to the AWS Cloud Formation Template Creation wizard e.g Quick create stack.

Cloudformation Template

The default values are fine.  Acknowledge and Create stack. 

Acknowledge Cloudformation

The Cloud Formation stack will be created. In the Outputs section of the stack, copy the CrossAccountRoleARN value. 

Harness IAM Role Stack

The ARN value and your account name will be the last two wirings you need to wire into the Cloud Cost Management AWS Setup wizard. 

Cross IAM ARN

When complete, you should have CUR and IAM details wired in.  

Full Continuous Efficiency Configuration

Click Save & Continue and exit out of the confirmation prompt and you are now all set. 

Continuous Efficiency AWS

The analysis process of your cloud spend does take 24 hours by Cloud Cost Management. You are now well on your way to saving money! 

The Harness Platform - Supercharging your Experience

Cloud Cost Management is a pillar in the Harness Platform. The genesis of Cloud Cost Management was enabling and addressing our own FinOps challenges. Getting the reins on cloud costs is challenging for organizations of all sizes as reported in our 2020 Report on SaaS Cloud Spend. With Cloud Cost Management and the new ability to take a trial, the proof is really in the pudding. Be sure to sign up and start saving on cloud costs, today! 

Do you want to learn more about what other tools there are out there? We mapped out the top cloud cost management tools to consider.

The Modern Software Delivery Platform®

Loved by Developers, Trusted by Businesses
Get Started

Need more info? Contact Sales