Skip to main content

Configuring Cost for K8s

Torque collects cost data using cost collection targets, which are managed in the Cost Configurations page under the Admin section of the left sidebar. For AWS, Azure, and GCP clouds, you must first add a cloud account as a cost collection target, however for K8s, Torque automatically creates a cost collection target when an agent is installed on the cluster.

Follow the next steps to start collecting cost on your K8s cluster:

  1. Install Kubecost:

    1. Torque collects cost data directly from the pods using a 3rd-party tool called Kubecost. To start collecting costs from your cluster, deploy Kubecost in your cluster.
  2. Validate the relevant cost collection target:

    1. Expand the Admin section at the bottom of the left sidebar and click Cost Configurations (requires the account admin role).
    2. Identify the relevant cost collection target. Its name will be the same name as the agent installed on the cluster.
    3. Click the cost collection target's ⋮ (3-dot) menu and select Validate to make sure it works (i.e. cost data can be collected).
  3. Enable the relevant cost collection target:

    1. In the Cost Configurations page, click the desired cost collection target's Enabled toggle.

    Locale Dropdown

Troubleshooting​

  1. Verify that Kubecost is deployed in the cluster.
    1. Navigate your browser to http://localhost:9090/. If you can see kubecost data, it means it's working. If you can't, see this guide for help.
  2. In Torque, try to re-enable the K8S cost collection target and validate that it works.
  3. If the error still exists, contact Torque support.