The main goal of Continuous Efficiency is to allow for the shifting down and democratizing of cloud cost information from finance to engineering teams. Now you as an engineer can see the impact of choices on your cloud spend. Getting up and started with Continuous Efficiency is pretty simple, especially that you can take Continuous Efficiency for a trial and see that the proof is in the pudding.  

Once Continuous Efficiency is up and running and recommendations start to appear, how do you execute the recommendations? If you are thinking about taking Continuous Efficiency for a trial or starting your journey with the product in your organization, Harness Continuous Delivery can execute those changes for you. 

Like always you can follow along and/or watch the video.

Deploying a Sample Kubernetes Application 

You will get the most mileage having Continuous Efficiency monitoring and recommending findings on an actual application/infrastructure. If you don’t have one at the ready can leverage using a sample application.  The sample application is the same one that we use when we teach our Continuous Integration example in its final form, a Docker Image. 

Assuming that you have gone through the getting started example, the next step is to deploy an application. An easy way to deploy is leveraging Harness Continuous Delivery which is in the same UI. Harness Continuous Delivery has an abstraction model that is pretty quick to set up and get running. 

First navigate to Setup, click on +Add Application. Can give a name like “Expensive App”.

Harness Add App

The next piece to configure is an Environment to deploy to. A good spot would be the same Kubernetes Cluster you are leveraging for the Continuous Efficiency example [e.g where you deployed your Harness Delegate].

Setup -> Expensive App -> Environments + Add Environment. 

Harness Environment

Once created, you need to define what the Environment is by creating an Infrastructure Definition by clicking on +Add Infrastructure Definition. The Cloud Provider Type is “Kubernetes Cluster” and the Deployment Type is “Kubernetes”. When going through the Continuous Efficiency getting started example, you have already deployed a Harness Kubernetes Delegate and set up a Cloud Provider. You can select the Already Provisioned Infrastructure to select the Kubernetes Cluster [e.g the Harness Cloud Provider] you want to deploy to. 

Harness Infrastructure

When the Infrastructure Definition setup complete, can configure the Service which is the application that you will deploy. 

Setup -> Expensive App -> Services + Add Service. The Deployment Type is “Kubernetes”.

Harness Service

The first wiring is to define the Artifact Source by clicking +Add Artifact Source. Harness comes pre-wired with public Docker Hub. The example application e.g Amazing App is in a public Docker Hub repository and can be wired in with the Docker Image Name of rlachhman/amazingapp.

Docker Registry

By default, there is not a container resource specification defined for the Amazing App. For the example you can give a modest to a large amount on what you think the Kubernetes resource limit and requests should be. You can modify the deployment.yaml in-line by hitting edit and adding the container resource constraints under Spec, Containers

Kubernetes YAML
       resources:
         limits:
           cpu: "1.5"
           memory: "7Gi"
         requests:
           cpu: "1.5"
           memory: "7Gi"

Once you hit save, can create a simple Workflow to get the Amazing App into the wild. 

Setup -> Expensive App -> Workflows +Add Workflow. The Workflow Type is “Rolling Deployment” and the Environment, Service, and Infrastructure Definition is what was created in the previous steps. 

Workflow

Once you hit Submit, you are ready to Deploy. Simply clicking on the “Deploy” button on the top right of the Workflow can kick off the deployment. Select the Build/Version [Docker Tag] you want to deploy and hit Submit to Deploy. 

Kubernetes Deployment

Navigating on the left-side navigation to Continuous Deployment -> Deployments you can see your deployment.

Harness Kubernetes Deployment

With an application out of the way, sit back and relax over the next 24 hours if this is a fresh trial, Continuous Efficiency will start to aggregate and analyze cost data. 

Recommendations are Ready

After about a day, your Continuous Efficiency Dashboard will be filled with information. Navigating on the left-side navigation to Continuous Efficiency, click on Explorer. 

High Cloud Costs

Seems like we have overestimated the firepower that the Amazing App requires; as the author of the Amazing App, it should have all it can get right? 

Clicking on the Recommendations in the top right, we can see how over-provisioned we are and the potential cost savings. 

Cloud Cost Recommendation

Clicking into the Recommendation, we can see what appropriate resource limits should be, which is much less than we originally anticipated. 

Kubernetes Tuning

Clicking on the Workload link, we can see historical data on actuals vs requested resources which is a wide disparity. 

Kubernetes Monitoring

Armed with this data, all we have to do is redeploy the application with the resource changes. 

Execute on Savings

With the Continuous Efficiency data in hand, let’s go ahead and make those resource changes. 

Kubernetes Recommendation

Setup -> Expensive App -> Services -> “Big Amazing App”. In the deployment.yaml, re-modify the resource limits and requests to match the recommendations by clicking Edit. 

Kubernetes re-deployment
       resources:
         limits:
           cpu: "25m"
           memory: "250M"
         requests:
           cpu: "25m"
           memory: "250M"

Then let Harness re-deploy the application. To show another way to deploy, navigate to the left-side navigation to Continuous Deployment then Deployments. Click “Start New Deployment” and select the Workflow you created for the example.

New Harness Deployment

Click Submit and you are now on your way to saving money. 

Kubernetes Cost Savings

With the much lower resource limits, your cluster can be free to scale and/or place more workloads. 

Save Money and Resources with Harness Today

The above example might be a little more simplified than your application in production. Saving resources is key even for agility. When creating the example, an unexpected result for me was being aggressive with high resource limits. If you exhaust your Kubernetes Cluster, this can impact you deploying another rolling deployment.  The Kubernetes scheduler either needs to be tuned since there is an overage [max surge] which is needed to perform a rolling deployment; if all the resources are taken, even a surge of one more replica might not be fulfilled which unexpectedly happened to me. 

Harness is here to partner with you on your journey in the cloud and an important step/realization in that journey is to get the wrangle on cloud costs. The benefits of on-demand infrastructure and cloud-native architecture allow for the next generation of agility. With the agility and ease of spinning items up, costs can certainly creep up. Sign up for a Continuous Efficiency trial and start to democratize cloud costs today!

Cheers,

-Ravi

Keep Reading

  • The Women of DevOps: Patricia Anong

    The Women of DevOps: Patricia Anong

    Meet Patricia Anong, DevOps Consultant. We're thrilled for you to meet her!
  • Introduction to Helm: Charts, Deployments, & More

    Introduction to Helm: Charts, Deployments, & More

    Probably one of the first packages installed after your Kubernetes cluster is up and running is Helm. A stalwart in the Kubernetes ecosystem, Helm is a package manager for Kubernetes. If you are unfamiliar with Helm, Helm helps users to have a more consistent deployment by packaging up all of the needed resources needed for a Kubernetes deployment.
  • GitOps Got Me Up

    GitOps Got Me Up

    Two years ago, I joined the technology space - and as such, I am now a strong proponent for DevOps methodologies.