Cost Visibility for Enterprise OpenShift

Chris Hambridge
ITNEXT
Published in
7 min readMar 1, 2020

--

Photo by Jp Valery on Unsplash

Cloud computing is projected to increase from $67B in 2015 to $162B in 2020, but along with the journey to move workloads to the cloud there are pitfalls along the way. Sixty percent of companies using or evaluating cloud computing services are concerned with the risk of runaway costs . Yet other companies are hesitant due to cloud vendor locking and are looking for ways to avoid them.

A great start is selecting OpenShift Container Platform to run your workload in a cloud agnostic deployment. OpenShift allows for a hybrid cloud deployment footprint which lowers your risk of vendor lock-in as you can deploy on a variety of public clouds or on-premises and your containers will operate as expected. The latest release of OpenShift (OCP 4) provides the latest Kubernetes features with enterprise quality.

Technology selection is only one component in avoiding the pitfalls mentioned above. In an enterprise deployment you are dealing with potentially a multi-cloud footprint, line of business ownership, shadow IT, multi-cluster deployments, along with independent project deployment to your footprint. In this space it is hard to gather a single pane of glass view for all these costs or more importantly allow others to view only the costs associated with their portion of these workloads. OpenShift 4 is now providing, in Tech Preview, a cost management feature included with the subscription at no additional cost.

Cost Management Features

So what can you do with this new included feature of OpenShift 4?

Infrastructure Overview

You can get a view of the costs for your underlying cloud infrastructure. Currently, the cost management feature supports Amazon Web Services (AWS) and Microsoft Azure with more public cloud providers to follow.

View you Amazon costs at a glance

From the application you can view the costs of multiple Amazon master accounts and see the associated child accounts. You can see the top cost by service, account or region along with your month over month cost. You can get a deeper view of key cost drivers with the secondary charts highlighting common cost drivers.

Highlighting key cost drivers

Similarly you can see your cost from your Azure subscriptions in overview form.

View your Azure cost at a glance

The application supports a consistent view of these infrastructures to see the underlying cost for your public cloud footprint.

OpenShift Overview

The next layer of data is viewing your OpenShift cost. There are two cost scenarios for users available; correlating cost from cloud infrastructure to OpenShift costs and defining your private cloud costs using a Cost Model.

View your OpenShift costs correlated from public cloud costs at a glance

OpenShift costs driven by public cloud cost correlation use the billing information from the cloud provider associated with metrics from OpenShift. One mechanism is to associate nodes with cloud instance costs. Another mechanism is utilizing tagging against the cloud provider resources. The tagging capability can allow you to express the costs of cloud services that are not directly OpenShift run-time costs but associated project costs (e.g. database services).

OpenShift costs can also be viewed for on-premises deployments utilizing OpenShift metrics and cost models.

View OpenShift costs at a glance

Again you can view the similar month over month views for OpenShift as available for the cloud providers. The gathered usage metrics are shown which are the cost drivers when using a cost model. The application has a wizard to help make creating a cost model for your clusters easy.

Cost Model Wizard

From here you can define the metric rates like cost per core-hour, memory-hour, etc. to enable the calculation of your costs for your on-premises deployment.

Dive into the Details

Overviews are great, but at a certain point you the data you need is in the details. You aren’t necessarily interested in just the top few items, but the unexpected costs you weren’t aware of or maybe the costs that haven’t been properly tagged.

Below are several views of how you can slice and dice Amazon data, grouping and filtering by key factors.

Amazon Details — Group by account with cost breakdown

You get a tabular view of the data along with sorting and the ability to view breakdowns on further dimensions.

Amazon Details — Group by service

This summarized data can be exported directly for use with spreadsheets and other business reporting tools.

Amazon Details — Group by tag key with cost breakdown

Even view data with your applied tags, which can also help to highlight resource costs which are not tagged.

Similar detail views are available for Microsoft Azure. You can are able to see details split out by service.

Azure Details — Group by service with cost breakdown

Additionally you can view all your Microsoft Azure subscription costs in a paginated view or dive into the details of each subscription.

Azure Details — Group by subscription with cost breakdown

Understanding your infrastructure costs can allow you to identify costs that you should be associating with your OpenShift deployments. Just like your cloud details you can explore your OpenShift costs along multiple dimensions.

OpenShift Details — Group by cluster with cost breakdown

Here you can see how you can get a view of the cost for each of your OpenShift clusters and then dive further into that clusters cost. The application highlights the most costly projects for that cluster and shows the general utilization, potentially providing capacity visibility which may point to the need or option to scale the cluster size up or down (or alter the size of the underlying cloud instances or virtual machines).

OpenShift Details — Group by project

You can also get a view of your most costly projects. This view allows you to see the aggregation across multiple clusters. Allowing you to understand a projects cost if you deploy to multiple clusters for development, testing, staging, and production.

OpenShift Details — Group by project with usage information

The data can be broken down further into your projects to understand where they are running, what their usage vs. request is like, potentially allowing you to address projects that are over requesting resources which could allow for greater cluster capacity and again the option to scale the cluster down.

You can view a historical month over month comparison of the metrics to visualize outliers.

Details View — Filter Options

Each of these group by views allows you to filter on other dimensions than your current grouping so can gain visibility to costs without changing your perspective. For example you can see costs grouped by project but filtered to just those with the environment=prod label; these filters support AND and OR conditions.

OpenShift Details — Group by project and filtered by environment=prod

Limiting Visibility

While obtaining this level of cost visibility can greatly assist in avoiding runaway costs, and even allow you to find cost savings. You actually need one step further, the capability to give lines of business and project owners the capability to view and track this data themselves.

The cost management feature allows this capability by utilizing a role based access control.

Role Management — Defining visibility of resources

With roles you can define the scope of visibility so users can be allowed to see a subset of Amazon accounts or Microsoft Azure subscriptions or OpenShift clusters; even limiting the projects visible on a cluster in the role definition.

Cost Management Function

So how does cost management work?

Software as a service

Cost management is a feature you can find on cloud.redhat.com/beta/ as part of your OpenShift subscription. From here you create sources of data like your OpenShift clusters and your cloud providers.

Source Management — Configuring cost management

Cloud providers like AWS and Azure have a cost reporting mechanism that writes data to object storage on a daily basis. Cost management is configured with read access to the object storage to read and summarize the data show above.

OpenShift relies on gathering metric data and sending it to cloud.redhat.com using the same mechanism used by the insights-operator for remote health monitoring. In order to gather hourly metrics, cost management utilizes the reporting feature of operator-metering which gathers data from Prometheus on the cluster.

Synopsis

Running workloads in the cloud is complex. In an agile enterprise environment which is embracing cloud native practices, cost management is becoming a key factor in a business’s financial solvency. The cost management feature of OpenShift 4 is an exciting tool to help grapple with this challenging task, providing insights into infrastructure, multi-cluster, and tag-based cost while empowering ownership via limiting visibility. If you are interested in learning more please check out the Tech Preview blog and take a further look at the product documentation.

--

--

Software Engineer at Red Hat. Passionate about devOps and cloud native technologies.