Skip to main content
Skip table of contents

Centralized Cost Monitoring

These pages refer to DKP Enterprise and DKP Gov Advanced products.

Monitoring costs of all attached clusters with Kubecost

Kubecost, running on Kommander, provides centralized cost monitoring for all attached clusters. This feature, installed by default in the management cluster, provides a centralized view of Kubernetes resources used on all attached clusters.

By default, up to 15 days of cost metrics are retained, with no backup to an external store.

Adding a Kubecost License Key to your Clusters

By default, DKP is deployed with the free version of Kubecost, which provides cost monitoring for individual clusters and metric retention for up to 15 days. Licensed plans from Kubecost with additional features are also available. For more information, refer to the Kubecost Pricing page.

The following instructions provide information on how you can add a Kubecost license key to your clusters if you have purchased one.

The license key must be applied to the Centralized Kubecost application running on the Management cluster.

  1. Obtain license key from Kubecost. For more information, refer to the Kubecost Pricing page.

  2. Access the centralized-kubecost dashboard with the following link:

    CODE
    https://<CLUSTER_URL>/dkp/kommander/kubecost/frontend/
  3. From the dashboard, select the Settings icon, then select “Add License Key”.
    NOTE: Alternatively, the dashboard can be accessed via the following link: https://<CLUSTER_URL>/dkp/kommander/kubecost/frontend/settings

  4. Input your license key, then select “Update.”

  5. After the license key has been added, the licensed features become available in the Kubecost UI.

There is a free trial of the Kubecost Enterprise plan that allows you to preview enterprise features for 30 days. To access this, select “Start Free Trial” in the Settings pane.

Considerations when Adding a License Key

Until you add a license key, Kubecost caches the context of the cluster you first navigate from. This means that if you navigate to the Kubecost UI via the dashboard button in the Application Dashboards tab of any cluster, you will not be able to access the centralized Kubecost UI until you clear your browser cookies/cache.

Centralized Costs

Using Thanos, the management cluster collects cost metrics remotely from each attached cluster. Costs from the last day and the last 7 days are displayed for each cluster, workspace, and project in the respective DKP UI pages. Further cost analysis and details can be found in the centralized Kubecost UI running on Kommander, at:

CODE
https://<CLUSTER_URL>/dkp/kommander/kubecost/frontend/detail.html#&agg=cluster

For more information on cost allocation metrics and how to navigate this view in the Kubecost UI, see the Kubecost docs on Kubernetes Cost Allocation.

To identify the clusters in Kubecost, use the cluster’s monitoring ID. The monitoring ID corresponds to the kube-system namespace UID of the cluster. To find the cluster’s monitoring ID, select the Clusters tab on the DKP UI in the relevant workspace, or go to the Clusters page in the Global workspace:

CODE
https://<CLUSTER_URL>/dkp/kommander/dashboard/clusters

Select View Details on the attached cluster card. Select the Configuration tab, and find the monitoring ID under Monitoring ID (clusterId).

You can also search or filter by monitoring ID on the Clusters page.

To look up a cluster’s kube-system namespace UID directly using the CLI, run the following kubectl command, using the cluster’s context or kubeconfig.

CODE
kubectl get namespace kube-system -o jsonpath='{.metadata.uid}'

Kubecost

Kubecost integrates directly with the Kubernetes API and cloud billing APIs to give you real-time visibility into your Kubernetes spend and cost allocation. By monitoring your Kubernetes spend across clusters, you can avoid overspend caused by uncaught bugs or oversights. With a cost monitoring solution in place you can realize the full potential and cost of these resources and avoid over-provisioning resources.

To customize pricing and out of cluster costs for AWS, you must apply these settings using the Kubecost UI running on each attached cluster. You can access the attached cluster’s Kubecost Settings page at:

CODE
https://<MANAGED_CLUSTER_URL>/dkp/kubecost/frontend/settings.html

Make sure you access the cluster's Kubecost UI linked above, not the centralized Kubecost UI running on the Kommander management cluster.

AWS

For more accurate AWS Spot pricing, follow these steps to configure a data feed for the AWS Spot instances.

To allocate out of cluster costs for AWS, visit this guide.

Grafana dashboards

A set of Grafana dashboards providing visualization of cost metrics is provided in the centralized Grafana UI:

CODE
https://<CLUSTER_URL>/dkp/kommander/monitoring/grafana

These dashboards give a global view of accumulated costs from all attached clusters. From the navigation in Grafana, you can find these dashboards by selecting those tagged with cost, metrics, and utilization.

Related Information

For information on related topics or procedures, refer to the following:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.