Kubecost provides the ability to allocate out of clusters costs, e.g. Cloud SQL instances and Cloud Storage buckets, back to Kubernetes concepts like namespace and deployment. All data remains on your cluster when using this functionality and is not shared externally.
The following guide provides the steps required for allocating out of cluster costs.
Step 1: Enable billing data export
Step 2: Visit Kubecost setup page and provide configuration info
In Kubecost, vist the Cost Allocation page and select “Add Key”.
On this page, you will see instructions for providing a service key, project ID, and the BigQuery dataset that you have chosen to export data to.
Step 3: Label cloud assets
You can now label assets with the following schema to allocate costs back to their appropriate Kubernetes owner. Learn more here on GCP labeling.
Cluster: "kubernetes_cluster" : <clusterID> Namespace: "kubernetes_namespace" : <namespace> Deployment: "kubernetes_deployment": <deployment> Label: "kubernetes_label_NAME": <label> Pod: "kubernetes_pod": <pod> Daemonset: "kubernetes_daemonset": <daemonset> Container: "kubernetes_container": <container>