This is the v2.9 branch of the Kubecost Helm chart. This release is designed to facilitate seamless upgrades to v3.0. A federated storage configuration is required when installing v2.9.
There are no new features in v2.9 compared to v2.8 other than the addition of a finops-agent container that will begin collecting metrics in preparation for a seamless upgrade to 3.0.
See ./examples for more information on how to use this version.
All agents must run version 2.9 for at least 2 days before upgrading to v3.0.
Of note, the Kubecost 3.0 chart is stored in a different repo than 2.x. To install version 2.9, you will need to use the 2.x legacy chart location.
helm upgrade kubecost -n kubecost \
--repo https://kubecost.github.io/cost-analyzer/ cost-analyzer
-f new-2.9x-values.yamlKubecost strives to support as many versions of Kubernetes as possible. Below is the version support matrix which has been tested. Versions outside of the stated range may still work but are untested. While the below versions may work with the given versions of Kubernetes, Kubecost generally supports the current and previous version
| Chart Version | Kubernetes Min | Kubernetes Max |
|---|---|---|
| 1.107 | 1.20 | 1.28 |
| 1.108 | 1.20 | 1.28 |
| 2.1 | 1.20 | 1.29 |
| 2.2 | 1.21 | 1.29 |
| 2.3 | 1.21 | 1.30 |
| 2.4 | 1.22 | 1.31 |
| 2.5 | 1.22 | 1.32 |
| 2.6 | 1.22 | 1.32 |
| 2.8 | 1.22 | 1.34 |
| 2.9 | 1.29 | 1.34 |
To install via Helm, run the following command.
helm upgrade --install kubecost -n kubecost --create-namespace \
--repo https://kubecost.github.io/cost-analyzer/ cost-analyzer \
--set kubecostToken="aGVsbUBrdWJlY29zdC5jb20=xm343yadf98"Alternatively, add the Helm repository first and scan for updates.
helm repo add kubecost https://kubecost.github.io/cost-analyzer/
helm repo updateNext, install the chart.
helm install kubecost kubecost/cost-analyzer -n kubecost --create-namespace \
--set kubecostToken="aGVsbUBrdWJlY29zdC5jb20=xm343yadf98"While Helm is the recommended install path for Kubecost, especially in production, Kubecost can alternatively be deployed with a single-file manifest using the following command. Keep in mind when choosing this method, Kubecost will be installed from a development branch and may include unreleased changes. We recommend using the manifest from a release branch, such as v1.108.
kubectl apply -f https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/develop/kubecost.yamlThe following table lists commonly used configuration parameters for the Kubecost Helm chart and their default values. Please see the values file for the complete set of definable values.
| Parameter | Description | Default |
|---|---|---|
global.prometheus.enabled |
If false, use an existing Prometheus install. More info. | true |
prometheus.server.persistentVolume.enabled |
If true, Prometheus server will create a Persistent Volume Claim. | true |
prometheus.server.persistentVolume.size |
Prometheus server data Persistent Volume size. Default set to retain ~6000 samples per second for 15 days. | 32Gi |
prometheus.server.persistentVolume.storageClass |
Define storage class for Prometheus persistent volume | - |
prometheus.server.retention |
Determines when to remove old data. | 97h |
prometheus.server.resources |
Prometheus server resource requests and limits. | {} |
prometheus.nodeExporter.resources |
Node exporter resource requests and limits. | {} |
prometheus.nodeExporter.enabled prometheus.serviceAccounts.nodeExporter.create |
If false, do not create NodeExporter daemonset. | true |
prometheus.alertmanager.persistentVolume.enabled |
If true, Alertmanager will create a Persistent Volume Claim. | false |
prometheus.pushgateway.persistentVolume.enabled |
If true, Prometheus Pushgateway will create a Persistent Volume Claim. | false |
persistentVolume.enabled |
If true, Kubecost will create a Persistent Volume Claim for product config data. | true |
persistentVolume.size |
Define PVC size for cost-analyzer | 32.0Gi |
persistentVolume.dbSize |
Define PVC size for cost-analyzer's flat file database | 32.0Gi |
persistentVolume.storageClass |
Define storage class for cost-analyzer's persistent volume | - |
ingress.enabled |
If true, Ingress will be created | false |
ingress.annotations |
Ingress annotations | {} |
ingress.className |
Ingress class name | {} |
ingress.paths |
Ingress paths | ["/"] |
ingress.hosts |
Ingress hostnames | [cost-analyzer.local] |
ingress.tls |
Ingress TLS configuration (YAML) | [] |
networkCosts.enabled |
If true, collect network allocation metrics More info | false |
networkCosts.podMonitor.enabled |
If true, a PodMonitor for the network-cost daemonset is created | false |
serviceMonitor.enabled |
Set this to true to create ServiceMonitor for Prometheus operator |
false |
serviceMonitor.additionalLabels |
Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | {} |
prometheusRule.enabled |
Set this to true to create PrometheusRule for Prometheus operator |
false |
prometheusRule.additionalLabels |
Additional labels that can be used so PrometheusRule will be discovered by Prometheus | {} |
grafana.resources |
Grafana resource requests and limits. | {} |
grafana.sidecar.dashboards.enabled |
Set this to false to disable creation of Dashboards in Grafana |
true |
grafana.sidecar.datasources.defaultDatasourceEnabled |
Set this to false to disable creation of Prometheus datasource in Grafana |
true |
serviceAccount.create |
Set this to false if you want to create the service account kubecost-cost-analyzer on your own |
true |
tolerations |
node taints to tolerate | [] |
affinity |
pod affinity | {} |
extraVolumes |
A list of volumes to be added to the pod | [] |
extraVolumeMounts |
A list of volume mounts to be added to the pod | [] |
You can adjust the log output by using the logLevel Helm value and/or the LOG_FORMAT environment variable.
Adjusting the log level increases or decreases the level of verbosity written to the logs. The logLevel property accepts the following values:
tracedebuginfowarnerrorfatal
For example, to set the log level to debug, add the following flag to the Helm command:
--set 'kubecostModel.logLevel=debug'Adjusting the log format changes the format in which the logs are output making it easier for log aggregators to parse and display logged messages. The LOG_FORMAT environment variable accepts the values JSON, for a structured output, and pretty for a nice, human-readable output.
| Value | Output |
|---|---|
JSON |
{"level":"info","time":"2006-01-02T15:04:05.999999999Z07:00","message":"Starting cost-model (git commit \"1.91.0-rc.0\")"} |
pretty |
2006-01-02T15:04:05.999999999Z07:00 INF Starting cost-model (git commit "1.91.0-rc.0") |