Added chart versions:

kubecost/cost-analyzer:
    - 2.4.0
  redpanda/redpanda:
    - 5.9.4
pull/1062/head
github-actions[bot] 2024-09-18 00:53:36 +00:00
parent ba8a340de5
commit bbf613861f
329 changed files with 135127 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,6 @@ annotations:
url: https://www.kubecost.com
catalog.cattle.io/certified: partner
catalog.cattle.io/display-name: Kubecost
catalog.cattle.io/featured: "1"
catalog.cattle.io/release-name: cost-analyzer
apiVersion: v2
appVersion: 2.3.5

View File

@ -0,0 +1,14 @@
annotations:
artifacthub.io/links: |
- name: Homepage
url: https://www.kubecost.com
catalog.cattle.io/certified: partner
catalog.cattle.io/display-name: Kubecost
catalog.cattle.io/featured: "1"
catalog.cattle.io/release-name: cost-analyzer
apiVersion: v2
appVersion: 2.4.0
description: Kubecost Helm chart - monitor your cloud costs!
icon: file://assets/icons/cost-analyzer.png
name: cost-analyzer
version: 2.4.0

View File

@ -0,0 +1,116 @@
# Kubecost Helm chart
This is the official Helm chart for [Kubecost](https://www.kubecost.com/), an enterprise-grade application to monitor and manage Kubernetes spend. Please see the [website](https://www.kubecost.com/) for more details on what Kubecost can do for you and the official documentation [here](https://docs.kubecost.com/), or contact [team@kubecost.com](mailto:team@kubecost.com) for assistance.
To install via Helm, run the following command.
```sh
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.
```sh
helm repo add kubecost https://kubecost.github.io/cost-analyzer/
helm repo update
```
Next, install the chart.
```sh
helm install kubecost kubecost/cost-analyzer -n kubecost --create-namespace \
--set kubecostToken="aGVsbUBrdWJlY29zdC5jb20=xm343yadf98"
```
While Helm is the [recommended install path](http://kubecost.com/install) 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.
```sh
kubectl apply -f https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/develop/kubecost.yaml
```
The following table lists commonly used configuration parameters for the Kubecost Helm chart and their default values. Please see the [values file](values.yaml) for the complete set of definable values.
| Parameter | Description | Default |
|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| `global.prometheus.enabled` | If false, use an existing Prometheus install. [More info](http://docs.kubecost.com/custom-prom). | `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.retention` | Determines when to remove old data. | `15d` |
| `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 crate NodeExporter daemonset. | `true` |
| `prometheus.alertmanager.persistentVolume.enabled` | If true, Alertmanager will create a Persistent Volume Claim. | `true` |
| `prometheus.pushgateway.persistentVolume.enabled` | If true, Prometheus Pushgateway will create a Persistent Volume Claim. | `true` |
| `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` |
| `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) | `[]` |
| `networkPolicy.enabled` | If true, create a NetworkPolicy to deny egress | `false` |
| `networkPolicy.costAnalyzer.enabled` | If true, create a newtork policy for cost-analzyer | `false` |
| `networkPolicy.costAnalyzer.annotations` | Annotations to be added to the network policy | `{}` |
| `networkPolicy.costAnalyzer.additionalLabels` | Additional labels to be added to the network policy | `{}` |
| `networkPolicy.costAnalyzer.ingressRules` | A list of network policy ingress rules | `null` |
| `networkPolicy.costAnalyzer.egressRules` | A list of network policy egress rules | `null` |
| `networkCosts.enabled` | If true, collect network allocation metrics [More info](http://docs.kubecost.com/network-allocation) | `false` |
| `networkCosts.podMonitor.enabled` | If true, a [PodMonitor](https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#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 | `{}` |
| `serviceMonitor.relabelings` | Sets Prometheus metric_relabel_configs on the scrape job | `[]` |
| `serviceMonitor.metricRelabelings` | Sets Prometheus relabel_configs on the scrape job | `[]` |
| `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.serviceAccount.create` | If true, create a Service Account for Grafana. | `true` |
| `grafana.serviceAccount.name` | Grafana Service Account name. | `{}` |
| `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 | `{}` |
| `kubecostProductConfigs.productKey.mountPath` | Use instead of `kubecostProductConfigs.productKey.secretname` to declare the path at which the product key file is mounted (eg. by a secrets provisioner) | `N/A` |
| `kubecostFrontend.api.fqdn` | Customize the upstream api FQDN | `computed in terms of the service name and namespace` |
| `kubecostFrontend.model.fqdn` | Customize the upstream model FQDN | `computed in terms of the service name and namespace` |
| `clusterController.fqdn` | Customize the upstream cluster controller FQDN | `computed in terms of the service name and namespace` |
| `global.grafana.fqdn` | Customize the upstream grafana FQDN | `computed in terms of the release name and namespace` |
## Adjusting Log Output
The log output can be customized during deployment by using the `LOG_LEVEL` and/or `LOG_FORMAT` environment variables.
### Adjusting Log Level
Adjusting the log level increases or decreases the level of verbosity written to the logs. To set the log level to `trace`, the following flag can be added to the `helm` command.
```sh
--set 'kubecostModel.extraEnv[0].name=LOG_LEVEL,kubecostModel.extraEnv[0].value=trace'
```
### Adjusting Log Format
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")` |
## Testing
To perform local testing do next:
- install locally [kind](https://github.com/kubernetes-sigs/kind) according to documentation.
- install locally [ct](https://github.com/helm/chart-testing) according to documentation.
- create local cluster using `kind` \
use image version from https://github.com/kubernetes-sigs/kind/releases e.g. `kindest/node:v1.25.11@sha256:227fa11ce74ea76a0474eeefb84cb75d8dad1b08638371ecf0e86259b35be0c8`
```shell
kind create cluster --image kindest/node:v1.25.11@sha256:227fa11ce74ea76a0474eeefb84cb75d8dad1b08638371ecf0e86259b35be0c8
```
- perform ct execution
```shell
ct install --chart-dirs="." --charts="."
```

View File

@ -0,0 +1,25 @@
# Kubecost
[Kubecost](https://kubecost.com/) is an open-source Kubernetes cost monitoring solution.
Kubecost gives teams visibility into current and historical Kubernetes spend and resource allocation. These models provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.
To see more on the functionality of the full Kubecost product, please visit the [features page](https://kubecost.com/#features) on our website.
Here is a summary of features enabled by this cost model:
- Real-time cost allocation by Kubernetes service, deployment, namespace, label, statefulset, daemonset, pod, and container
- Dynamic asset pricing enabled by integrations with AWS, Azure, and GCP billing APIs
- Supports on-prem k8s clusters with custom pricing sheets
- Allocation for in-cluster resources like CPU, GPU, memory, and persistent volumes.
- Allocation for AWS & GCP out-of-cluster resources like RDS instances and S3 buckets with key (optional)
- Easily export pricing data to Prometheus with /metrics endpoint ([learn more](https://github.com/kubecost/cost-model/blob/develop/PROMETHEUS.md))
- Free and open source distribution (Apache2 license)
## Requirements
- Kubernetes 1.8+
- kube-state-metrics
- Grafana
- Prometheus
- Node Exporter

View File

@ -0,0 +1,17 @@
kubecostAggregator:
enabled: true
cloudCost:
enabled: true
aggregatorDbStorage:
storageRequest: 10Gi
kubecostModel:
federatedStorageConfigSecret: federated-store
kubecostProductConfigs:
cloudIntegrationSecret: cloud-integration
clusterName: CLUSTER_NAME
prometheus:
server:
global:
external_labels:
# cluster_id should be unique for all clusters and the same value as .kubecostProductConfigs.clusterName
cluster_id: CLUSTER_NAME

View File

@ -0,0 +1,35 @@
kubecostProductConfigs:
clusterName: CLUSTER_NAME
# cloudIntegrationSecret: cloud-integration
federatedETL:
useExistingS3Config: false
federatedCluster: true
kubecostModel:
containerStatsEnabled: true
federatedStorageConfigSecret: federated-store
serviceAccount: # this example uses AWS IRSA, which creates a service account with rights to the s3 bucket. If using keys+secrets in the federated-store, set create: true
create: true
global:
prometheus:
enabled: true
# fqdn: http://prometheus-operated.monitoring:9090
grafana: # prometheus metrics will be local cluster only, disable grafana to save resources
enabled: false
proxy: false
prometheus:
nodeExporter:
enabled: false
server:
global:
external_labels:
# cluster_id should be unique for all clusters and the same value as .kubecostProductConfigs.clusterName
cluster_id: CLUSTER_NAME
networkCosts:
# optional, see: https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration
enabled: true
config:
services:
# set the appropriate cloud provider to true
amazon-web-services: true
# google-cloud-services: true
# azure-cloud-services: true

View File

@ -0,0 +1,46 @@
### This test is to verify that Kubecost aggregator is deployed as a StatefulSet,
### cluster controller is installed, and the various Prometheus components are installed.
global:
podAnnotations:
kubecost.io/test1: value1
kubecost.io/test2: value2
additionalLabels:
kubecosttest1: value1
kubecosttest2: value2
prometheus:
enabled: true
# fqdn: http://prometheus-operated.monitoring:9090
grafana: # prometheus metrics will be local cluster only, disable grafana to save resources
enabled: false
proxy: false
kubecostProductConfigs:
clusterName: CLUSTER_NAME
kubecostAggregator:
deployMethod: statefulset
kubecostModel:
federatedStorageConfigSecret: federated-store
clusterController:
enabled: true
actionConfigs:
clusterTurndown:
- name: my-schedule2
start: "2034-02-09T00:00:00Z"
end: "2034-02-09T01:00:00Z"
repeat: none
prometheus:
nodeExporter:
enabled: true
alertmanager:
enabled: true
configmapReload:
prometheus:
enabled: true
pushgateway:
enabled: true
server:
statefulSet:
enabled: true
global:
external_labels:
# cluster_id should be unique for all clusters and the same value as .kubecostProductConfigs.clusterName
cluster_id: CLUSTER_NAME

View File

@ -0,0 +1,78 @@
# TurndownSchedule Custom Resource Definition for persistence
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: turndownschedules.kubecost.com
spec:
group: kubecost.com
names:
kind: TurndownSchedule
singular: turndownschedule
plural: turndownschedules
shortNames:
- td
- tds
scope: Cluster
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
repeat:
type: string
enum: [none, daily, weekly]
status:
type: object
properties:
state:
type: string
lastUpdated:
format: date-time
type: string
current:
type: string
scaleDownId:
type: string
nextScaleDownTime:
format: date-time
type: string
scaleDownMetadata:
additionalProperties:
type: string
type: object
scaleUpID:
type: string
nextScaleUpTime:
format: date-time
type: string
scaleUpMetadata:
additionalProperties:
type: string
type: object
additionalPrinterColumns:
- name: State
type: string
description: The state of the turndownschedule
jsonPath: .status.state
- name: Next Turndown
type: string
description: The next turndown date-time
jsonPath: .status.nextScaleDownTime
- name: Next Turn Up
type: string
description: The next turn up date-time
jsonPath: .status.nextScaleUpTime

View File

@ -0,0 +1,7 @@
EndTimestamp,InstanceID,Region,AssetClass,InstanceIDField,InstanceType,MarketPriceHourly,Version
2028-01-06 23:34:45 UTC,,us-east-2,node,metadata.name,g4dn.xlarge,5.55,
2028-01-06 23:34:45 UTC,,,node,metadata.name,R730-type1,1.35,
2028-01-06 23:34:45 UTC,,,pv,metadata.name,standard,0.44,
2028-01-06 23:34:45 UTC,a100,,gpu,gpu.nvidia.com/class,,0.75,
2028-01-06 23:34:45 UTC,RTX3090,,gpu,nvidia.com/gpu_type,,0.65,
2028-01-06 23:34:45 UTC,i-01045ab6d13179700,,,spec.providerID,,1.2,
1 EndTimestamp InstanceID Region AssetClass InstanceIDField InstanceType MarketPriceHourly Version
2 2028-01-06 23:34:45 UTC us-east-2 node metadata.name g4dn.xlarge 5.55
3 2028-01-06 23:34:45 UTC node metadata.name R730-type1 1.35
4 2028-01-06 23:34:45 UTC pv metadata.name standard 0.44
5 2028-01-06 23:34:45 UTC a100 gpu gpu.nvidia.com/class 0.75
6 2028-01-06 23:34:45 UTC RTX3090 gpu nvidia.com/gpu_type 0.65
7 2028-01-06 23:34:45 UTC i-01045ab6d13179700 spec.providerID 1.2

View File

@ -0,0 +1,45 @@
# Kubecost Grafana Dashboards
## Overview
Kubecost, by default, is bundled with a Grafana instance that already contains the dashboards in this folder.
The dashboards in this repo are imported into Kubecost, unless disabled with
The same dashboards have template versions in [grafana-templates/](grafana-templates/) for those wanting to load the dashboards into an existing Grafana instance.
## Caveats
The primary purpose of the dashboards provided is to allow visibility into the metrics used by Kubecost to create the cost-model.
The networkCosts-metrics dashboard requires the optional networkCosts daemonset to be [enabled](https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration).
## Metrics Required
`kubecost-container-stats` metrics:
```
container_cpu_usage_seconds_total
kube_pod_container_resource_requests
container_memory_working_set_bytes
container_cpu_cfs_throttled_periods_total
container_cpu_cfs_periods_total
```
`network-transfer-data` metrics:
```
kubecost_pod_network_ingress_bytes_total
kubecost_pod_network_egress_bytes_total
```
`disk-usage` metrics:
```
container_fs_limit_bytes
container_fs_usage_bytes
```
## Additional Information
Kubecost Grafana [Configuration Guide](https://docs.kubecost.com/install-and-configure/advanced-configuration/custom-grafana)

View File

@ -0,0 +1,549 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 16,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sum(container_fs_limit_bytes{instance=~'$disk', device!=\"tmpfs\", id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}/{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Disk Size",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 1,
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sum(container_fs_usage_bytes{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance) / sum(container_fs_limit_bytes{instance=~'$disk',device!=\"tmpfs\", id=\"/\", cluster_id=~'$cluster'}) by (cluster_id,instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}-{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Disk Utilization",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 1,
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 9
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "1 - sum(container_fs_inodes_free{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance) / sum(container_fs_inodes_total{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance)",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}/{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "iNode Utilization",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 9
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sum(container_fs_usage_bytes{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}/{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Disk Usage",
"type": "timeseries"
}
],
"schemaVersion": 39,
"tags": [
"kubecost",
"cost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "PBFA97CFB590B2093"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"definition": "label_values(cluster_id)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": true,
"text": "ip-192-168-147-146.us-east-2.compute.internal",
"value": "ip-192-168-147-146.us-east-2.compute.internal"
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"definition": "label_values(container_fs_limit_bytes{cluster_id=~\"$cluster\"}, instance)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "disk",
"options": [],
"query": {
"query": "label_values(container_fs_limit_bytes{cluster_id=~\"$cluster\"}, instance)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Attached disk metrics",
"uid": "nBH7qBgMk",
"version": 7,
"weekStart": ""
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,668 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 7,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(container_fs_writes_bytes_total{pod=~\".+-aggregator-0\",namespace=~\"$namespace\"}[2m])) by (namespace)",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Storage Write",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(container_fs_reads_bytes_total{pod=~\".+-aggregator-0\",namespace=~\"$namespace\"}[2m])) by (namespace)",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Storage Read",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(container_memory_working_set_bytes{container=\"aggregator\",pod!=\"\",namespace=~\"$namespace\"} ) by (namespace)",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Memory Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 8
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate\r\n{container=\"aggregator\",pod!=\"\",namespace=~\"$namespace\"}[2m])) by (namespace)",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "CPU Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 16
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(kubelet_volume_stats_available_bytes{persistentvolumeclaim=~\"aggregator.+\",namespace=~\"$namespace\"}) by (namespace)",
"hide": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C"
}
],
"title": "Storage Available",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 16
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(rate(container_network_receive_bytes_total{pod=~\".+aggregator-0\",namespace=~\"$namespace\"}[2m])) by (namespace)",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Network Receive Bytes",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 39,
"tags": [
"utilization",
"metrics",
"kubecost"
],
"templating": {
"list": [
{
"current": {
"selected": true,
"text": "Prometheus",
"value": "prometheus"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(container_memory_working_set_bytes{container=\"aggregator\"},namespace)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(container_memory_working_set_bytes{container=\"aggregator\"},namespace)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-1d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Kubecost Aggregator Metrics",
"uid": "kubecost_aggregator_metrics",
"version": 1,
"weekStart": ""
}

View File

@ -0,0 +1,787 @@
{
"__inputs": [
{
"name": "DS_THANOS",
"label": "Thanos",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.3.1"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 9063,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"description": "Maximum CPU Core Usage vs avg Requested",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 0
},
"id": 94,
"links": [],
"options": {
"legend": {
"calcs": [
"max"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "max(irate(container_cpu_usage_seconds_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\", container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\n by (cluster_id, namespace, pod, container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (usage max)",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"exemplar": true,
"expr": "avg(kube_pod_container_resource_requests\r\n {cluster_id=\"$cluster\",resource=\"cpu\",unit=\"core\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}\r\n ) \r\nby (cluster_id,namespace,pod,container)",
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (requested)",
"range": true,
"refId": "B"
}
],
"timeFrom": "",
"title": "CPU Core Usage vs Requested",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"description": "Max memory used vs avg requested",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 0
},
"id": 96,
"links": [],
"options": {
"legend": {
"calcs": [
"max"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "asc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "max(max_over_time(container_memory_working_set_bytes\r\n {namespace=~\"$namespace\",pod=~\"$pod\",cluster_id=\"$cluster\",container=~\"$container\",container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (usage max)",
"metric": "container_cpu",
"refId": "MEMORY_USAGE",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "avg(kube_pod_container_resource_requests\n {resource=\"memory\",unit=\"byte\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\",container!=\"POD\"}\n )\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (requested)",
"refId": "MEMORY_REQUESTED"
}
],
"timeFrom": "",
"title": "Memory Usage vs Requested",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"description": "Network traffic by pod",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "Bps",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 7
},
"id": 95,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "sum(irate(container_network_receive_bytes_total\n {cluster_id=~\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}<- in",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "- sum(irate(container_network_transmit_bytes_total\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}-> out",
"refId": "B"
}
],
"timeFrom": "",
"title": "Network IO",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"description": "Disk read writes",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "Bps",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 7
},
"id": 97,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "sum(irate(container_fs_writes_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}}<- write",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "- sum(irate(container_fs_reads_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}}-> read",
"refId": "B"
}
],
"timeFrom": "",
"title": "Disk IO",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"description": "This graph shows the % of periods where a pod is being throttled. Values range from 0-100",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 1800000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 14
},
"id": 99,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_THANOS}"
},
"editorMode": "code",
"expr": "100\n * sum by(cluster_id, namespace, pod, container) (increase(container_cpu_cfs_throttled_periods_total{container!=\"\",cluster_id=\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\", container!=\"POD\"}[$__rate_interval]))\n / sum by(cluster_id,namespace,pod,container) (increase(container_cpu_cfs_periods_total{container!=\"\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "",
"refId": "B"
}
],
"timeFrom": "",
"title": "CPU throttle percent",
"type": "timeseries"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 39,
"tags": [
"utilization",
"metrics",
"kubecost"
],
"templating": {
"list": [
{
"current": {},
"definition": "label_values(cluster_id)",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {},
"definition": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ",
"hide": 0,
"includeAll": true,
"label": "",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {},
"definition": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ",
"hide": 0,
"includeAll": true,
"label": "pod",
"multi": false,
"name": "pod",
"options": [],
"query": {
"query": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {},
"definition": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "container",
"options": [],
"query": {
"query": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {
"hidden": false,
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "Pod utilization metrics (multi-cluster)",
"uid": "at-cost-analysis-pod2",
"version": 1,
"weekStart": ""
}

View File

@ -0,0 +1,571 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.4.2"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(container_fs_limit_bytes{instance=~'$disk', device!=\"tmpfs\", id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}/{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Disk Size",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 1,
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(container_fs_usage_bytes{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance) / sum(container_fs_limit_bytes{instance=~'$disk',device!=\"tmpfs\", id=\"/\", cluster_id=~'$cluster'}) by (cluster_id,instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}-{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Disk Utilization",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 1,
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 9
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "1 - sum(container_fs_inodes_free{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance) / sum(container_fs_inodes_total{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance)",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}/{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "iNode Utilization",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 9
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "9.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(container_fs_usage_bytes{instance=~'$disk',id=\"/\", cluster_id=~'$cluster'}) by (cluster_id, instance)",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}}/{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Disk Usage",
"type": "timeseries"
}
],
"schemaVersion": 39,
"tags": [
"kubecost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "Prometheus"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(cluster_id)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(container_fs_limit_bytes{cluster_id=~\"$cluster\"}, instance)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "disk",
"options": [],
"query": {
"query": "label_values(container_fs_limit_bytes{cluster_id=~\"$cluster\"}, instance)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Attached disk metrics (multi-cluster)",
"uid": "nBH7qBgMk",
"version": 2,
"weekStart": ""
}

View File

@ -0,0 +1,685 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.4.2"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 12,
"panels": [],
"title": "Network Data Transfers (negative is egress data)",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 11,
"x": 0,
"y": 1
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]\n ))\nby($aggregation) ",
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-sum(increase(kubecost_pod_network_egress_bytes_total\n {namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]\n ))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "All Data",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 13,
"x": 11,
"y": 1
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {internet=\"true\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]\n))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(increase(kubecost_pod_network_egress_bytes_total\n {internet=\"true\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "Internet Data",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Cross region and cross zone subnets must be defined via the configMap. \nSee: \n<https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration#overriding-traffic-classifications>",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 11,
"x": 0,
"y": 15
},
"id": 9,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {internet=\"false\",namespace=~\"$namespace\",cluster_id=~\"$cluster\",pod_name=~\"$pod_name\", sameRegion=\"false\",sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation)",
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(increase(kubecost_pod_network_egress_bytes_total\n {internet=\"false\", namespace=~\"$namespace\",cluster_id=~\"$cluster\",pod_name=~\"$pod_name\",sameRegion=\"false\", sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "Cross Region Data",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Cross region and cross zone subnets must be defined via the configMap. \nSee: \n<https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration#overriding-traffic-classifications>",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 13,
"x": 11,
"y": 15
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {internet=\"false\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", sameRegion=\"true\", sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation)",
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(increase(kubecost_pod_network_egress_bytes_total\n {internet=\"false\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", sameRegion=\"true\", sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation)",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "Cross Zone Data",
"type": "timeseries"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 39,
"tags": [
"kubecost"
],
"templating": {
"list": [
{
"current": {},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "namespace",
"value": "namespace"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "aggregation",
"options": [
{
"selected": false,
"text": "cluster_id",
"value": "cluster_id"
},
{
"selected": true,
"text": "namespace",
"value": "namespace"
},
{
"selected": false,
"text": "pod_name",
"value": "pod_name"
}
],
"query": "cluster_id, namespace, pod_name",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(cluster_id)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": true,
"text": "kubecost",
"value": "kubecost"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kubecost_pod_network_egress_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\"},pod_name)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "pod_name",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kubecost_pod_network_egress_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\"},pod_name)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"filters": [],
"hide": 0,
"name": "filter",
"skipUrlSync": false,
"type": "adhoc"
},
{
"current": {},
"definition": "label_values(kubecost_pod_network_egress_bytes_total{namespace=~\"$namespace\"},service)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "service",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kubecost_pod_network_egress_bytes_total{namespace=~\"$namespace\"},service)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Kubecost Network Costs Metrics",
"uid": "kubecost-networkCosts-metrics",
"version": 8,
"weekStart": ""
}

View File

@ -0,0 +1,408 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 29,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"panels": [],
"title": "Requests - Usage (negative values are unused reservations)",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 16,
"w": 24,
"x": 0,
"y": 1
},
"id": 4,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by ($aggregation) (\n (sum by (cluster_id,namespace,pod,container) (container_memory_usage_bytes{cluster_id=~\"$cluster\",namespace=~\"$namespace\",container=~\"$container\",container!=\"POD\",container!=\"\"}))\n -(sum by (cluster_id,namespace,pod,container) (kube_pod_container_resource_requests{resource=\"memory\",unit=\"byte\",cluster_id=~\"$cluster\",namespace=~\"$namespace\",container=~\"$container\",container!=\"POD\",container!=\"\"}))\n)",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by ($aggregation) (\n -(sum by (cluster_id,namespace,pod,container) (kube_pod_container_resource_requests{resource=\"memory\",unit=\"byte\",cluster_id=~\"$cluster\",namespace=~\"$namespace\",container=~\"$container\",container!=\"POD\",container!=\"\"}))\n)",
"hide": true,
"legendFormat": "{{$aggregation}} Request",
"range": true,
"refId": "B"
}
],
"title": "Memory Request-Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 24,
"x": 0,
"y": 17
},
"id": 6,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by ($aggregation)(\n (sum by (cluster_id,namespace,pod,container) (rate(container_cpu_usage_seconds_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\",container!=\"\"}[1h])))\n - \n (sum by (cluster_id,namespace,pod,container) (kube_pod_container_resource_requests{resource=\"cpu\",cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\",container!=\"\"}))\n)\n \n",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-sum by ($aggregation)(\n (sum by (cluster_id,namespace,pod,container) (kube_pod_container_resource_requests{resource=\"cpu\",cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\",container!=\"\"}))\n)",
"hide": true,
"legendFormat": "{{$aggregation}} Request",
"range": true,
"refId": "B"
}
],
"title": "CPU Request-Usage",
"type": "timeseries"
}
],
"schemaVersion": 37,
"style": "dark",
"tags": [
"utilization",
"metrics",
"kubecost"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "default",
"value": "default"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": true,
"text": "namespace",
"value": "namespace"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "aggregation",
"options": [
{
"selected": false,
"text": "cluster_id",
"value": "cluster_id"
},
{
"selected": true,
"text": "namespace",
"value": "namespace"
},
{
"selected": false,
"text": "container",
"value": "container"
}
],
"query": "cluster_id,namespace,container",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels, cluster_id)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels, cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": true,
"text": "kubecost",
"value": "kubecost"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(container_memory_working_set_bytes{cluster_id=~\"$cluster\",namespace=~\"$namespace\", container!=\"POD\"}, container) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "container",
"options": [],
"query": {
"query": "label_values(container_memory_working_set_bytes{cluster_id=~\"$cluster\",namespace=~\"$namespace\", container!=\"POD\"}, container) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Kubernetes Resource Efficiency",
"uid": "kubernetes-resource-efficiency",
"version": 1,
"weekStart": ""
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,408 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Most used metrics when troubleshooting applications",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 14,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 11,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "sum(\n rate(kubecost_pod_network_ingress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\",service!=\"\",service=~\"$service\"}\n [1h]\n )\n) \nby (namespace,service) ",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"interval": "1h",
"legendFormat": "{{namespace}}/{{service}}",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "- sum(\n rate(kubecost_pod_network_egress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\",service!=\"\",service=~\"$service\"}\n [1h]\n )\n) \nby(namespace, service) ",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"interval": "1h",
"legendFormat": "{{namespace}}/{{service}}",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Kubecost Network Cloud Service by Namespace (egress is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 24,
"x": 0,
"y": 10
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "sum(topk(5,\n rate(kubecost_pod_network_ingress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\",service!=\"\",service=~\"$service\"}\n [1h]\n )\n) )\nby(namespace, pod_name,service) ",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"interval": "1h",
"legendFormat": "{{namespace}}/{{pod_name}}/{{service}}",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "- sum(topk(5,\n rate(kubecost_pod_network_egress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\",service!=\"\",service=~\"$service\"}\n [1h]\n )\n) )\nby(namespace, pod_name,service) ",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"interval": "1h",
"legendFormat": "{{namespace}}/{{pod_name}}/{{service}}",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Kubecost Network Cloud Service by Pod (egress is negative)",
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 39,
"tags": [
"utilization",
"metrics",
"kubecost"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "PBFA97CFB590B2093"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels,namespace)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_pod_owner{namespace=~\"$namespace\"},pod)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "pod",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_pod_owner{namespace=~\"$namespace\"},pod)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"definition": "label_values(kube_pod_container_status_running{namespace=\"$namespace\"},container)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "container",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_pod_container_status_running{namespace=\"$namespace\"},container)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"definition": "label_values(kubecost_pod_network_egress_bytes_total{namespace=~\"$namespace\"},service)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "service",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kubecost_pod_network_egress_bytes_total{namespace=~\"$namespace\"},service)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Kubecost Network Cloud Service Metrics",
"uid": "kubecost-network-cloud-services",
"version": 1,
"weekStart": ""
}

View File

@ -0,0 +1,672 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 12,
"panels": [],
"title": "Network Data Transfers (negative is egress data)",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 11,
"x": 0,
"y": 1
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]\n ))\nby($aggregation) ",
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-sum(increase(kubecost_pod_network_egress_bytes_total\n {namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]\n ))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "All Data",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 13,
"x": 11,
"y": 1
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {internet=\"true\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]\n))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(increase(kubecost_pod_network_egress_bytes_total\n {internet=\"true\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", service=~\"$service\"}\n [1h]))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "Internet Data",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Cross region and cross zone subnets must be defined via the configMap. \nSee: \n<https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration#overriding-traffic-classifications>",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 11,
"x": 0,
"y": 15
},
"id": 9,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {internet=\"false\",namespace=~\"$namespace\",cluster_id=~\"$cluster\",pod_name=~\"$pod_name\", sameRegion=\"false\",sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation)",
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(increase(kubecost_pod_network_egress_bytes_total\n {internet=\"false\", namespace=~\"$namespace\",cluster_id=~\"$cluster\",pod_name=~\"$pod_name\",sameRegion=\"false\", sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation) ",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "Cross Region Data",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Cross region and cross zone subnets must be defined via the configMap. \nSee: \n<https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration#overriding-traffic-classifications>",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 100,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 13,
"x": 11,
"y": 15
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(increase(kubecost_pod_network_ingress_bytes_total\n {internet=\"false\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", sameRegion=\"true\", sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation)",
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(increase(kubecost_pod_network_egress_bytes_total\n {internet=\"false\", namespace=~\"$namespace\", cluster_id=~\"$cluster\", pod_name=~\"$pod_name\", sameRegion=\"true\", sameZone=\"false\", service=~\"$service\"}\n [1h]))\nby($aggregation)",
"hide": false,
"interval": "1h",
"legendFormat": "__auto",
"range": true,
"refId": "B"
}
],
"title": "Cross Zone Data",
"type": "timeseries"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 39,
"tags": [
"utilization",
"metrics",
"kubecost"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "PBFA97CFB590B2093"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "namespace",
"value": "namespace"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "aggregation",
"options": [
{
"selected": false,
"text": "cluster_id",
"value": "cluster_id"
},
{
"selected": true,
"text": "namespace",
"value": "namespace"
},
{
"selected": false,
"text": "pod_name",
"value": "pod_name"
}
],
"query": "cluster_id, namespace, pod_name",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(cluster_id)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": true,
"text": "kubecost",
"value": "kubecost"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kubecost_pod_network_egress_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\"},pod_name)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "pod_name",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kubecost_pod_network_egress_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\"},pod_name)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"filters": [],
"hide": 0,
"name": "filter",
"skipUrlSync": false,
"type": "adhoc"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"definition": "label_values(kubecost_pod_network_egress_bytes_total{namespace=~\"$namespace\"},service)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "service",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kubecost_pod_network_egress_bytes_total{namespace=~\"$namespace\"},service)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Kubecost Network Costs Metrics",
"uid": "kubecost-networkCosts-metrics",
"version": 2,
"weekStart": ""
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,788 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 9063,
"graphTooltip": 0,
"id": 4,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"description": "Maximum CPU Core Usage vs avg Requested",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 0
},
"id": 94,
"links": [],
"options": {
"legend": {
"calcs": [
"max"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "max(irate(container_cpu_usage_seconds_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\", container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\n by (cluster_id, namespace, pod, container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (usage max)",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"exemplar": true,
"expr": "avg(kube_pod_container_resource_requests\r\n {cluster_id=\"$cluster\",resource=\"cpu\",unit=\"core\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}\r\n ) \r\nby (cluster_id,namespace,pod,container)",
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (requested)",
"range": true,
"refId": "B"
}
],
"timeFrom": "",
"title": "CPU Core Usage vs Requested",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"description": "Max memory used vs avg requested",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 0
},
"id": 96,
"links": [],
"options": {
"legend": {
"calcs": [
"max"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "asc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "max(max_over_time(container_memory_working_set_bytes\r\n {namespace=~\"$namespace\",pod=~\"$pod\",cluster_id=\"$cluster\",container=~\"$container\",container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (usage max)",
"metric": "container_cpu",
"refId": "MEMORY_USAGE",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "avg(kube_pod_container_resource_requests\n {resource=\"memory\",unit=\"byte\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\",container!=\"POD\"}\n )\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (requested)",
"refId": "MEMORY_REQUESTED"
}
],
"timeFrom": "",
"title": "Memory Usage vs Requested",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"description": "Network traffic by pod",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "Bps",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 7
},
"id": 95,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "sum(irate(container_network_receive_bytes_total\n {cluster_id=~\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}<- in",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "- sum(irate(container_network_transmit_bytes_total\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}-> out",
"refId": "B"
}
],
"timeFrom": "",
"title": "Network IO",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"description": "Disk read writes",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "Bps",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 7
},
"id": 97,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "sum(irate(container_fs_writes_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}}<- write",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "- sum(irate(container_fs_reads_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}}-> read",
"refId": "B"
}
],
"timeFrom": "",
"title": "Disk IO",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"description": "This graph shows the % of periods where a pod is being throttled. Values range from 0-100",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 1800000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 14
},
"id": 99,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"editorMode": "code",
"expr": "100\n * sum by(cluster_id, namespace, pod, container) (increase(container_cpu_cfs_throttled_periods_total{container!=\"\",cluster_id=\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\", container!=\"POD\"}[$__rate_interval]))\n / sum by(cluster_id,namespace,pod,container) (increase(container_cpu_cfs_periods_total{container!=\"\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "",
"refId": "B"
}
],
"timeFrom": "",
"title": "CPU throttle percent",
"type": "timeseries"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 39,
"tags": [
"utilization",
"metrics",
"kubecost"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "CostManagement",
"value": "CostManagement"
},
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"definition": "label_values(cluster_id)",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "cluster",
"options": [],
"query": {
"query": "label_values(cluster_id)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "kubecost",
"value": "kubecost"
},
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"definition": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ",
"hide": 0,
"includeAll": true,
"label": "",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"definition": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ",
"hide": 0,
"includeAll": true,
"label": "pod",
"multi": false,
"name": "pod",
"options": [],
"query": {
"query": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "Thanos"
},
"definition": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "container",
"options": [],
"query": {
"query": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {
"hidden": false,
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "Pod utilization metrics (multi-cluster)",
"uid": "at-cost-analysis-pod-multicluster",
"version": 2,
"weekStart": ""
}

View File

@ -0,0 +1,860 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 9063,
"graphTooltip": 0,
"id": 11,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Maximum CPU Core Usage vs Requested",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 0
},
"id": 94,
"links": [],
"options": {
"legend": {
"calcs": [
"max"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "max(irate(\r\n container_cpu_usage_seconds_total\r\n {namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\n by (cluster_id, namespace, pod, container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}} (usage max)",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"exemplar": true,
"expr": "avg(kube_pod_container_resource_requests\r\n {resource=\"cpu\",unit=\"core\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}\r\n ) \r\nby (cluster_id, namespace, pod, container)",
"legendFormat": "{{cluster_id}} {{pod}}/{{container}} (avg requested)",
"range": true,
"refId": "B"
}
],
"timeFrom": "",
"title": "CPU Core Usage vs Requested",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Max Memory usage vs avg requested",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 0
},
"id": 96,
"links": [],
"options": {
"legend": {
"calcs": [
"max"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "asc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "max(max_over_time(\r\n container_memory_working_set_bytes\r\n {namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}} (usage max)",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "avg(\n kube_pod_container_resource_requests\n {resource=\"memory\",unit=\"byte\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\", container!=\"POD\"}\n )\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}} (avg requested)",
"refId": "B"
}
],
"timeFrom": "",
"title": "Memory Usage vs Requested",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Network traffic by pod",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 7
},
"id": 95,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(irate(container_network_receive_bytes_total\n {namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}<- in",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(irate(container_network_transmit_bytes_total\n {namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}-> out",
"refId": "B"
}
],
"timeFrom": "",
"title": "Network IO",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Disk read writes",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 7
},
"id": 97,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(irate(container_fs_writes_bytes_total\r\n {container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}}<- write",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "- sum(irate(container_fs_reads_bytes_total\r\n {container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{cluster_id}} {{pod}}/{{container}}-> read",
"refId": "B"
}
],
"timeFrom": "",
"title": "Disk IO",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "This graph shows the % of periods where a pod is being throttled. Values range from 0-100",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 1800000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 14
},
"id": 99,
"links": [],
"options": {
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "100\n * sum by(cluster_id, namespace, pod, container) (increase(container_cpu_cfs_throttled_periods_total{container!=\"\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\", container!=\"POD\"}[$__rate_interval]))\n / sum by(cluster_id, namespace, pod, container) (increase(container_cpu_cfs_periods_total{container!=\"\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\", container!=\"POD\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "__auto",
"refId": "B"
}
],
"timeFrom": "",
"title": "CPU throttle percent",
"type": "timeseries"
},
{
"datasource": {
"default": false,
"type": "prometheus",
"uid": "${datasource}"
},
"description": "NVIDIA GPU usage for this container.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 14
},
"id": 100,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "DCGM_FI_PROF_GR_ENGINE_ACTIVE{namespace=~\"$namespace\",container=~\"$container\",pod=~\"$pod\"}",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "__auto",
"metric": "container_cpu",
"refId": "A",
"step": 10
}
],
"timeFrom": "",
"title": "GPU Usage",
"type": "timeseries"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 39,
"tags": [
"kubecost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "Prometheus"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels, namespace) ",
"hide": 0,
"includeAll": true,
"label": "",
"multi": false,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels, namespace) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"uid": "${datasource}"
},
"definition": "label_values(kube_pod_labels{namespace=~\"$namespace\"}, pod) ",
"hide": 0,
"includeAll": true,
"label": "pod",
"multi": false,
"name": "pod",
"options": [],
"query": {
"query": "label_values(kube_pod_labels{namespace=~\"$namespace\"}, pod) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(container_memory_working_set_bytes{namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "container",
"options": [],
"query": {
"query": "label_values(container_memory_working_set_bytes{namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {
"hidden": false,
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "Pod utilization metrics",
"uid": "at-cost-analysis-pod",
"version": 2,
"weekStart": ""
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,988 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Most used metrics when troubleshooting applications",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 7,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(5,sum(container_memory_working_set_bytes{container=\"aggregator\",namespace=~\"$namespace\"} ) by (namespace,pod,container))",
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "A"
}
],
"title": "Top Memory Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 1,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(5, (\r\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",namespace=~\"$namespace\",container=\"aggregator\"}[$__rate_interval])) by (namespace,pod,container)\r\n )\r\n)",
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "A"
}
],
"title": "Top CPU Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"id": 9,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "sum(topk(5,\n rate(kubecost_pod_network_ingress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\"}\n [$__rate_interval]\n )\n) )\nby(namespace, pod_name) ",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{namespace}}/{{pod_name}}",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "- sum(topk(5,\n rate(kubecost_pod_network_egress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\"}\n [$__rate_interval]\n )\n) )\nby(namespace, pod_name) ",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{namespace}}/{{pod_name}}",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Kubecost Top Network (egress is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": 3600000,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 8
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(topk(5,rate(container_network_receive_bytes_total{namespace=~\"$namespace\"}[$__rate_interval]))) by (namespace,pod) ",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{pod}}",
"range": true,
"refId": "receive"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-sum(topk(5,rate(container_network_transmit_bytes_total{namespace=~\"$namespace\"}[$__rate_interval]))) by (namespace,pod) ",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{pod}}",
"range": true,
"refId": "transmit"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "container_network_transmit_bytes_total{}",
"hide": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Top Network (transmit is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": 3600000,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 16
},
"id": 7,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "\n sum(rate(container_fs_writes_bytes_total\n {container=\"aggregator\",namespace=~\"$namespace\",image!=\"\"}\n [$__rate_interval]))\n by (namespace,pod,container)\n>0 ",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "storage_write"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-(sum\r\n (rate(container_fs_reads_bytes_total\r\n {container=\"aggregator\",namespace=~\"$namespace\",image!=\"\"}\r\n [$__rate_interval])) \r\nby (namespace,pod,container) \r\n) <0",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "storage_read"
}
],
"title": "Storage (read is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "This may work depending on the CRI",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 16
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(kubelet_volume_stats_available_bytes{namespace=~\"$namespace\"}) by (namespace,persistentvolumeclaim)",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{persistentvolumeclaim}}",
"range": true,
"refId": "C"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(kube_persistentvolume_capacity_bytes) by (persistentvolume)",
"hide": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Storage ",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 82,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 24
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(increase(kube_pod_container_status_restarts_total{namespace=~\"$namespace\",pod=~\".+-aggregator-0\"}[1h])) by (namespace,container)>0",
"instant": false,
"interval": "1h",
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "A"
}
],
"title": "Pod restarts per hour",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 24
},
"id": 11,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "kubecost_read_db_size",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "kubecost_read_db_size"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(kubecost_write_db_size)",
"hide": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "kubecost_write_db_size"
}
],
"title": "Aggregator DB Size",
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 39,
"tags": [
"kubecost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "PBFA97CFB590B2093"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": true,
"text": "kubecost",
"value": "kubecost"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels,namespace)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_pod_owner{namespace=~\"$namespace\"},pod)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "pod",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_pod_owner{namespace=~\"$namespace\"},pod)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-3h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Workload Metrics - Aggregator",
"uid": "kubecost-aggregator-metrics",
"version": 1,
"weekStart": ""
}

View File

@ -0,0 +1,893 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Most used metrics when troubleshooting applications",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 2,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(5,sum(container_memory_working_set_bytes{container=~\"$container\",pod=~\"$pod\",container!=\"\",namespace=~\"$namespace\"} ) by (namespace,pod,container))",
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "A"
}
],
"title": "Top Memory Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 1,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(5, (\r\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\"}[10m])) by (namespace,pod,container)\r\n )\r\n)",
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "A"
}
],
"title": "Top CPU Usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"id": 9,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "sum(topk(5,\n rate(kubecost_pod_network_ingress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\"}\n [$__rate_interval]\n )\n) )\nby(namespace, pod_name) ",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{namespace}}/{{pod_name}}",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "- sum(topk(5,\n rate(kubecost_pod_network_egress_bytes_total\n {namespace=~\"$namespace\", pod_name=~\"$pod\"}\n [$__rate_interval]\n )\n) )\nby(namespace, pod_name) ",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{namespace}}/{{pod_name}}",
"range": true,
"refId": "B",
"useBackend": false
}
],
"title": "Kubecost Top Network (egress is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": 3600000,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 8
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(topk(5,rate(container_network_receive_bytes_total{pod=~\"$pod\",namespace=~\"$namespace\"}[$__rate_interval]))) by (namespace,pod) ",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{pod}}",
"range": true,
"refId": "receive"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-sum(topk(5,rate(container_network_transmit_bytes_total{pod=~\"$pod\",namespace=~\"$namespace\"}[$__rate_interval]))) by (namespace,pod) ",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{pod}}",
"range": true,
"refId": "transmit"
}
],
"title": "Top Network (transmit is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": 3600000,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "binBps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 16
},
"id": 7,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "\n sum(rate(container_fs_writes_bytes_total\n {pod=~\"$pod\",namespace=~\"$namespace\",image!=\"\"}\n [$__rate_interval]))\n by (namespace,pod,container)\n>0 ",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "storage_write"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "-(sum\r\n (rate(container_fs_reads_bytes_total\r\n {pod=~\"$pod\",namespace=~\"$namespace\",image!=\"\"}\r\n [$__rate_interval])) \r\nby (namespace,pod,container) \r\n) <0",
"hide": false,
"instant": false,
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "storage_read"
}
],
"title": "Storage (read is negative)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "This may work depending on the CRI",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 16
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(kubelet_volume_stats_available_bytes{namespace=~\"$namespace\"}) by (namespace,persistentvolumeclaim)",
"hide": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(kube_persistentvolume_capacity_bytes) by (persistentvolume)",
"hide": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Storage ",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 82,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 24
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(increase(kube_pod_container_status_restarts_total{namespace=~\"$namespace\",pod=~\"$pod\"}[1h])) by (namespace,container)>0",
"instant": false,
"interval": "1h",
"legendFormat": "{{namespace}}/{{container}}",
"range": true,
"refId": "A"
}
],
"title": "Pod restarts per hour",
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 39,
"tags": [
"kubecost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "PBFA97CFB590B2093"
},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": true,
"text": "kubecost",
"value": "kubecost"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels,namespace)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "namespace",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_pod_owner{namespace=~\"$namespace\"},pod)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "pod",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(kube_pod_owner{namespace=~\"$namespace\"},pod)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
},
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"definition": "label_values({namespace=~\"$namespace\", pod=~\"$pod\"},container)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "container",
"options": [],
"query": {
"qryType": 1,
"query": "label_values({namespace=~\"$namespace\", pod=~\"$pod\"},container)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 5,
"type": "query"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Workload Metrics",
"uid": "kubecost-workload-metrics",
"version": 1,
"weekStart": ""
}

View File

@ -0,0 +1,187 @@
questions:
# General Settings
- variable: kubecostProductConfigs.clusterName
label: Cluster Name
description: "Used for display in the cost-analyzer UI (Can be renamed in the UI)"
type: string
required: true
default: ""
group: General Settings
- variable: persistentVolume.enabled
label: Enable Persistent Volume for CostAnalyzer
description: "If true, Kubecost will create a Persistent Volume Claim for product config data"
type: boolean
default: false
show_subquestion_if: true
group: "General Settings"
subquestions:
- variable: persistentVolume.size
label: CostAnalyzer Persistent Volume Size
type: string
default: "0.2Gi"
# Amazon EKS
- variable: AmazonEKS.enabled
label: Amazon EKS cluster
description: "If true, Kubecost will be installed with the images and helm chart from https://gallery.ecr.aws/kubecost/"
type: boolean
default: false
show_subquestion_if: true
group: General Settings
subquestions:
- variable: kubecostFrontend.image
label: Kubecost frontend image for Amazon EKS
description: "Use this image for the Amazon EKS cluster: public.ecr.aws/kubecost/frontend"
type: string
default: ""
- variable: kubecostModel.image
label: Kubecost cost-model image for Amazon EKS
description: "Use this image for the Amazon EKS cluster: public.ecr.aws/kubecost/cost-model"
type: string
default: ""
- variable: prometheus.server.image.repository
label: Kubecost Prometheus image for Amazon EKS
description: "Use this image for the Amazon EKS cluster: public.ecr.aws/kubecost/prometheus"
type: string
default: ""
- variable: prometheus.server.image.tag
label: Kubecost Prometheus image tag for Amazon EKS
type: string
default: "v2.35.0"
# Prometheus Server
- variable: global.prometheus.enabled
label: Enable Prometheus
description: If false, use an existing Prometheus install
type: boolean
default: true
group: "Prometheus"
- variable: prometheus.kubeStateMetrics.enabled
label: Enable KubeStateMetrics
description: "If true, deploy kube-state-metrics for Kubernetes metrics"
type: boolean
default: true
show_if: "global.prometheus.enabled=true"
group: "Prometheus"
- variable: prometheus.server.retention
label: Prometheus Server Retention
description: "Determines when to remove old data"
type: string
default: "15d"
show_if: "global.prometheus.enabled=true"
group: "Prometheus"
- variable: prometheus.server.persistentVolume.enabled
label: Create Persistent Volume for Prometheus
description: "If true, prometheus will create a persistent volume claim"
type: boolean
required: true
default: false
group: "Prometheus"
show_if: "global.prometheus.enabled=true"
show_subquestion_if: true
subquestions:
- variable: prometheus.server.persistentVolume.size
label: Prometheus Persistent Volume Size
type: string
default: "8Gi"
- variable: prometheus.server.persistentVolume.storageClass
label: Prometheus Persistent Volume StorageClass
description: "Prometheus data persistent volume storageClass, if not set use default StorageClass"
default: ""
type: storageclass
- variable: prometheus.server.persistentVolume.existingClaim
label: Existing Persistent Volume Claim for Prometheus
description: "If not empty, uses the specified existing PVC instead of creating new one"
type: pvc
default: ""
# Prometheus Node Exporter
- variable: prometheus.nodeExporter.enabled
label: Enable NodeExporter
description: "If false, do not create NodeExporter daemonset"
type: boolean
default: true
group: "NodeExporter"
- variable: prometheus.serviceAccounts.nodeExporter.create
label: Enable Service Accounts NodeExporter
description: "If false, do not create NodeExporter daemonset"
type: boolean
default: true
group: "NodeExporter"
# Prometheus AlertManager
- variable: prometheus.alertmanager.enabled
label: Enable AlertManager
type: boolean
default: false
group: "AlertManager"
- variable: prometheus.alertmanager.persistentVolume.enabled
label: Create Persistent Volume for AlertManager
description: "If true, alertmanager will create a persistent volume claim"
type: boolean
required: true
default: false
group: "AlertManager"
show_if: "prometheus.alertmanager.enabled=true"
show_subquestion_if: true
subquestions:
- variable: prometheus.alertmanager.persistentVolume.size
default: "2Gi"
description: "AlertManager data persistent volume size"
type: string
label: AlertManager Persistent Volume Size
- variable: prometheus.alertmanager.persistentVolume.storageClass
default: ""
description: "Alertmanager data persistent volume storageClass, if not set use default StorageClass"
type: storageclass
label: AlertManager Persistent Volume StorageClass
- variable: prometheus.alertmanager.persistentVolume.existingClaim
default: ""
description: "If not empty, uses the specified existing PVC instead of creating new one"
type: pvc
label: Existing Persistent Volume Claim for AlertManager
# PushGateway
- variable: prometheus.pushgateway.enabled
label: Enable PushGateway
type: boolean
default: false
group: "PushGateway"
- variable: prometheus.pushgateway.persistentVolume.enabled
label: Create Persistent Volume for PushGateway
description: "If true, PushGateway will create a persistent volume claim"
required: true
type: boolean
default: false
group: "PushGateway"
show_if: "prometheus.pushgateway.enabled=true"
show_subquestion_if: true
subquestions:
- variable: prometheus.prometheus.pushgateway.persistentVolume.size
label: PushGateway Persistent Volume Size
type: string
default: "2Gi"
- variable: prometheus.pushgateway.persistentVolume.storageClass
label: PushGateway Persistent Volume StorageClass
description: "PushGateway data persistent volume storageClass, if not set use default StorageClass"
type: storageclass
default: ""
- variable: prometheus.pushgateway.persistentVolume.existingClaim
label: Existing Persistent Volume Claim for PushGateway
description: "If not empty, uses the specified existing PVC instead of creating new one"
type: pvc
default: ""
# Services and Load Balancing
- variable: ingress.enabled
label: Enable Ingress
description: "Expose app using Ingress (Layer 7 Load Balancer)"
default: false
type: boolean
show_subquestion_if: true
group: "Services and Load Balancing"
subquestions:
- variable: ingress.hosts[0]
default: "xip.io"
description: "Hostname to your CostAnalyzer installation"
type: hostname
required: true
label: Hostname

View File

@ -0,0 +1,790 @@
kubecostProductConfigs:
savingsRecommendationsAllowLists:
AWS:
- a1.2xlarge
- a1.4xlarge
- a1.large
- a1.medium
- a1.metal
- a1.xlarge
- c1.medium
- c1.xlarge
- c3.2xlarge
- c3.4xlarge
- c3.8xlarge
- c3.large
- c3.xlarge
- c4.2xlarge
- c4.4xlarge
- c4.8xlarge
- c4.large
- c4.xlarge
- c5.12xlarge
- c5.18xlarge
- c5.24xlarge
- c5.2xlarge
- c5.4xlarge
- c5.9xlarge
- c5.large
- c5.metal
- c5.xlarge
- c5a.12xlarge
- c5a.16xlarge
- c5a.24xlarge
- c5a.2xlarge
- c5a.4xlarge
- c5a.8xlarge
- c5a.large
- c5a.xlarge
- c5ad.12xlarge
- c5ad.16xlarge
- c5ad.24xlarge
- c5ad.2xlarge
- c5ad.4xlarge
- c5ad.8xlarge
- c5ad.large
- c5ad.xlarge
- c5d.12xlarge
- c5d.18xlarge
- c5d.24xlarge
- c5d.2xlarge
- c5d.4xlarge
- c5d.9xlarge
- c5d.large
- c5d.metal
- c5d.xlarge
- c5n.18xlarge
- c5n.2xlarge
- c5n.4xlarge
- c5n.9xlarge
- c5n.large
- c5n.metal
- c5n.xlarge
- c6a.12xlarge
- c6a.16xlarge
- c6a.24xlarge
- c6a.2xlarge
- c6a.32xlarge
- c6a.48xlarge
- c6a.4xlarge
- c6a.8xlarge
- c6a.large
- c6a.metal
- c6a.xlarge
- c6g.12xlarge
- c6g.16xlarge
- c6g.2xlarge
- c6g.4xlarge
- c6g.8xlarge
- c6g.large
- c6g.medium
- c6g.metal
- c6g.xlarge
- c6gd.12xlarge
- c6gd.16xlarge
- c6gd.2xlarge
- c6gd.4xlarge
- c6gd.8xlarge
- c6gd.large
- c6gd.medium
- c6gd.metal
- c6gd.xlarge
- c6gn.12xlarge
- c6gn.16xlarge
- c6gn.2xlarge
- c6gn.4xlarge
- c6gn.8xlarge
- c6gn.large
- c6gn.medium
- c6gn.xlarge
- c6i.12xlarge
- c6i.16xlarge
- c6i.24xlarge
- c6i.2xlarge
- c6i.32xlarge
- c6i.4xlarge
- c6i.8xlarge
- c6i.large
- c6i.metal
- c6i.xlarge
- c6id.12xlarge
- c6id.16xlarge
- c6id.24xlarge
- c6id.2xlarge
- c6id.32xlarge
- c6id.4xlarge
- c6id.8xlarge
- c6id.large
- c6id.metal
- c6id.xlarge
- c6in.12xlarge
- c6in.16xlarge
- c6in.24xlarge
- c6in.2xlarge
- c6in.32xlarge
- c6in.4xlarge
- c6in.8xlarge
- c6in.large
- c6in.metal
- c6in.xlarge
- c7a.12xlarge
- c7a.16xlarge
- c7a.24xlarge
- c7a.2xlarge
- c7a.32xlarge
- c7a.48xlarge
- c7a.4xlarge
- c7a.8xlarge
- c7a.large
- c7a.medium
- c7a.metal-48xl
- c7a.xlarge
- c7g.12xlarge
- c7g.16xlarge
- c7g.2xlarge
- c7g.4xlarge
- c7g.8xlarge
- c7g.large
- c7g.medium
- c7g.metal
- c7g.xlarge
- c7gd.12xlarge
- c7gd.16xlarge
- c7gd.2xlarge
- c7gd.4xlarge
- c7gd.8xlarge
- c7gd.large
- c7gd.medium
- c7gd.metal
- c7gd.xlarge
- c7gn.12xlarge
- c7gn.16xlarge
- c7gn.2xlarge
- c7gn.4xlarge
- c7gn.8xlarge
- c7gn.large
- c7gn.medium
- c7gn.metal
- c7gn.xlarge
- c7i-flex.2xlarge
- c7i-flex.4xlarge
- c7i-flex.8xlarge
- c7i-flex.large
- c7i-flex.xlarge
- c7i.12xlarge
- c7i.16xlarge
- c7i.24xlarge
- c7i.2xlarge
- c7i.48xlarge
- c7i.4xlarge
- c7i.8xlarge
- c7i.large
- c7i.metal-24xl
- c7i.metal-48xl
- c7i.xlarge
- d2.2xlarge
- d2.4xlarge
- d2.8xlarge
- d2.xlarge
- d3.2xlarge
- d3.4xlarge
- d3.8xlarge
- d3.xlarge
- d3en.12xlarge
- d3en.2xlarge
- d3en.4xlarge
- d3en.6xlarge
- d3en.8xlarge
- d3en.xlarge
- dl1.24xlarge
- dl2q.24xlarge
- f1.16xlarge
- f1.2xlarge
- f1.4xlarge
- g3.16xlarge
- g3.4xlarge
- g3.8xlarge
- g3s.xlarge
- g4ad.16xlarge
- g4ad.2xlarge
- g4ad.4xlarge
- g4ad.8xlarge
- g4ad.xlarge
- g4dn.12xlarge
- g4dn.16xlarge
- g4dn.2xlarge
- g4dn.4xlarge
- g4dn.8xlarge
- g4dn.metal
- g4dn.xlarge
- g5.12xlarge
- g5.16xlarge
- g5.24xlarge
- g5.2xlarge
- g5.48xlarge
- g5.4xlarge
- g5.8xlarge
- g5.xlarge
- g5g.16xlarge
- g5g.2xlarge
- g5g.4xlarge
- g5g.8xlarge
- g5g.metal
- g5g.xlarge
- g6.12xlarge
- g6.16xlarge
- g6.24xlarge
- g6.2xlarge
- g6.48xlarge
- g6.4xlarge
- g6.8xlarge
- g6.xlarge
- g6e.12xlarge
- g6e.16xlarge
- g6e.24xlarge
- g6e.2xlarge
- g6e.48xlarge
- g6e.4xlarge
- g6e.8xlarge
- g6e.xlarge
- gr6.4xlarge
- gr6.8xlarge
- h1.16xlarge
- h1.2xlarge
- h1.4xlarge
- h1.8xlarge
- i2.2xlarge
- i2.4xlarge
- i2.8xlarge
- i2.xlarge
- i3.16xlarge
- i3.2xlarge
- i3.4xlarge
- i3.8xlarge
- i3.large
- i3.metal
- i3.xlarge
- i3en.12xlarge
- i3en.24xlarge
- i3en.2xlarge
- i3en.3xlarge
- i3en.6xlarge
- i3en.large
- i3en.metal
- i3en.xlarge
- i4g.16xlarge
- i4g.2xlarge
- i4g.4xlarge
- i4g.8xlarge
- i4g.large
- i4g.xlarge
- i4i.12xlarge
- i4i.16xlarge
- i4i.24xlarge
- i4i.2xlarge
- i4i.32xlarge
- i4i.4xlarge
- i4i.8xlarge
- i4i.large
- i4i.metal
- i4i.xlarge
- im4gn.16xlarge
- im4gn.2xlarge
- im4gn.4xlarge
- im4gn.8xlarge
- im4gn.large
- im4gn.xlarge
- inf1.24xlarge
- inf1.2xlarge
- inf1.6xlarge
- inf1.xlarge
- inf2.24xlarge
- inf2.48xlarge
- inf2.8xlarge
- inf2.xlarge
- is4gen.2xlarge
- is4gen.4xlarge
- is4gen.8xlarge
- is4gen.large
- is4gen.medium
- is4gen.xlarge
- m1.large
- m1.medium
- m1.small
- m1.xlarge
- m2.2xlarge
- m2.4xlarge
- m2.xlarge
- m3.2xlarge
- m3.large
- m3.medium
- m3.xlarge
- m4.10xlarge
- m4.16xlarge
- m4.2xlarge
- m4.4xlarge
- m4.large
- m4.xlarge
- m5.12xlarge
- m5.16xlarge
- m5.24xlarge
- m5.2xlarge
- m5.4xlarge
- m5.8xlarge
- m5.large
- m5.metal
- m5.xlarge
- m5a.12xlarge
- m5a.16xlarge
- m5a.24xlarge
- m5a.2xlarge
- m5a.4xlarge
- m5a.8xlarge
- m5a.large
- m5a.xlarge
- m5ad.12xlarge
- m5ad.16xlarge
- m5ad.24xlarge
- m5ad.2xlarge
- m5ad.4xlarge
- m5ad.8xlarge
- m5ad.large
- m5ad.xlarge
- m5d.12xlarge
- m5d.16xlarge
- m5d.24xlarge
- m5d.2xlarge
- m5d.4xlarge
- m5d.8xlarge
- m5d.large
- m5d.metal
- m5d.xlarge
- m5dn.12xlarge
- m5dn.16xlarge
- m5dn.24xlarge
- m5dn.2xlarge
- m5dn.4xlarge
- m5dn.8xlarge
- m5dn.large
- m5dn.metal
- m5dn.xlarge
- m5n.12xlarge
- m5n.16xlarge
- m5n.24xlarge
- m5n.2xlarge
- m5n.4xlarge
- m5n.8xlarge
- m5n.large
- m5n.metal
- m5n.xlarge
- m5zn.12xlarge
- m5zn.2xlarge
- m5zn.3xlarge
- m5zn.6xlarge
- m5zn.large
- m5zn.metal
- m5zn.xlarge
- m6a.12xlarge
- m6a.16xlarge
- m6a.24xlarge
- m6a.2xlarge
- m6a.32xlarge
- m6a.48xlarge
- m6a.4xlarge
- m6a.8xlarge
- m6a.large
- m6a.metal
- m6a.xlarge
- m6g.12xlarge
- m6g.16xlarge
- m6g.2xlarge
- m6g.4xlarge
- m6g.8xlarge
- m6g.large
- m6g.medium
- m6g.metal
- m6g.xlarge
- m6gd.12xlarge
- m6gd.16xlarge
- m6gd.2xlarge
- m6gd.4xlarge
- m6gd.8xlarge
- m6gd.large
- m6gd.medium
- m6gd.metal
- m6gd.xlarge
- m6i.12xlarge
- m6i.16xlarge
- m6i.24xlarge
- m6i.2xlarge
- m6i.32xlarge
- m6i.4xlarge
- m6i.8xlarge
- m6i.large
- m6i.metal
- m6i.xlarge
- m6id.12xlarge
- m6id.16xlarge
- m6id.24xlarge
- m6id.2xlarge
- m6id.32xlarge
- m6id.4xlarge
- m6id.8xlarge
- m6id.large
- m6id.metal
- m6id.xlarge
- m6idn.12xlarge
- m6idn.16xlarge
- m6idn.24xlarge
- m6idn.2xlarge
- m6idn.32xlarge
- m6idn.4xlarge
- m6idn.8xlarge
- m6idn.large
- m6idn.metal
- m6idn.xlarge
- m6in.12xlarge
- m6in.16xlarge
- m6in.24xlarge
- m6in.2xlarge
- m6in.32xlarge
- m6in.4xlarge
- m6in.8xlarge
- m6in.large
- m6in.metal
- m6in.xlarge
- m7a.12xlarge
- m7a.16xlarge
- m7a.24xlarge
- m7a.2xlarge
- m7a.32xlarge
- m7a.48xlarge
- m7a.4xlarge
- m7a.8xlarge
- m7a.large
- m7a.medium
- m7a.metal-48xl
- m7a.xlarge
- m7g.12xlarge
- m7g.16xlarge
- m7g.2xlarge
- m7g.4xlarge
- m7g.8xlarge
- m7g.large
- m7g.medium
- m7g.metal
- m7g.xlarge
- m7gd.12xlarge
- m7gd.16xlarge
- m7gd.2xlarge
- m7gd.4xlarge
- m7gd.8xlarge
- m7gd.large
- m7gd.medium
- m7gd.metal
- m7gd.xlarge
- m7i-flex.2xlarge
- m7i-flex.4xlarge
- m7i-flex.8xlarge
- m7i-flex.large
- m7i-flex.xlarge
- m7i.12xlarge
- m7i.16xlarge
- m7i.24xlarge
- m7i.2xlarge
- m7i.48xlarge
- m7i.4xlarge
- m7i.8xlarge
- m7i.large
- m7i.metal-24xl
- m7i.metal-48xl
- m7i.xlarge
- p2.16xlarge
- p2.8xlarge
- p2.xlarge
- p3.16xlarge
- p3.2xlarge
- p3.8xlarge
- p3dn.24xlarge
- p4d.24xlarge
- p5.48xlarge
- r3.2xlarge
- r3.4xlarge
- r3.8xlarge
- r3.large
- r3.xlarge
- r4.16xlarge
- r4.2xlarge
- r4.4xlarge
- r4.8xlarge
- r4.large
- r4.xlarge
- r5.12xlarge
- r5.16xlarge
- r5.24xlarge
- r5.2xlarge
- r5.4xlarge
- r5.8xlarge
- r5.large
- r5.metal
- r5.xlarge
- r5a.12xlarge
- r5a.16xlarge
- r5a.24xlarge
- r5a.2xlarge
- r5a.4xlarge
- r5a.8xlarge
- r5a.large
- r5a.xlarge
- r5ad.12xlarge
- r5ad.16xlarge
- r5ad.24xlarge
- r5ad.2xlarge
- r5ad.4xlarge
- r5ad.8xlarge
- r5ad.large
- r5ad.xlarge
- r5b.12xlarge
- r5b.16xlarge
- r5b.24xlarge
- r5b.2xlarge
- r5b.4xlarge
- r5b.8xlarge
- r5b.large
- r5b.metal
- r5b.xlarge
- r5d.12xlarge
- r5d.16xlarge
- r5d.24xlarge
- r5d.2xlarge
- r5d.4xlarge
- r5d.8xlarge
- r5d.large
- r5d.metal
- r5d.xlarge
- r5dn.12xlarge
- r5dn.16xlarge
- r5dn.24xlarge
- r5dn.2xlarge
- r5dn.4xlarge
- r5dn.8xlarge
- r5dn.large
- r5dn.metal
- r5dn.xlarge
- r5n.12xlarge
- r5n.16xlarge
- r5n.24xlarge
- r5n.2xlarge
- r5n.4xlarge
- r5n.8xlarge
- r5n.large
- r5n.metal
- r5n.xlarge
- r6a.12xlarge
- r6a.16xlarge
- r6a.24xlarge
- r6a.2xlarge
- r6a.32xlarge
- r6a.48xlarge
- r6a.4xlarge
- r6a.8xlarge
- r6a.large
- r6a.metal
- r6a.xlarge
- r6g.12xlarge
- r6g.16xlarge
- r6g.2xlarge
- r6g.4xlarge
- r6g.8xlarge
- r6g.large
- r6g.medium
- r6g.metal
- r6g.xlarge
- r6gd.12xlarge
- r6gd.16xlarge
- r6gd.2xlarge
- r6gd.4xlarge
- r6gd.8xlarge
- r6gd.large
- r6gd.medium
- r6gd.metal
- r6gd.xlarge
- r6i.12xlarge
- r6i.16xlarge
- r6i.24xlarge
- r6i.2xlarge
- r6i.32xlarge
- r6i.4xlarge
- r6i.8xlarge
- r6i.large
- r6i.metal
- r6i.xlarge
- r6id.12xlarge
- r6id.16xlarge
- r6id.24xlarge
- r6id.2xlarge
- r6id.32xlarge
- r6id.4xlarge
- r6id.8xlarge
- r6id.large
- r6id.metal
- r6id.xlarge
- r6idn.12xlarge
- r6idn.16xlarge
- r6idn.24xlarge
- r6idn.2xlarge
- r6idn.32xlarge
- r6idn.4xlarge
- r6idn.8xlarge
- r6idn.large
- r6idn.metal
- r6idn.xlarge
- r6in.12xlarge
- r6in.16xlarge
- r6in.24xlarge
- r6in.2xlarge
- r6in.32xlarge
- r6in.4xlarge
- r6in.8xlarge
- r6in.large
- r6in.metal
- r6in.xlarge
- r7a.12xlarge
- r7a.16xlarge
- r7a.24xlarge
- r7a.2xlarge
- r7a.32xlarge
- r7a.48xlarge
- r7a.4xlarge
- r7a.8xlarge
- r7a.large
- r7a.medium
- r7a.metal-48xl
- r7a.xlarge
- r7g.12xlarge
- r7g.16xlarge
- r7g.2xlarge
- r7g.4xlarge
- r7g.8xlarge
- r7g.large
- r7g.medium
- r7g.metal
- r7g.xlarge
- r7gd.12xlarge
- r7gd.16xlarge
- r7gd.2xlarge
- r7gd.4xlarge
- r7gd.8xlarge
- r7gd.large
- r7gd.medium
- r7gd.metal
- r7gd.xlarge
- r7i.12xlarge
- r7i.16xlarge
- r7i.24xlarge
- r7i.2xlarge
- r7i.48xlarge
- r7i.4xlarge
- r7i.8xlarge
- r7i.large
- r7i.metal-24xl
- r7i.metal-48xl
- r7i.xlarge
- r7iz.12xlarge
- r7iz.16xlarge
- r7iz.2xlarge
- r7iz.32xlarge
- r7iz.4xlarge
- r7iz.8xlarge
- r7iz.large
- r7iz.metal-16xl
- r7iz.metal-32xl
- r7iz.xlarge
- r8g.12xlarge
- r8g.16xlarge
- r8g.24xlarge
- r8g.2xlarge
- r8g.48xlarge
- r8g.4xlarge
- r8g.8xlarge
- r8g.large
- r8g.medium
- r8g.metal-24xl
- r8g.metal-48xl
- r8g.xlarge
- t1.micro
- t2.2xlarge
- t2.large
- t2.medium
- t2.micro
- t2.small
- t2.xlarge
- t3.2xlarge
- t3.large
- t3.medium
- t3.micro
- t3.nano
- t3.small
- t3.xlarge
- t3a.2xlarge
- t3a.large
- t3a.medium
- t3a.micro
- t3a.nano
- t3a.small
- t3a.xlarge
- t4g.2xlarge
- t4g.large
- t4g.medium
- t4g.micro
- t4g.nano
- t4g.small
- t4g.xlarge
- trn1.2xlarge
- trn1.32xlarge
- trn1n.32xlarge
- vt1.24xlarge
- vt1.3xlarge
- vt1.6xlarge
- x1.16xlarge
- x1.32xlarge
- x1e.16xlarge
- x1e.2xlarge
- x1e.32xlarge
- x1e.4xlarge
- x1e.8xlarge
- x1e.xlarge
- x2gd.12xlarge
- x2gd.16xlarge
- x2gd.2xlarge
- x2gd.4xlarge
- x2gd.8xlarge
- x2gd.large
- x2gd.medium
- x2gd.metal
- x2gd.xlarge
- x2idn.16xlarge
- x2idn.24xlarge
- x2idn.32xlarge
- x2idn.metal
- x2iedn.16xlarge
- x2iedn.24xlarge
- x2iedn.2xlarge
- x2iedn.32xlarge
- x2iedn.4xlarge
- x2iedn.8xlarge
- x2iedn.metal
- x2iedn.xlarge
- x2iezn.12xlarge
- x2iezn.2xlarge
- x2iezn.4xlarge
- x2iezn.6xlarge
- x2iezn.8xlarge
- x2iezn.metal
- z1d.12xlarge
- z1d.2xlarge
- z1d.3xlarge
- z1d.6xlarge
- z1d.large
- z1d.metal
- z1d.xlarge

View File

@ -0,0 +1,283 @@
kubecostProductConfigs:
savingsRecommendationsAllowLists:
Azure:
- A1 v2
- A2 v2
- A2m v2
- A4 v2
- A4m v2
- A8 v2
- A8m v2
- B12ms
- B16ms
- B1ls
- B1ms
- B1s
- B20ms
- B2ms
- B2s
- B4ms
- B8ms
- D1 v2
- D11 v2
- D12 v2
- D13 v2
- D14 v2
- D15 v2
- D15i v2
- D16 v3
- D16 v4
- D16a v4
- D16as v4
- D16d v4
- D16ds v4
- D16ds v5
- D16s v3
- D16s v4
- D16s v5
- D2 v2
- D2 v3
- D2 v4
- D2a v4
- D2as v4
- D2d v4
- D2ds v4
- D2ds v5
- D2s v3
- D2s v4
- D2s v5
- D3 v2
- D32 v3
- D32 v4
- D32a v4
- D32as v4
- D32d v4
- D32ds v4
- D32ds v5
- D32s v3
- D32s v4
- D32s v5
- D4 v2
- D4 v3
- D4 v4
- D48 v3
- D48 v4
- D48a v4
- D48as v4
- D48d v4
- D48ds v4
- D48ds v5
- D48s v3
- D48s v4
- D48s v5
- D4a v4
- D4as v4
- D4d v4
- D4ds v4
- D4ds v5
- D4s v3
- D4s v4
- D4s v5
- D5 v2
- D64 v3
- D64 v4
- D64a v4
- D64as v4
- D64d v4
- D64ds v4
- D64ds v5
- D64s v3
- D64s v4
- D64s v5
- D8 v3
- D8 v4
- D8a v4
- D8as v4
- D8d v4
- D8ds v4
- D8ds v5
- D8s v3
- D8s v4
- D8s v5
- D96a v4
- D96as v4
- D96ds v5
- D96s v5
- DC1s v2
- DC2s v2
- DC4s v2
- DC8 v2
- DS1 v2
- DS11 v2
- DS12 v2
- DS13 v2
- DS14 v2
- DS15 v2
- DS15i v2
- DS2 v2
- DS3 v2
- DS4 v2
- DS5 v2
- E16 v3
- E16 v4
- E16a v4
- E16as v4
- E16d v4
- E16ds v4
- E16s v3
- E16s v4
- E2 v3
- E2 v4
- E20 v3
- E20a v4
- E20as v4
- E20d v4
- E20ds v4
- E20s v3
- E20s v4
- E2a v4
- E2as v4
- E2d v4
- E2ds v4
- E2s v3
- E2s v4
- E32 v3
- E32 v4
- E32a v4
- E32as v4
- E32d v4
- E32ds v4
- E32s v3
- E32s v4
- E4 v3
- E4 v4
- E48 v3
- E48 v4
- E48a v4
- E48as v4
- E48d v4
- E48ds v4
- E48s v3
- E48s v4
- E4a v4
- E4as v4
- E4d v4
- E4ds v4
- E4s v3
- E4s v4
- E64 v3
- E64 v4
- E64a v4
- E64as v4
- E64d v4
- E64ds v4
- E64i v3
- E64is v3
- E64s v3
- E64s v4
- E8 v3
- E8 v4
- E80ids v4
- E80is v4
- E8a v4
- E8as v4
- E8d v4
- E8ds v4
- E8s v3
- E8s v4
- E96a v4
- E96as v4
- F1
- F16
- F16s
- F16s v2
- F1s
- F2
- F2s
- F2s v2
- F32s v2
- F4
- F48s v2
- F4s
- F4s v2
- F64s v2
- F72s v2
- F8
- F8s
- F8s v2
- G1
- G2
- G3
- G4
- G5
- GS1
- GS2
- GS3
- GS4
- GS5
- H16
- H16m
- H16mr
- H16r
- H8
- H8m
- HB120rs v2
- HC44rs
- L16s
- L16s v2
- L32s
- L32s v2
- L48s v2
- L4s
- L64s v2
- L80s v2
- L8s
- L8s v2
- M128
- M128m
- M128ms
- M128s
- M16ms
- M208ms v2
- M208s v2
- M32ls
- M32ms
- M32ts
- M416ms v2
- M416s v2
- M64
- M64ls
- M64m
- M64ms
- M64s
- M8ms
- NC12
- NC12s v2
- NC12s v3
- NC16as T4 v3
- NC24
- NC24r
- NC24rs v2
- NC24rs v3
- NC24s v2
- NC24s v3
- NC4as T4 v3
- NC6
- NC64as T4 v3
- NC6s v2
- NC6s v3
- NC8as T4 v3
- ND12s
- ND24rs
- ND24s
- ND40rs v2
- ND6s
- NP10s
- NP20s
- NP40s
- NV12
- NV12s v3
- NV24
- NV24s v3
- NV48s v3
- NV6

View File

@ -0,0 +1,76 @@
kubecostProductConfigs:
savingsRecommendationsAllowLists:
GCP:
- e2-highcpu-2
- e2-highcpu-4
- e2-highcpu-8
- e2-highcpu-16
- e2-highcpu-32
- e2-highmem-2
- e2-highmem-4
- e2-highmem-8
- e2-highmem-16
- e2-micro
- e2-small
- e2-medium
- e2-standard-2
- e2-standard-4
- e2-standard-8
- e2-standard-16
- e2-standard-32
- f1-micro
- g1-small
- m1-megamem-96
- m1-ultramem-40
- m1-ultramem-80
- m1-ultramem-160
- n1-highcpu-2
- n1-highcpu-4
- n1-highcpu-8
- n1-highcpu-16
- n1-highcpu-32
- n1-highcpu-64
- n1-highcpu-96
- n1-highmem-2
- n1-highmem-4
- n1-highmem-8
- n1-highmem-16
- n1-highmem-32
- n1-highmem-64
- n1-highmem-96
- n1-megamem-96
- n1-standard-1
- n1-standard-2
- n1-standard-4
- n1-standard-8
- n1-standard-16
- n1-standard-32
- n1-standard-64
- n1-standard-96
- n1-ultramem-40
- n1-ultramem-80
- n1-ultramem-160
- n2-highcpu-2
- n2-highcpu-4
- n2-highcpu-8
- n2-highcpu-16
- n2-highcpu-32
- n2-highcpu-48
- n2-highcpu-64
- n2-highcpu-80
- n2-highmem-2
- n2-highmem-4
- n2-highmem-8
- n2-highmem-16
- n2-highmem-32
- n2-highmem-48
- n2-highmem-64
- n2-highmem-80
- n2-standard-2
- n2-standard-4
- n2-standard-8
- n2-standard-16
- n2-standard-32
- n2-standard-48
- n2-standard-64
- n2-standard-80

View File

@ -0,0 +1,29 @@
#!/bin/bash
set -eo pipefail
if [ -z "$1" ]; then
namespace=kubecost
else
namespace="$1"
fi
echo -e "\nCreating certificates ..."
mkdir certs
openssl genrsa -out certs/tls.key 2048
openssl req -new -key certs/tls.key -out certs/tls.csr -subj "/CN=webhook-server.${namespace}.svc"
openssl x509 -req -days 500 -extfile <(printf "subjectAltName=DNS:webhook-server.%s.svc" "${namespace}") -in certs/tls.csr -signkey certs/tls.key -out certs/tls.crt
echo -e "\nCreating Webhook Server TLS Secret ..."
kubectl create secret tls webhook-server-tls \
--cert "certs/tls.crt" \
--key "certs/tls.key" -n "${namespace}"
ENCODED_CA=$(base64 < certs/tls.crt | tr -d '\n')
if [ -f "../values.yaml" ]; then
echo -e "\nUpdating values.yaml ..."
sed -i '' 's@${CA_BUNDLE}@'"${ENCODED_CA}"'@g' ../values.yaml
else
echo -e "\nThe CA bundle to use in your values file is: \n${ENCODED_CA}"
fi

View File

@ -0,0 +1,28 @@
--------------------------------------------------
{{- include "kubecostV2-preconditions" . -}}
{{- include "cloudIntegrationSourceCheck" . -}}
{{- include "eksCheck" . -}}
{{- include "cloudIntegrationSecretCheck" . -}}
{{- include "gcpCloudIntegrationCheck" . -}}
{{- include "azureCloudIntegrationCheck" . -}}
{{- include "federatedStorageConfigSecretCheck" . -}}
{{- include "federatedStorageSourceCheck" . -}}
{{- include "prometheusRetentionCheck" . -}}
{{- include "clusterIDCheck" . -}}
{{- $servicePort := .Values.service.port | default 9090 }}
Kubecost {{ .Chart.Version }} has been successfully installed.
Kubecost 2.x is a major upgrade from previous versions and includes major new features including a brand new API Backend. Please review the following documentation to ensure a smooth transition: https://docs.kubecost.com/install-and-configure/install/kubecostv2
When pods are Ready, you can enable port-forwarding with the following command:
kubectl port-forward --namespace {{ .Release.Namespace }} deployment/{{ template "cost-analyzer.fullname" . }} {{ $servicePort }}
Then, navigate to http://localhost:{{ $servicePort }} in a web browser.
Please allow 25 minutes for Kubecost to gather metrics. A progress indicator will appear at the top of the UI.
Having installation issues? View our Troubleshooting Guide at http://docs.kubecost.com/troubleshoot-install
{{- include "kubecostV2-3-notices" . -}}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,166 @@
{{- if eq (include "aggregator.deployMethod" .) "statefulset" }}
{{/*
A cloud integration secret is required for cloud cost to function as a dedicated pod.
UI based configuration is not supported for cloud cost with aggregator.
*/}}
{{- if ((.Values.kubecostAggregator).cloudCost).enabled }}
{{- if not ( or (.Values.kubecostProductConfigs).cloudIntegrationSecret (.Values.kubecostProductConfigs).cloudIntegrationJSON ((.Values.kubecostProductConfigs).athenaBucketName)) }}
{{- fail "\n\nA cloud-integration secret is required when using the aggregator statefulset and cloudCost is enabled." }}
{{- end }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "cloudCost.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cloudCost.commonLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
selector:
matchLabels:
{{ include "cloudCost.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
app.kubernetes.io/name: cloud-cost
app.kubernetes.io/instance: {{ .Release.Name }}
app: cloud-cost
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- with .Values.global.podAnnotations}}
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/configs: {{ include "configsChecksum" . }}
spec:
{{- if .Values.global.platforms.openshift.enabled }}
securityContext:
{{- toYaml .Values.global.platforms.openshift.securityContext | nindent 8 }}
{{- else if .Values.global.securityContext }}
securityContext:
{{- toYaml .Values.global.securityContext | nindent 8 }}
{{- else }}
securityContext:
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
{{- end }}
restartPolicy: Always
serviceAccountName: {{ template "cloudCost.serviceAccountName" . }}
volumes:
{{- if .Values.kubecostModel.etlBucketConfigSecret }}
- name: etl-bucket-config
secret:
defaultMode: 420
secretName: {{ .Values.kubecostModel.etlBucketConfigSecret }}
{{- end }}
{{- if or .Values.kubecostModel.federatedStorageConfigSecret .Values.kubecostModel.federatedStorageConfig }}
- name: federated-storage-config
secret:
defaultMode: 420
{{- if .Values.kubecostModel.federatedStorageConfigSecret }}
secretName: {{ .Values.kubecostModel.federatedStorageConfigSecret }}
{{- else }}
secretName: federated-store
{{- end }}
{{- end }}
{{- if (.Values.kubecostProductConfigs).cloudIntegrationSecret }}
- name: cloud-integration
secret:
secretName: {{ .Values.kubecostProductConfigs.cloudIntegrationSecret }}
items:
- key: cloud-integration.json
path: cloud-integration.json
{{- else if or (.Values.kubecostProductConfigs).cloudIntegrationJSON ((.Values.kubecostProductConfigs).athenaProjectID) }}
- name: cloud-integration
secret:
secretName: cloud-integration
items:
- key: cloud-integration.json
path: cloud-integration.json
{{- end }}
{{/* Despite the name, this is not persistent-configs.
The name is for compatibility with single-pod install.
All data stored here is ephemeral, and does not require persistence. */}}
- name: persistent-configs
emptyDir: {}
{{- if .Values.kubecostModel.plugins.enabled }}
{{- if .Values.kubecostModel.plugins.install.enabled}}
- name: install-script
configMap:
name: {{ template "cost-analyzer.fullname" . }}-install-plugins
{{- end }}
- name: plugins-dir
emptyDir: {}
{{- if and (not .Values.kubecostModel.plugins.existingCustomSecret.enabled) .Values.kubecostModel.plugins.secretName }}
- name: plugins-config
secret:
secretName: {{ .Values.kubecostModel.plugins.secretName }}
items:
- key: datadog_config.json
path: datadog_config.json
{{- end }}
{{- if .Values.kubecostModel.plugins.existingCustomSecret.enabled }}
- name: plugins-config
secret:
secretName: {{ .Values.kubecostModel.plugins.existingCustomSecret.name }}
items:
- key: datadog_config.json
path: datadog_config.json
{{- end }}
- name: tmp
emptyDir: {}
{{- end }}
{{- if .Values.kubecostAggregator.cloudCost.extraVolumes }}
{{- toYaml .Values.kubecostAggregator.cloudCost.extraVolumes | nindent 8 }}
{{- end }}
initContainers:
{{- if (and .Values.kubecostModel.plugins.enabled .Values.kubecostModel.plugins.install.enabled )}}
- name: plugin-installer
image: {{ .Values.kubecostModel.plugins.install.fullImageName }}
command: ["sh", "/install/install_plugins.sh"]
{{- with .Values.kubecostModel.plugins.install.securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: install-script
mountPath: /install
- name: plugins-dir
mountPath: {{ .Values.kubecostModel.plugins.folder }}
{{- end }}
containers:
{{- include "aggregator.cloudCost.containerTemplate" . | nindent 8 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.kubecostAggregator.priority }}
{{- if .Values.kubecostAggregator.priority.enabled }}
{{- if .Values.kubecostAggregator.priority.name }}
priorityClassName: {{ .Values.kubecostAggregator.priority.name }}
{{- else }}
priorityClassName: {{ template "cost-analyzer.fullname" . }}-aggregator-priority
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.kubecostAggregator.cloudCost.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubecostAggregator.cloudCost.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubecostAggregator.cloudCost.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,23 @@
{{- if eq (include "aggregator.deployMethod" .) "statefulset" }}
{{/*
A cloud integration secret is required for cloud cost to function as a dedicated pod.
UI based configuration is not supported for cloud cost with aggregator.
*/}}
{{- if or (.Values.kubecostProductConfigs).cloudIntegrationSecret (.Values.kubecostProductConfigs).cloudIntegrationJSON ((.Values.kubecostProductConfigs).athenaBucketName) }}
{{- if and .Values.serviceAccount.create .Values.kubecostAggregator.cloudCost.serviceAccountName }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "cloudCost.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cloudCost.commonLabels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,17 @@
{{- if not (eq (include "aggregator.deployMethod" .) "disabled") -}}
kind: Service
apiVersion: v1
metadata:
name: {{ template "cloudCost.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cloudCost.commonLabels" . | nindent 4 }}
spec:
selector:
{{ include "cloudCost.selectorLabels" . | nindent 4 }}
type: "ClusterIP"
ports:
- name: tcp-api
port: 9005
targetPort: 9005
{{- end }}

View File

@ -0,0 +1,28 @@
{{- if not (eq (include "aggregator.deployMethod" .) "disabled") -}}
kind: Service
apiVersion: v1
metadata:
name: {{ template "aggregator.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "aggregator.commonLabels" . | nindent 4 }}
{{- if .Values.kubecostAggregator.service.labels }}
{{- toYaml .Values.kubecostAggregator.service.labels | nindent 4 }}
{{- end }}
spec:
selector:
{{ include "aggregator.selectorLabels" . | nindent 4 }}
type: "ClusterIP"
ports:
- name: tcp-api
port: 9004
targetPort: 9004
{{- if or .Values.saml.enabled .Values.oidc.enabled}}
- name: apiserver
port: 9008
targetPort: 9008
{{- end }}
{{- with .Values.kubecostAggregator.extraPorts }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,31 @@
{{- if .Values.serviceMonitor.aggregatorMetrics.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "aggregator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "aggregator.commonLabels" . | nindent 4 }}
{{- if .Values.serviceMonitor.aggregatorMetrics.additionalLabels }}
{{ toYaml .Values.serviceMonitor.aggregatorMetrics.additionalLabels | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: tcp-api
interval: {{ .Values.serviceMonitor.aggregatorMetrics.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.aggregatorMetrics.scrapeTimeout }}
path: /metrics
scheme: http
{{- with .Values.serviceMonitor.aggregatorMetrics.metricRelabelings }}
metricRelabelings: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.aggregatorMetrics.relabelings }}
relabelings: {{ toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "aggregator.commonLabels" . | nindent 6 }}
{{- end }}

View File

@ -0,0 +1,208 @@
{{- if and (not .Values.agent) (not .Values.cloudAgent) }}
{{- if eq (include "aggregator.deployMethod" .) "statefulset" }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "aggregator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "aggregator.commonLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.kubecostAggregator.replicas }}
serviceName: {{ template "aggregator.serviceName" . }}
selector:
matchLabels:
{{- include "aggregator.selectorLabels" . | nindent 6 }}
volumeClaimTemplates:
- metadata:
name: aggregator-db-storage
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.kubecostAggregator.aggregatorDbStorage.storageClass }}
resources:
requests:
storage: {{ .Values.kubecostAggregator.aggregatorDbStorage.storageRequest }}
- metadata:
# In the StatefulSet config, Aggregator should not share any filesystem
# state with the cost-model to maintain independence and improve
# stability (in the event of bad file-locking state). Still, there is
# a need to "mount" ConfigMap files (using the watcher) to a file system;
# that's what this per-replica Volume is used for.
name: persistent-configs
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.kubecostAggregator.persistentConfigsStorage.storageClass }}
resources:
requests:
storage: {{ .Values.kubecostAggregator.persistentConfigsStorage.storageRequest }}
template:
metadata:
labels:
app.kubernetes.io/name: aggregator
app.kubernetes.io/instance: {{ .Release.Name }}
app: aggregator
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- with .Values.global.podAnnotations}}
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/configs: {{ include "configsChecksum" . }}
spec:
restartPolicy: Always
{{- if .Values.kubecostAggregator.securityContext }}
securityContext:
{{- toYaml .Values.kubecostAggregator.securityContext | nindent 8 }}
{{- else if and (.Values.global.platforms.openshift.enabled) (.Values.global.platforms.openshift.securityContext) }}
securityContext:
{{- toYaml .Values.global.platforms.openshift.securityContext | nindent 8 }}
{{- else if .Values.global.securityContext }}
securityContext:
{{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "aggregator.serviceAccountName" . }}
volumes:
- name: aggregator-staging
emptyDir:
sizeLimit: {{ .Values.kubecostAggregator.stagingEmptyDirSizeLimit }}
{{- $etlBackupBucketSecret := "" }}
{{- if .Values.kubecostModel.federatedStorageConfigSecret }}
{{- $etlBackupBucketSecret = .Values.kubecostModel.federatedStorageConfigSecret }}
{{- end }}
{{- if or $etlBackupBucketSecret .Values.kubecostModel.federatedStorageConfig }}
{{- if or .Values.kubecostModel.federatedStorageConfigSecret .Values.kubecostModel.federatedStorageConfig }}
- name: federated-storage-config
secret:
defaultMode: 420
{{- if .Values.kubecostModel.federatedStorageConfigSecret }}
secretName: {{ .Values.kubecostModel.federatedStorageConfigSecret }}
{{- else }}
secretName: federated-store
{{- end }}
{{- end }}
- name: etl-bucket-config
secret:
defaultMode: 420
secretName: {{ $etlBackupBucketSecret | default "federated-store" }}
{{- else }}
{{- fail "\n\nKubecost Aggregator Enterprise Config requires either .Values.kubecostModel.federatedStorageConfigSecret or .Values.kubecostModel.federatedStorageConfig" }}
{{- end }}
{{- if and ((.Values.kubecostProductConfigs).productKey).enabled ((.Values.kubecostProductConfigs).productKey).secretname }}
- name: productkey-secret
secret:
secretName: {{ .Values.kubecostProductConfigs.productKey.secretname }}
items:
- key: productkey.json
path: productkey.json
{{- end }}
{{- if ((.Values.kubecostProductConfigs).smtp).secretname }}
- name: smtp-secret
secret:
secretName: {{ .Values.kubecostProductConfigs.smtp.secretname }}
items:
- key: smtp.json
path: smtp.json
{{- end }}
{{- if .Values.saml }}
{{- if .Values.saml.enabled }}
{{- if .Values.saml.secretName }}
- name: secret-volume
secret:
secretName: {{ .Values.saml.secretName }}
{{- end }}
{{- if .Values.saml.encryptionCertSecret }}
- name: saml-encryption-cert
secret:
secretName: {{ .Values.saml.encryptionCertSecret }}
{{- end }}
{{- if .Values.saml.decryptionKeySecret }}
- name: saml-decryption-key
secret:
secretName: {{ .Values.saml.decryptionKeySecret }}
{{- end }}
{{- if .Values.saml.metadataSecretName }}
- name: metadata-secret-volume
secret:
secretName: {{ .Values.saml.metadataSecretName }}
{{- end }}
- name: saml-auth-secret
secret:
secretName: {{ .Values.saml.authSecretName | default "kubecost-saml-secret" }}
{{- if .Values.saml.rbac.enabled }}
- name: saml-roles
configMap:
name: {{ template "cost-analyzer.fullname" . }}-saml
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.oidc }}
{{- if .Values.oidc.enabled }}
- name: oidc-config
configMap:
name: {{ template "cost-analyzer.fullname" . }}-oidc
{{- if and (not .Values.oidc.existingCustomSecret.enabled) .Values.oidc.secretName }}
- name: oidc-client-secret
secret:
secretName: {{ .Values.oidc.secretName }}
{{- end }}
{{- if .Values.oidc.existingCustomSecret.enabled }}
- name: oidc-client-secret
secret:
secretName: {{ .Values.oidc.existingCustomSecret.name }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.global.integrations.postgres.enabled }}
- name: postgres-creds
secret:
{{- if not (eq .Values.global.integrations.postgres.databaseSecretName "") }}
secretName: {{ .Values.global.integrations.postgres.databaseSecretName }}
{{- else }}
secretName: kubecost-integrations-postgres
{{- end }}
- name: postgres-queries
configMap:
name: kubecost-integrations-postgres-queries
{{- end }}
{{- if .Values.kubecostAggregator.extraVolumes }}
{{- toYaml .Values.kubecostAggregator.extraVolumes | nindent 8 }}
{{- end }}
containers:
{{- include "aggregator.containerTemplate" . | nindent 8 }}
{{- if .Values.kubecostAggregator.jaeger.enabled }}
{{ include "aggregator.jaeger.sidecarContainerTemplate" . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.kubecostAggregator.priority }}
{{- if .Values.kubecostAggregator.priority.enabled }}
{{- if .Values.kubecostAggregator.priority.name }}
priorityClassName: {{ .Values.kubecostAggregator.priority.name }}
{{- else }}
priorityClassName: {{ template "cost-analyzer.fullname" . }}-aggregator-priority
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.kubecostAggregator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubecostAggregator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubecostAggregator.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,20 @@
{{- if .Values.kubecostProductConfigs }}
{{- if .Values.kubecostProductConfigs.createServiceKeySecret }}
{{- if .Values.kubecostProductConfigs.alibabaServiceKeyName }}
apiVersion: v1
kind: Secret
metadata:
name: cloud-service-key
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
type: Opaque
stringData:
service-key.json: |-
{
"alibaba_access_key_id": "{{ .Values.kubecostProductConfigs.alibabaServiceKeyName }}",
"alibaba_secret_access_key": "{{ .Values.kubecostProductConfigs.alibabaServiceKeyPassword }}"
}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,20 @@
{{- if .Values.kubecostProductConfigs }}
{{- if .Values.kubecostProductConfigs.createServiceKeySecret }}
{{- if .Values.kubecostProductConfigs.awsServiceKeyName }}
apiVersion: v1
kind: Secret
metadata:
name: cloud-service-key
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
type: Opaque
stringData:
service-key.json: |-
{
"aws_access_key_id": "{{ .Values.kubecostProductConfigs.awsServiceKeyName }}",
"aws_secret_access_key": "{{ .Values.kubecostProductConfigs.awsServiceKeyPassword }}"
}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,49 @@
{{- if .Values.awsstore }}
{{- if .Values.awsstore.useAwsStore }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "cost-analyzer.fullname" . }}-awsstore
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app: awsstore
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: awsstore
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podAnnotations}}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: awsstore-serviceaccount
{{- if .Values.awsstore.priorityClassName }}
priorityClassName: "{{ .Values.awsstore.priorityClassName }}"
{{- end }}
{{- with .Values.awsstore.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- image: {{ .Values.awsstore.imageNameAndVersion }}
name: awsstore
# Just sleep forever
command: [ "sleep" ]
args: [ "infinity" ]
{{- end }}
{{- end }}

View File

@ -0,0 +1,15 @@
{{- if .Values.awsstore }}
{{- if .Values.awsstore.createServiceAccount }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: awsstore-serviceaccount
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.awsstore.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,24 @@
{{- if .Values.kubecostProductConfigs }}
{{- if .Values.kubecostProductConfigs.createServiceKeySecret }}
{{- if .Values.kubecostProductConfigs.azureSubscriptionID }}
apiVersion: v1
kind: Secret
metadata:
name: cloud-service-key
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
type: Opaque
stringData:
service-key.json: |-
{
"subscriptionId": "{{ .Values.kubecostProductConfigs.azureSubscriptionID }}",
"serviceKey": {
"appId": "{{ .Values.kubecostProductConfigs.azureClientID }}",
"password": "{{ .Values.kubecostProductConfigs.azureClientPassword }}",
"tenant": "{{ .Values.kubecostProductConfigs.azureTenantID }}"
}
}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,26 @@
{{/*This method of configuration is deprecated*/}}
{{- if .Values.kubecostProductConfigs }}
{{- if .Values.kubecostProductConfigs.azureStorageCreateSecret }}
{{- if .Values.kubecostProductConfigs.azureStorageAccessKey }}
{{- if .Values.kubecostProductConfigs.azureStorageAccount }}
{{- if .Values.kubecostProductConfigs.azureStorageContainer }}
apiVersion: v1
kind: Secret
metadata:
name: azure-storage-config
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
type: Opaque
stringData:
azure-storage-config.json: |-
{
"azureStorageAccount": "{{ .Values.kubecostProductConfigs.azureStorageAccount }}",
"azureStorageAccessKey": "{{ .Values.kubecostProductConfigs.azureStorageAccessKey }}",
"azureStorageContainer": "{{ .Values.kubecostProductConfigs.azureStorageContainer }}"
}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,16 @@
{{- if or ((.Values.kubecostProductConfigs).cloudIntegrationJSON) ((.Values.kubecostProductConfigs).athenaBucketName) }}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: cloud-integration
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- if (.Values.kubecostProductConfigs).cloudIntegrationJSON }}
cloud-integration.json: {{ .Values.kubecostProductConfigs.cloudIntegrationJSON | replace "\n" "" | b64enc }}
{{- else }}
cloud-integration.json: {{ include "cloudIntegrationFromProductConfigs" . |nindent 4| replace "\n" "" | b64enc }}
{{- end }}
{{- end -}}

View File

@ -0,0 +1,12 @@
{{- if .Values.kubecostProductConfigs }}
{{- if .Values.kubecostProductConfigs.cloudAccountMapping }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "account-mapping"
namespace: {{ .Release.Namespace }}
labels: {{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
account-map.json: '{{ toJson .Values.kubecostProductConfigs.cloudAccountMapping }}'
{{- end }}
{{- end }}

View File

@ -0,0 +1,10 @@
{{- if .Values.global.notifications.alertConfigs }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "alert-configs" .Values.alertConfigmapName }}
namespace: {{ .Release.Namespace }}
labels: {{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
alerts.json: '{{ toJson .Values.global.notifications.alertConfigs }}'
{{- end -}}

View File

@ -0,0 +1,14 @@
{{- if .Values.global.assetReports }}
{{- if .Values.global.assetReports.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "asset-report-configs" .Values.assetReportConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
asset-reports.json: '{{ toJson .Values.global.assetReports.reports }}'
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,13 @@
{{- if .Values.global.cloudCostReports }}
{{- if .Values.global.cloudCostReports.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{default "cloud-cost-report-configs" .Values.cloudCostReportConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
cloud-cost-reports.json: '{{ toJson .Values.global.cloudCostReports.reports }}'
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,36 @@
{{- if .Values.reporting }}
{{- if .Values.reporting.logCollection }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "cost-analyzer.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "cost-analyzer.serviceAccountName" . }}
subjects:
- kind: ServiceAccount
name: {{ template "cost-analyzer.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
{{- end }}
{{- end }}
{{- if (not .Values.kubecostModel.etlReadOnlyMode) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "cost-analyzer.serviceAccountName" . }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "cost-analyzer.serviceAccountName" . }}
subjects:
- kind: ServiceAccount
name: {{ template "cost-analyzer.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@ -0,0 +1,26 @@
{{- if (.Values.kubecostModel.etlReadOnlyMode) }}
{{- if and .Values.reporting .Values.reporting.logCollection -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: {{ .Release.Namespace }}
name: {{ template "cost-analyzer.serviceAccountName" . }}
rules:
- apiGroups:
- ''
resources:
- "pods/log"
verbs:
- get
- list
- watch
- apiGroups:
- ''
resources:
- configmaps
verbs:
- get
- list
- watch
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,108 @@
{{- if not .Values.kubecostModel.etlReadOnlyMode -}}
{{- if and .Values.reporting .Values.reporting.logCollection -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: {{ .Release.Namespace }}
name: {{ template "cost-analyzer.serviceAccountName" . }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
rules:
- apiGroups:
- ''
resources:
- "pods/log"
verbs:
- get
- list
- watch
- apiGroups:
- ''
resources:
- configmaps
verbs:
- get
- list
- watch
- update
---
{{- end }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "cost-analyzer.serviceAccountName" . }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
rules:
- apiGroups:
- ''
resources:
- configmaps
- nodes
- pods
- events
- services
- resourcequotas
- replicationcontrollers
- limitranges
- persistentvolumeclaims
- persistentvolumes
- namespaces
- endpoints
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
- deployments
- daemonsets
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- list
- watch
- apiGroups:
- events.k8s.io
resources:
- events
verbs:
- get
- list
- watch
{{- end }}

View File

@ -0,0 +1,37 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "cost-analyzer.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- if .Values.global.prometheus.enabled }}
{{- if .Values.global.zone }}
prometheus-alertmanager-endpoint: http://{{ template "cost-analyzer.prometheus.alertmanager.name" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.zone }}
{{ else }}
prometheus-alertmanager-endpoint: http://{{ template "cost-analyzer.prometheus.alertmanager.name" . }}.{{ .Release.Namespace }}
{{- end -}}
{{ else }}
prometheus-alertmanager-endpoint: {{ .Values.global.notifications.alertmanager.fqdn }}
{{- end -}}
{{ if .Values.global.gmp.enabled }}
prometheus-server-endpoint: {{ .Values.global.gmp.prometheusServerEndpoint }}
{{- else if .Values.global.amp.enabled }}
prometheus-server-endpoint: {{ .Values.global.amp.prometheusServerEndpoint }}
{{- else if .Values.global.ammsp.enabled }}
prometheus-server-endpoint: {{ .Values.global.ammsp.prometheusServerEndpoint }}
{{- else if .Values.global.prometheus.enabled }}
{{- if .Values.global.zone }}
prometheus-server-endpoint: http://{{ template "cost-analyzer.prometheus.server.name" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.zone }}
{{ else }}
prometheus-server-endpoint: http://{{ template "cost-analyzer.prometheus.server.name" . }}.{{ .Release.Namespace }}
{{- end -}}
{{ else }}
prometheus-server-endpoint: {{ .Values.global.prometheus.fqdn }}
{{- end -}}
{{- if .Values.kubecostToken }}
kubecost-token: {{ .Values.kubecostToken }}
{{ else }}
kubecost-token: not-applied
{{- end -}}

View File

@ -0,0 +1,35 @@
{{- if .Values.persistentVolume -}}
{{- if not .Values.persistentVolume.dbExistingClaim -}}
{{- if .Values.persistentVolume.enabled -}}
{{- if .Values.persistentVolume.dbPVEnabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "cost-analyzer.fullname" . }}-db
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.persistentVolume.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.persistentVolume.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.persistentVolume.dbStorageClass }}
storageClassName: {{ .Values.persistentVolume.dbStorageClass }}
{{ end }}
resources:
requests:
{{- if .Values.persistentVolume }}
storage: {{ .Values.persistentVolume.dbSize }}
{{- else }}
storage: 32.0Gi
{{ end }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,14 @@
{{- if eq (include "aggregator.deployMethod" .) "statefulset" }}
{{- if (.Values.kubecostProductConfigs).standardDiscount }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "ingestion-configs" .Values.ingestionConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
standardDiscount: "{{ .Values.kubecostProductConfigs.standardDiscount }}"
helmConfig: "true"
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,56 @@
{{- if .Values.ingress -}}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "cost-analyzer.fullname" . -}}
{{- $serviceName := "" -}}
{{- if eq (include "frontend.deployMethod" .) "haMode" }}
{{- $serviceName = include "frontend.serviceName" . }}
{{- else }}
{{- $serviceName = include "cost-analyzer.serviceName" . -}}
{{- end }}
{{- $ingressPaths := .Values.ingress.paths -}}
{{- $ingressPathType := .Values.ingress.pathType -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
{{- range $ingressPaths }}
- path: {{ . }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
name: tcp-frontend
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,13 @@
{{- if .Values.kubecostProductConfigs -}}
{{- if .Values.kubecostProductConfigs.metricsConfigs -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "metrics-config" .Values.metricsConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
metrics.json: '{{ toJson .Values.kubecostProductConfigs.metricsConfigs }}'
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,16 @@
{{- if .Values.networkCosts -}}
{{- if .Values.networkCosts.enabled -}}
{{- if .Values.networkCosts.config -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: network-costs-config
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
config.yaml: |
{{- toYaml .Values.networkCosts.config | nindent 4 }}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,32 @@
{{- if .Values.networkCosts }}
{{- if .Values.networkCosts.enabled }}
{{- if .Values.networkCosts.podMonitor }}
{{- if .Values.networkCosts.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "cost-analyzer.networkCostsName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if .Values.networkCosts.podMonitor.additionalLabels }}
{{ toYaml .Values.networkCosts.podMonitor.additionalLabels | nindent 4 }}
{{- end }}
spec:
podMetricsEndpoints:
- port: http-server
honorLabels: true
interval: 1m
scrapeTimeout: 10s
path: /metrics
scheme: http
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: {{ template "cost-analyzer.networkCostsName" . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,34 @@
{{- if .Values.networkCosts }}
{{- if .Values.networkCosts.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "cost-analyzer.networkCostsName" . }}
namespace: {{ .Release.Namespace }}
{{- if (or .Values.networkCosts.service.annotations .Values.networkCosts.prometheusScrape) }}
annotations:
{{- if .Values.networkCosts.service.annotations }}
{{ toYaml .Values.networkCosts.service.annotations | indent 4 }}
{{- end }}
{{- if .Values.networkCosts.prometheusScrape }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ (quote .Values.networkCosts.port) | default (quote 3001) }}
{{- end }}
{{- end }}
labels:
{{- include "networkcosts.commonLabels" . | nindent 4 }}
{{- if .Values.networkCosts.service.labels }}
{{ toYaml .Values.networkCosts.service.labels | nindent 4 }}
{{- end }}
spec:
clusterIP: None
ports:
- name: metrics
port: {{ .Values.networkCosts.port | default 3001 }}
protocol: TCP
targetPort: {{ .Values.networkCosts.port | default 3001 }}
selector:
{{- include "networkcosts.selectorLabels" . | nindent 4 }}
type: ClusterIP
{{- end }}
{{- end }}

View File

@ -0,0 +1,149 @@
{{- if .Values.networkCosts -}}
{{- if .Values.networkCosts.enabled -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "cost-analyzer.networkCostsName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "networkcosts.commonLabels" . | nindent 4 }}
{{- if .Values.networkCosts.additionalLabels }}
{{- toYaml .Values.networkCosts.additionalLabels | nindent 4 }}
{{- end }}
spec:
{{- if .Values.networkCosts.updateStrategy }}
updateStrategy:
{{- toYaml .Values.networkCosts.updateStrategy | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "networkcosts.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.networkCosts.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "networkcosts.commonLabels" . | nindent 8 }}
{{- if .Values.networkCosts.additionalLabels }}
{{- toYaml .Values.networkCosts.additionalLabels | nindent 8 }}
{{- end }}
spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
hostNetwork: true
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
containers:
- name: {{ template "cost-analyzer.networkCostsName" . }}
{{- if eq (typeOf .Values.networkCosts.image) "string" }}
image: {{ .Values.networkCosts.image }}
{{- else }}
image: {{ .Values.networkCosts.image.repository }}:{{ .Values.networkCosts.image.tag }}
{{- end}}
{{- if .Values.networkCosts.extraArgs }}
args:
{{- toYaml .Values.networkCosts.extraArgs | nindent 8 }}
{{- end }}
{{- if .Values.networkCosts.imagePullPolicy }}
imagePullPolicy: {{ .Values.networkCosts.imagePullPolicy }}
{{- else }}
imagePullPolicy: Always
{{- end }}
{{- if .Values.networkCosts.resources }}
resources: {{- toYaml .Values.networkCosts.resources | nindent 10 }}
{{- end }}
env:
{{- if .Values.networkCosts.hostProc }}
- name: HOST_PROC
value: {{ .Values.networkCosts.hostProc.mountPath }}
{{- end }}
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HOST_PORT
value: {{ (quote .Values.networkCosts.port) | default (quote 3001) }}
- name: TRAFFIC_LOGGING_ENABLED
value: {{ (quote .Values.networkCosts.trafficLogging) | default (quote true) }}
- name: LOG_LEVEL
value: {{ .Values.networkCosts.logLevel | default "info" }}
{{- if .Values.networkCosts.softMemoryLimit }}
- name: GOMEMLIMIT
value: {{ .Values.networkCosts.softMemoryLimit }}
{{- end }}
{{- if .Values.networkCosts.heapMonitor }}
{{- if .Values.networkCosts.heapMonitor.enabled }}
- name: HEAP_MONITOR_ENABLED
value: "true"
- name: HEAP_MONITOR_THRESHOLD
value: {{ .Values.networkCosts.heapMonitor.threshold }}
{{- if .Values.networkCosts.heapMonitor.outFile }}
- name: HEAP_MONITOR_OUTPUT
value: {{ .Values.networkCosts.heapMonitor.outFile }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.networkCosts.healthCheckProbes }}
{{- toYaml .Values.networkCosts.healthCheckProbes | nindent 8 }}
{{- end }}
volumeMounts:
{{- if .Values.networkCosts.hostProc }}
- mountPath: {{ .Values.networkCosts.hostProc.mountPath }}
name: host-proc
{{- else }}
- mountPath: /net
name: nf-conntrack
- mountPath: /netfilter
name: netfilter
{{- end }}
{{- if .Values.networkCosts.config }}
- mountPath: /network-costs/config
name: network-costs-config
{{- end }}
securityContext:
privileged: true
{{- if .Values.networkCosts.additionalSecurityContext }}
{{- toYaml .Values.networkCosts.additionalSecurityContext | nindent 10 }}
{{- end }}
ports:
- name: http-server
containerPort: {{ .Values.networkCosts.port | default 3001 }}
hostPort: {{ .Values.networkCosts.port | default 3001 }}
{{- if .Values.networkCosts.priorityClassName }}
priorityClassName: "{{ .Values.networkCosts.priorityClassName }}"
{{- end }}
{{- with .Values.networkCosts.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.networkCosts.tolerations }}
tolerations:
{{ toYaml .Values.networkCosts.tolerations | indent 8 }}
{{- end }}
{{- with .Values.networkCosts.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.networkCosts.config }}
- name: network-costs-config
configMap:
name: network-costs-config
{{- end }}
{{- if .Values.networkCosts.hostProc }}
- name: host-proc
hostPath:
path: {{ default "/proc" .Values.networkCosts.hostProc.hostPath }}
{{- else }}
- name: nf-conntrack
hostPath:
path: /proc/net
- name: netfilter
hostPath:
path: /proc/sys/net/netfilter
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,47 @@
{{- if .Values.networkPolicy -}}
{{- if .Values.networkPolicy.costAnalyzer.enabled -}}
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ template "cost-analyzer.fullname" . }}
{{- if .Values.networkPolicy.costAnalyzer.annotations }}
annotations:
{{ toYaml .Values.networkPolicy.costAnalyzer.annotations | indent 4}}
{{- end }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if .Values.networkPolicy.costAnalyzer.additionalLabels }}
{{ toYaml .Values.networkPolicy.costAnalyzer.additionalLabels | indent 4 }}
{{- end }}
spec:
podSelector:
matchLabels:
{{- include "cost-analyzer.selectorLabels" . | nindent 6 }}
policyTypes:
{{- if .Values.networkPolicy.costAnalyzer.ingressRules }}
- Ingress
{{- end }}
{{- if .Values.networkPolicy.costAnalyzer.egressRules }}
- Egress
{{- end }}
{{- if .Values.networkPolicy.costAnalyzer.egressRules }}
egress:
{{- range $rule := .Values.networkPolicy.costAnalyzer.egressRules }}
- to:
{{ toYaml $rule.selectors | indent 7 }}
ports:
{{ toYaml $rule.ports | indent 9 }}
{{- end }}
{{- end }}
{{- if .Values.networkPolicy.costAnalyzer.ingressRules }}
ingress:
{{- range $rule := .Values.networkPolicy.costAnalyzer.ingressRules }}
- from:
{{ toYaml $rule.selectors | indent 7 }}
ports:
{{ toYaml $rule.ports | indent 9 }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,48 @@
{{- if .Values.networkPolicy -}}
{{- if .Values.networkPolicy.enabled -}}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
{{- if .Values.networkPolicy.denyEgress }}
metadata:
name: deny-egress
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "cost-analyzer.selectorLabels" . | nindent 6 }}
policyTypes:
- Egress
{{- else }}
{{- if .Values.networkPolicy.sameNamespace}}
metadata:
name: shared-namespace
namespace: {{ default "kubecost" .Values.networkPolicy.namespace}}
spec:
podSelector:
matchLabels:
app: prometheus
component: server
{{- else }}
metadata:
name: closed-traffic
namespace: {{ default "kubecost" .Values.networkPolicy.namespace}}
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: cost-analyzer
{{- end }}
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: cost-analyzer
- namespaceSelector:
matchLabels:
name: k8s-kubecost
{{- end }}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,30 @@
{{- if and (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") (.Values.global.platforms.openshift.scc.networkCosts) (.Values.networkCosts.enabled) }}
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: {{ template "cost-analyzer.networkCostsName" . }}
priority: 10
allowPrivilegedContainer: true
allowHostDirVolumePlugin: true
allowHostNetwork: true
allowHostPorts: true
allowHostPID: false
allowHostIPC: false
readOnlyRootFilesystem: false
runAsUser:
type: RunAsAny
fsGroup:
type: RunAsAny
seLinuxContext:
type: RunAsAny
supplementalGroups:
type: RunAsAny
seccompProfiles:
- runtime/default
volumes:
- hostPath
- projected
- configMap
users:
- system:serviceaccount:{{ .Release.Namespace }}:{{ template "cost-analyzer.serviceAccountName" . }}
{{- end }}

View File

@ -0,0 +1,25 @@
{{- if and (.Capabilities.APIVersions.Has "route.openshift.io/v1/Route") (.Values.global.platforms.openshift.enabled) (.Values.global.platforms.openshift.route.enabled) }}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ template "cost-analyzer.fullname" . }}-route
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.global.platforms.openshift.route.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.global.platforms.openshift.route.host }}
host: "{{ .Values.global.platforms.openshift.route.host }}"
{{- end }}
port:
targetPort: tcp-frontend
tls:
termination: edge
to:
kind: Service
name: {{ template "cost-analyzer.serviceName" . }}
weight: 100
wildcardPolicy: None
{{- end }}

View File

@ -0,0 +1,49 @@
{{- if .Values.oidc }}
{{- if .Values.oidc.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "cost-analyzer.fullname" . }}-oidc
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- $root := . }}
oidc.json: |-
{
"enabled" : {{ .Values.oidc.enabled }},
"useIDToken" : {{ .Values.oidc.useIDToken | default "false" }},
"clientID" : "{{ .Values.oidc.clientID }}",
{{- if .Values.oidc.existingCustomSecret.enabled }}
"secretName" : "{{ .Values.oidc.existingCustomSecret.name }}",
{{- else }}
"secretName" : "{{ .Values.oidc.secretName }}",
{{- end }}
"authURL" : "{{ .Values.oidc.authURL }}",
"loginRedirectURL" : "{{ .Values.oidc.loginRedirectURL }}",
"discoveryURL" : "{{ .Values.oidc.discoveryURL }}",
"hostedDomain" : "{{ .Values.oidc.hostedDomain }}",
"skipOnlineTokenValidation" : "{{ .Values.oidc.skipOnlineTokenValidation | default "false" }}",
"useClientSecretPost": {{ .Values.oidc.useClientSecretPost }},
"rbac" : {
"enabled" : {{ .Values.oidc.rbac.enabled }},
"groups" : [
{{- range $i, $g := .Values.oidc.rbac.groups }}
{{- if ne $i 0 }},{{- end }}
{
"roleName": "{{ $g.name }}",
"enabled": {{ $g.enabled }},
"claimName": "{{ $g.claimName }}",
"claimValues": [
{{- range $j, $v := $g.claimValues }}
{{- if ne $j 0 }},{{- end }}
"{{ $v }}"
{{- end }}
]
}
{{- end }}
]
}
}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,23 @@
{{- if .Values.kubecostProductConfigs }}
{{- if .Values.kubecostProductConfigs.productKey }}
{{- if .Values.kubecostProductConfigs.productKey.enabled }}
# If the productKey.key is not specified, the configmap will not be created
{{- if .Values.kubecostProductConfigs.productKey.key }}
# If the secretname is specified, the configmap will not be created
{{- if not .Values.kubecostProductConfigs.productKey.secretname }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "product-configs" .Values.productConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- if .Values.kubecostProductConfigs.productKey.key }}
key: {{ .Values.kubecostProductConfigs.productKey.key | quote }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,141 @@
{{- if .Values.kubecostProductConfigs }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "pricing-configs" .Values.pricingConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- if .Values.kubecostProductConfigs.defaultModelPricing }}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.enabled }}
{{- if .Values.kubecostProductConfigs.customPricesEnabled }}
customPricesEnabled: "{{ .Values.kubecostProductConfigs.customPricesEnabled }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.CPU }}
CPU: "{{ .Values.kubecostProductConfigs.defaultModelPricing.CPU | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.spotCPU }}
spotCPU: "{{ .Values.kubecostProductConfigs.defaultModelPricing.spotCPU | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.RAM }}
RAM: "{{ .Values.kubecostProductConfigs.defaultModelPricing.RAM | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.spotRAM }}
spotRAM: "{{ .Values.kubecostProductConfigs.defaultModelPricing.spotRAM | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.GPU }}
GPU: "{{ .Values.kubecostProductConfigs.defaultModelPricing.GPU | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.spotGPU }}
spotGPU: "{{ .Values.kubecostProductConfigs.defaultModelPricing.spotGPU | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.storage }}
storage: "{{ .Values.kubecostProductConfigs.defaultModelPricing.storage | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.zoneNetworkEgress }}
zoneNetworkEgress: "{{ .Values.kubecostProductConfigs.defaultModelPricing.zoneNetworkEgress | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.regionNetworkEgress }}
regionNetworkEgress: "{{ .Values.kubecostProductConfigs.defaultModelPricing.regionNetworkEgress | toString }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultModelPricing.internetNetworkEgress }}
internetNetworkEgress: "{{ .Values.kubecostProductConfigs.defaultModelPricing.internetNetworkEgress | toString }}"
{{- end -}}
{{- end -}}
{{- end -}}
{{- if .Values.kubecostProductConfigs.clusterName }}
clusterName: "{{ .Values.kubecostProductConfigs.clusterName }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.clusterAccountID }}
clusterAccountID: "{{ .Values.kubecostProductConfigs.clusterAccountID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.currencyCode }}
currencyCode: "{{ .Values.kubecostProductConfigs.currencyCode }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.azureBillingRegion }}
azureBillingRegion: "{{ .Values.kubecostProductConfigs.azureBillingRegion }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.azureSubscriptionID }}
azureSubscriptionID: "{{ .Values.kubecostProductConfigs.azureSubscriptionID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.azureClientID }}
azureClientID: "{{ .Values.kubecostProductConfigs.azureClientID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.azureTenantID }}
azureTenantID: "{{ .Values.kubecostProductConfigs.azureTenantID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.azureOfferDurableID }}
azureOfferDurableID: "{{ .Values.kubecostProductConfigs.azureOfferDurableID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.discount }}
discount: "{{ .Values.kubecostProductConfigs.discount }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.negotiatedDiscount }}
negotiatedDiscount: "{{ .Values.kubecostProductConfigs.negotiatedDiscount }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.defaultIdle }}
defaultIdle: "{{ .Values.kubecostProductConfigs.defaultIdle }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.sharedNamespaces }}
sharedNamespaces: "{{ .Values.kubecostProductConfigs.sharedNamespaces }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.sharedOverhead }}
sharedOverhead: "{{ .Values.kubecostProductConfigs.sharedOverhead }}"
{{- end -}}
{{- if gt (len (toString .Values.kubecostProductConfigs.shareTenancyCosts)) 0 }}
{{- if eq (toString .Values.kubecostProductConfigs.shareTenancyCosts) "false" }}
shareTenancyCosts: "false"
{{- else if eq (toString .Values.kubecostProductConfigs.shareTenancyCosts) "true" }}
shareTenancyCosts: "true"
{{- end -}}
{{- end -}}
{{- if .Values.kubecostProductConfigs.spotLabel }}
spotLabel: "{{ .Values.kubecostProductConfigs.spotLabel }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.spotLabelValue }}
spotLabelValue: "{{ .Values.kubecostProductConfigs.spotLabelValue }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.awsSpotDataRegion }}
spotDataRegion: "{{ .Values.kubecostProductConfigs.awsSpotDataRegion }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.awsSpotDataBucket }}
spotDataBucket: "{{ .Values.kubecostProductConfigs.awsSpotDataBucket }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.awsSpotDataPrefix }}
spotDataPrefix: "{{ .Values.kubecostProductConfigs.awsSpotDataPrefix }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.projectID }}
projectID: "{{ .Values.kubecostProductConfigs.projectID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.bigQueryBillingDataDataset }}
billingDataDataset: "{{ .Values.kubecostProductConfigs.bigQueryBillingDataDataset }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.athenaProjectID }}
athenaProjectID: "{{ .Values.kubecostProductConfigs.athenaProjectID }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.athenaBucketName }}
athenaBucketName: "{{ .Values.kubecostProductConfigs.athenaBucketName }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.athenaRegion }}
athenaRegion: "{{ .Values.kubecostProductConfigs.athenaRegion }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.athenaDatabase }}
athenaDatabase: "{{ .Values.kubecostProductConfigs.athenaDatabase }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.athenaTable }}
athenaTable: "{{ .Values.kubecostProductConfigs.athenaTable }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.athenaWorkgroup }}
athenaWorkgroup: "{{ .Values.kubecostProductConfigs.athenaWorkgroup }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.masterPayerARN}}
masterPayerARN: "{{ .Values.kubecostProductConfigs.masterPayerARN }}"
{{- end }}
{{- if .Values.kubecostProductConfigs.gpuLabel }}
gpuLabel: "{{ .Values.kubecostProductConfigs.gpuLabel }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.gpuLabelValue }}
gpuLabelValue: "{{ .Values.kubecostProductConfigs.gpuLabelValue }}"
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,22 @@
{{- if .Values.prometheus }}
{{- if .Values.prometheus.serverFiles }}
{{- if .Values.prometheus.serverFiles.rules }}
{{- if .Values.prometheusRule }}
{{- if .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "cost-analyzer.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if .Values.prometheusRule.additionalLabels }}
{{ toYaml .Values.prometheusRule.additionalLabels | nindent 4 }}
{{- end }}
spec:
{{ toYaml .Values.prometheus.serverFiles.rules | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,33 @@
{{- if .Values.persistentVolume -}}
{{- if not .Values.persistentVolume.existingClaim -}}
{{- if .Values.persistentVolume.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "cost-analyzer.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.persistentVolume.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.persistentVolume.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.persistentVolume.storageClass }}
storageClassName: {{ .Values.persistentVolume.storageClass }}
{{ end }}
resources:
requests:
{{- if .Values.persistentVolume }}
storage: {{ .Values.persistentVolume.size }}
{{- else }}
storage: 32.0Gi
{{ end }}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,14 @@
{{- if .Values.saml }}
{{- if .Values.saml.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "cost-analyzer.fullname" . }}-saml
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- $root := . }}
saml.json: '{{ toJson .Values.saml }}'
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,13 @@
{{- if .Values.global.savedReports }}
{{- if .Values.global.savedReports.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{default "saved-report-configs" .Values.savedReportConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
saved-reports.json: '{{ toJson .Values.global.savedReports.reports }}'
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,72 @@
{{- if .Values.kubecostProductConfigs }}
{{- if or .Values.kubecostProductConfigs.grafanaURL .Values.kubecostProductConfigs.labelMappingConfigs .Values.kubecostProductConfigs.cloudAccountMapping}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "app-configs" .Values.appConfigmapName }}
namespace: {{ .Release.Namespace }}
labels: {{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
{{- if .Values.kubecostProductConfigs.labelMappingConfigs }}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.enabled }}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.owner_label }}
owner_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.owner_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.team_label }}
team_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.team_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.department_label }}
department_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.department_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.product_label }}
product_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.product_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.environment_label }}
environment_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.environment_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.namespace_external_label }}
namespace_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.namespace_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.cluster_external_label }}
cluster_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.cluster_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.controller_external_label }}
controller_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.controller_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.product_external_label }}
product_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.product_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.service_external_label }}
service_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.service_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.deployment_external_label }}
deployment_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.deployment_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.team_external_label }}
team_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.team_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.environment_external_label }}
environment_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.environment_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.department_external_label }}
department_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.department_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.statefulset_external_label }}
statefulset_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.statefulset_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.daemonset_external_label }}
daemonset_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.daemonset_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.pod_external_label }}
pod_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.pod_external_label }}"
{{- end -}}
{{- if .Values.kubecostProductConfigs.labelMappingConfigs.owner_external_label }}
owner_external_label: "{{ .Values.kubecostProductConfigs.labelMappingConfigs.owner_external_label }}"
{{- end -}}
{{- end -}}
{{- end -}}
{{- if .Values.kubecostProductConfigs.grafanaURL }}
grafanaURL: "{{ .Values.kubecostProductConfigs.grafanaURL }}"
{{- end -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "cost-analyzer.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,66 @@
{{- if and (not .Values.agent) (not .Values.cloudAgent) }}
kind: Service
apiVersion: v1
metadata:
name: {{ template "cost-analyzer.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
selector:
{{- include "cost-analyzer.selectorLabels" . | nindent 4 }}
{{- if .Values.service -}}
{{- if .Values.service.type }}
type: "{{ .Values.service.type }}"
{{- else }}
type: ClusterIP
{{- end }}
{{- else }}
type: ClusterIP
{{- end }}
{{- if (eq .Values.service.type "LoadBalancer") }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- end }}
ports:
- name: tcp-model
port: 9003
targetPort: 9003
{{- with .Values.kubecostModel.extraPorts }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and (.Values.kubecostFrontend.enabled) (not (eq (include "frontend.deployMethod" .) "haMode")) }}
- name: tcp-frontend
{{- if (eq .Values.service.type "NodePort") }}
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
{{- end }}
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
{{- end }}
{{- if or .Values.saml.enabled .Values.oidc.enabled}}
- name: apiserver
port: 9007
targetPort: 9007
{{- end }}
{{- if .Values.service.sessionAffinity.enabled }}
sessionAffinity: ClientIP
{{- if .Values.service.sessionAffinity.timeoutSeconds }}
sessionAffinityConfig:
clientIP:
timeoutSeconds: {{ .Values.service.sessionAffinity.timeoutSeconds }}
{{- end }}
{{- else }}
sessionAffinity: None
{{- end }}
{{- end }}

View File

@ -0,0 +1,34 @@
{{- if .Values.serviceMonitor }}
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "cost-analyzer.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if .Values.serviceMonitor.additionalLabels }}
{{ toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: tcp-model
honorLabels: true
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
path: /metrics
scheme: http
{{- with .Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.relabelings }}
relabelings: {{ toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{ include "cost-analyzer.selectorLabels" . | nindent 6 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "smtp-configs" .Values.smtpConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if (((.Values.kubecostProductConfigs).smtp).config) }}
data:
config: {{ .Values.kubecostProductConfigs.smtp.config | quote }}
{{- end -}}

View File

@ -0,0 +1,174 @@
{{- if and .Values.diagnostics.enabled .Values.diagnostics.deployment.enabled }}
{{- if or (not (empty .Values.kubecostModel.federatedStorageConfigSecret )) .Values.kubecostModel.federatedStorageConfig -}}
{{- if eq .Values.prometheus.server.global.external_labels.cluster_id "cluster-one" }}
{{- fail "Error: The 'cluster_id' is set to default 'cluster-one'. Please update so that the diagnostics service can uniquely identify data coming from this cluster." }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "diagnostics.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "diagnostics.selectorLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.diagnostics.deployment.labels }}
{{- toYaml .Values.diagnostics.deployment.labels | nindent 4 }}
{{- end }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "diagnostics.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "diagnostics.selectorLabels" . | nindent 8 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- with .Values.global.podAnnotations}}
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/configs: {{ include "configsChecksum" . }}
spec:
restartPolicy: Always
{{- if .Values.diagnostics.deployment.securityContext }}
securityContext:
{{- toYaml .Values.diagnostics.deployment.securityContext | nindent 8 }}
{{- else if .Values.global.securityContext }}
securityContext:
{{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
volumes:
{{- if or .Values.kubecostModel.federatedStorageConfigSecret .Values.kubecostModel.federatedStorageConfig }}
- name: federated-storage-config
secret:
defaultMode: 420
secretName: {{ .Values.kubecostModel.federatedStorageConfigSecret | default "federated-store" }}
{{- end }}
- name: config-db
{{- /* #TODO: make pv? */}}
emptyDir: {}
containers:
- name: diagnostics
args: ["diagnostics"]
{{- if .Values.kubecostModel }}
{{- if .Values.kubecostModel.fullImageName }}
image: {{ .Values.kubecostModel.fullImageName }}
{{- else if .Values.imageVersion }}
image: {{ .Values.kubecostModel.image }}:{{ .Values.imageVersion }}
{{- else if eq "development" .Chart.AppVersion }}
image: gcr.io/kubecost1/cost-model-nightly:latest
{{- else }}
image: {{ .Values.kubecostModel.image }}:prod-{{ $.Chart.AppVersion }}
{{- end }}
{{- else }}
image: gcr.io/kubecost1/cost-model:prod-{{ $.Chart.AppVersion }}
{{- end }}
{{- if .Values.kubecostModel.imagePullPolicy }}
imagePullPolicy: {{ .Values.kubecostModel.imagePullPolicy }}
{{- else }}
imagePullPolicy: Always
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.diagnostics.deployment.containerSecurityContext }}
securityContext:
{{- toYaml .Values.diagnostics.deployment.containerSecurityContext | nindent 12 }}
{{- else if .Values.global.containerSecurityContext }}
securityContext:
{{- toYaml .Values.global.containerSecurityContext | nindent 12 }}
{{- end }}
volumeMounts:
- name: config-db
mountPath: /var/configs/db
readOnly: false
- name: federated-storage-config
mountPath: /var/configs/etl
readOnly: true
env:
{{- if and (.Values.prometheus.server.global.external_labels.cluster_id) (not .Values.prometheus.server.clusterIDConfigmap) }}
- name: CLUSTER_ID
value: {{ .Values.prometheus.server.global.external_labels.cluster_id }}
{{- end }}
{{- if .Values.prometheus.server.clusterIDConfigmap }}
- name: CLUSTER_ID
valueFrom:
configMapKeyRef:
name: {{ .Values.prometheus.server.clusterIDConfigmap }}
key: CLUSTER_ID
{{- end }}
- name: FEDERATED_STORE_CONFIG
value: /var/configs/etl/federated-store.yaml
- name: DIAGNOSTICS_RUN_IN_COST_MODEL
value: "false"
- name: DIAGNOSTICS_KUBECOST_FQDN
value: {{ template "cost-analyzer.serviceName" . }}
- name: DIAGNOSTICS_KUBECOST_NAMESPACE
value: {{ .Release.Namespace }}
- name: DIAGNOSTICS_PRIMARY
value: {{ quote .Values.diagnostics.primary.enabled }}
- name: DIAGNOSTICS_RETENTION
value: {{ .Values.diagnostics.primary.retention }}
- name: DIAGNOSTICS_PRIMARY_READONLY
value: {{ quote .Values.diagnostics.primary.readonly }}
- name: DIAGNOSTICS_POLLING_INTERVAL
value: {{ .Values.diagnostics.pollingInterval }}
- name: DIAGNOSTICS_KEEP_HISTORY
value: {{ quote .Values.diagnostics.keepDiagnosticHistory }}
- name: DIAGNOSTICS_COLLECT_HELM_VALUES
value: {{ quote .Values.diagnostics.collectHelmValues }}
{{- if .Values.systemProxy.enabled }}
- name: HTTP_PROXY
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: http_proxy
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: HTTPS_PROXY
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: https_proxy
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: NO_PROXY
value: {{ .Values.systemProxy.noProxy }}
- name: no_proxy
value: {{ .Values.systemProxy.noProxy }}
{{- end }}
{{- range $key, $value := .Values.diagnostics.deployment.env }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
{{- end }}
{{- /* TODO: heatlhcheck that validates the diagnotics pod is healthy */}}
{{- if .Values.diagnostics.primary.enabled}}
readinessProbe:
httpGet:
path: /healthz
port: 9007
ports:
- name: diagnostics-api
containerPort: 9007
protocol: TCP
{{- end }}
resources:
{{- toYaml .Values.diagnostics.deployment.resources | nindent 12 }}
{{- with .Values.diagnostics.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.diagnostics.deployment.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.diagnostics.deployment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,20 @@
{{- if and .Values.diagnostics.enabled .Values.diagnostics.deployment.enabled .Values.diagnostics.primary.enabled }}
{{- if or (not (empty .Values.kubecostModel.federatedStorageConfigSecret )) .Values.kubecostModel.federatedStorageConfig -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "diagnostics.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "diagnostics.selectorLabels" . | nindent 4 }}
spec:
ports:
- name: diagnostics-api
protocol: TCP
port: 9007
targetPort: diagnostics-api
selector:
{{- include "diagnostics.selectorLabels" . | nindent 4 }}
type: ClusterIP
{{- end }}
{{- end }}

View File

@ -0,0 +1,123 @@
{{- if .Values.etlUtils.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "etlUtils.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "etlUtils.commonLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.global.podAnnotations}}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "etlUtils.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
app.kubernetes.io/name: {{ template "etlUtils.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app: {{ template "etlUtils.name" . }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
restartPolicy: Always
volumes:
{{- if .Values.etlUtils.thanosSourceBucketSecret }}
- name: etl-bucket-config
secret:
defaultMode: 420
secretName: {{ .Values.etlUtils.thanosSourceBucketSecret }}
{{- end }}
{{- if or .Values.kubecostModel.federatedStorageConfigSecret .Values.kubecostModel.federatedStorageConfig}}
- name: federated-storage-config
secret:
defaultMode: 420
secretName: {{ .Values.kubecostModel.federatedStorageConfigSecret | default "federated-store" }}
{{- end }}
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
containers:
- name: {{ template "etlUtils.name" . }}
{{- if .Values.kubecostModel }}
{{- if .Values.kubecostModel.openSourceOnly }}
{{- fail "ETL Utils cannot be used with open source only" }}
{{- else if .Values.etlUtils.fullImageName }}
image: {{ .Values.etlUtils.fullImageName }}
{{- else if .Values.kubecostModel.fullImageName }}
image: {{ .Values.kubecostModel.fullImageName }}
{{- else if .Values.imageVersion }}
image: {{ .Values.kubecostModel.image }}:{{ .Values.imageVersion }}
{{- else if eq "development" .Chart.AppVersion }}
image: gcr.io/kubecost1/cost-model-nightly:latest
{{- else }}
image: {{ .Values.kubecostModel.image }}:prod-{{ $.Chart.AppVersion }}
{{ end }}
{{- else }}
image: gcr.io/kubecost1/cost-model:prod-{{ $.Chart.AppVersion }}
{{ end }}
readinessProbe:
httpGet:
path: /healthz
port: 9006
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 200
livenessProbe:
httpGet:
path: /healthz
port: 9006
initialDelaySeconds: 10
periodSeconds: 5
imagePullPolicy: Always
args: ["etl-utils"]
ports:
- name: api
containerPort: 9006
protocol: TCP
resources:
{{- toYaml .Values.etlUtils.resources | nindent 12 }}
volumeMounts:
{{- if .Values.etlUtils.thanosSourceBucketSecret }}
- name: etl-bucket-config
mountPath: /var/configs/etl
readOnly: true
{{- end }}
env:
- name: CONFIG_PATH
value: /var/configs/
{{- if .Values.etlUtils.thanosSourceBucketSecret }}
- name: ETL_BUCKET_CONFIG
value: "/var/configs/etl/object-store.yaml"
{{- end}}
{{- range $key, $value := .Values.etlUtils.env }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- with .Values.etlUtils.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.etlUtils.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.etlUtils.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,18 @@
{{- if .Values.etlUtils.enabled }}
kind: Service
apiVersion: v1
metadata:
name: {{ template "etlUtils.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "etlUtils.commonLabels" . | nindent 4 }}
spec:
selector:
{{ include "etlUtils.selectorLabels" . | nindent 4 }}
type: "ClusterIP"
ports:
- name: api
port: 9006
targetPort: 9006
{{- end }}

View File

@ -0,0 +1,11 @@
{{- if eq .Values.global.grafana.proxy false -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: external-grafana-config-map
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
grafanaURL: {{ .Values.global.grafana.scheme | default "http" }}://{{- .Values.global.grafana.domainName }}
{{- end -}}

View File

@ -0,0 +1,8 @@
{{ range .Values.extraObjects }}
---
{{- if typeIs "string" . }}
{{- tpl . $ }}
{{- else }}
{{- tpl (toYaml .) $ }}
{{- end }}
{{ end }}

View File

@ -0,0 +1,12 @@
{{- if .Values.kubecostModel.federatedStorageConfig -}}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: federated-store
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
federated-store.yaml: {{ .Values.kubecostModel.federatedStorageConfig | b64enc }}
{{- end }}

View File

@ -0,0 +1,145 @@
{{- if and .Values.forecasting.enabled (not .Values.federatedETL.agentOnly) }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "forecasting.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "forecasting.commonLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "forecasting.selectorLabels" . | nindent 6 }}
strategy:
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: forecasting
app.kubernetes.io/instance: {{ .Release.Name }}
app: forecasting
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.podAnnotations}}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
automountServiceAccountToken: false
{{- if .Values.global.platforms.openshift.enabled }}
securityContext:
{{- toYaml .Values.global.platforms.openshift.securityContext | nindent 8 }}
{{- else if .Values.global.securityContext }}
securityContext:
{{- toYaml .Values.global.securityContext | nindent 8 }}
{{- else }}
securityContext:
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
{{- end }}
restartPolicy: Always
containers:
- name: forecasting
{{- if .Values.forecasting.fullImageName }}
image: {{ .Values.forecasting.fullImageName }}
{{- else }}
image: gcr.io/kubecost1/kubecost-modeling:prod-{{ $.Chart.AppVersion }}
{{ end }}
{{- if .Values.forecasting.readinessProbe.enabled }}
volumeMounts:
- name: tmp
{{- /* In the future, this path should be configurable and not under tmp */}}
mountPath: /tmp
securityContext:
{{- toYaml .Values.global.containerSecurityContext | nindent 12 }}
{{- if .Values.forecasting.imagePullPolicy }}
imagePullPolicy: {{ .Values.forecasting.imagePullPolicy }}
{{- else }}
imagePullPolicy: Always
{{- end }}
ports:
- name: tcp-api
containerPort: 5000
protocol: TCP
{{- with .Values.forecasting.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: CONFIG_PATH
value: /var/configs/
{{- if or .Values.saml.enabled .Values.oidc.enabled }}
- name: KCM_BASE_URL
value: http://{{ template "aggregator.serviceName" . }}:9008
{{- else }}
- name: KCM_BASE_URL
value: http://{{ template "aggregator.serviceName" . }}:9004
{{- end }}
- name: MODEL_STORAGE_PATH
value: "/tmp/localrun/models"
- name: PAGE_ITEM_LIMIT
value: "1000"
{{- range $key, $value := .Values.forecasting.env }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
{{- end }}
readinessProbe:
httpGet:
path: /healthz
port: 5000
initialDelaySeconds: {{ .Values.forecasting.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.forecasting.readinessProbe.periodSeconds }}
failureThreshold: {{ .Values.forecasting.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.forecasting.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /healthz
port: 5000
initialDelaySeconds: {{ .Values.forecasting.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.forecasting.livenessProbe.periodSeconds }}
failureThreshold: {{ .Values.forecasting.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.forecasting.priority }}
{{- if .Values.forecasting.priority.enabled }}
{{- if .Values.forecasting.priority.name }}
priorityClassName: {{ .Values.forecasting.priority.name }}
{{- else }}
priorityClassName: {{ template "forecasting.fullname" . }}-priority
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.forecasting.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.forecasting.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.forecasting.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: tmp
{{- /*
An emptyDir for models is necessary because of the
readOnlyRootFilesystem default In the future, this may optionally be a
PV. To allow Python to auto-detect a temp directory, which the code
currently relies on, we mount it at /tmp. In the future this will be a
configurable path.
*/}}
emptyDir:
sizeLimit: 500Mi
{{- end }}

View File

@ -0,0 +1,17 @@
{{- if and .Values.forecasting.enabled (not .Values.federatedETL.agentOnly) }}
kind: Service
apiVersion: v1
metadata:
name: {{ template "forecasting.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "forecasting.commonLabels" . | nindent 4 }}
spec:
selector:
{{- include "forecasting.selectorLabels" . | nindent 4 }}
type: ClusterIP
ports:
- name: tcp-api
port: 5000
targetPort: 5000
{{- end }}

View File

@ -0,0 +1,217 @@
{{- if eq (include "frontend.deployMethod" .) "haMode" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "frontend.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- with .Values.global.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Values.kubecostDeployment .Values.kubecostDeployment.labels }}
{{- toYaml .Values.kubecostDeployment.labels | nindent 4 }}
{{- end }}
{{- if and .Values.kubecostDeployment .Values.kubecostDeployment.annotations }}
annotations:
{{- toYaml .Values.kubecostDeployment.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.kubecostFrontend.haReplicas | default 2 }}
selector:
matchLabels:
{{- include "frontend.selectorLabels" . | nindent 6 }}
{{- if .Values.kubecostFrontend.deploymentStrategy }}
{{- with .Values.kubecostFrontend.deploymentStrategy }}
strategy: {{ toYaml . | nindent 4 }}
{{- end }}
{{- else }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
{{- end }}
template:
metadata:
labels:
{{- include "frontend.selectorLabels" . | nindent 8 }}
{{- if .Values.global.additionalLabels }}
{{- toYaml .Values.global.additionalLabels | nindent 8 }}
{{- end }}
{{- if and .Values.kubecostDeployment .Values.kubecostDeployment.labels }}
{{- toYaml .Values.kubecostDeployment.labels | nindent 8 }}
{{- end }}
annotations:
{{- with .Values.global.podAnnotations}}
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/configs: {{ include "configsChecksum" . }}
spec:
{{- if .Values.global.platforms.openshift.enabled }}
securityContext:
{{- toYaml .Values.global.platforms.openshift.securityContext | nindent 8 }}
{{- else if .Values.global.securityContext }}
securityContext:
{{- toYaml .Values.global.securityContext | nindent 8 }}
{{- else }}
securityContext:
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
{{- end }}
restartPolicy: Always
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
volumes:
- name: tmp
emptyDir: {}
- name: nginx-conf
configMap:
name: nginx-conf
items:
- key: nginx.conf
path: default.conf
{{- if .Values.global.containerSecuritycontext }}
- name: var-run
emptyDir: {}
- name: cache
emptyDir: {}
{{- end }}
{{- if .Values.kubecostFrontend.tls }}
{{- if .Values.kubecostFrontend.tls.enabled }}
- name: tls
secret:
secretName : {{ .Values.kubecostFrontend.tls.secretName }}
items:
- key: tls.crt
path: kc.crt
- key: tls.key
path: kc.key
{{- end }}
{{- end }}
{{- if .Values.kubecostAdmissionController }}
{{- if .Values.kubecostAdmissionController.enabled }}
{{- if .Values.kubecostAdmissionController.secretName }}
- name: webhook-server-tls
secret:
secretName: {{ .Values.kubecostAdmissionController.secretName }}
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
{{- end }}
{{- end }}
{{- end }}
containers:
{{- if .Values.kubecostFrontend }}
{{- if .Values.kubecostFrontend.fullImageName }}
- image: {{ .Values.kubecostFrontend.fullImageName }}
{{- else if .Values.imageVersion }}
- image: {{ .Values.kubecostFrontend.image }}:{{ .Values.imageVersion }}
{{- else if eq "development" .Chart.AppVersion }}
- image: gcr.io/kubecost1/frontend-nightly:latest
{{- else }}
- image: {{ .Values.kubecostFrontend.image }}:prod-{{ $.Chart.AppVersion }}
{{- end }}
{{- else }}
- image: gcr.io/kubecost1/frontend:prod-{{ $.Chart.AppVersion }}
{{- end }}
name: cost-analyzer-frontend
ports:
- name: tcp-frontend
containerPort: 9090
protocol: TCP
env:
- name: GET_HOSTS_FROM
value: dns
{{- if .Values.kubecostFrontend.extraEnv -}}
{{ toYaml .Values.kubecostFrontend.extraEnv | nindent 12 }}
{{- end }}
{{- if .Values.kubecostFrontend.securityContext }}
securityContext:
{{- toYaml .Values.kubecostFrontend.securityContext | nindent 12 }}
{{- else }}
securityContext:
{{- toYaml .Values.global.containerSecurityContext | nindent 12 }}
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
- name: tmp
mountPath: /var/lib/nginx/tmp
- name: tmp
mountPath: /var/run
- name: nginx-conf
mountPath: /etc/nginx/conf.d/
{{- if .Values.global.containerSecuritycontext }}
- mountPath: /var/cache/nginx
name: cache
- mountPath: /var/run
name: var-run
{{- end }}
{{- if .Values.kubecostFrontend.tls }}
{{- if .Values.kubecostFrontend.tls.enabled }}
- name: tls
mountPath: /etc/ssl/certs
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.kubecostFrontend.resources | nindent 12 }}
{{- if .Values.kubecostFrontend.imagePullPolicy }}
imagePullPolicy: {{ .Values.kubecostFrontend.imagePullPolicy }}
{{- else }}
imagePullPolicy: Always
{{- end }}
{{- if .Values.kubecostFrontend.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /healthz
port: 9090
initialDelaySeconds: {{ .Values.kubecostFrontend.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.kubecostFrontend.readinessProbe.periodSeconds }}
failureThreshold: {{ .Values.kubecostFrontend.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.kubecostFrontend.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /healthz
port: 9090
initialDelaySeconds: {{ .Values.kubecostFrontend.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.kubecostFrontend.livenessProbe.periodSeconds }}
failureThreshold: {{ .Values.kubecostFrontend.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.global.containerSecuritycontext }}
securityContext:
{{- toYaml .Values.global.containerSecuritycontext | nindent 12 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.priority }}
{{- if .Values.priority.enabled }}
{{- if gt (len .Values.priority.name) 0 }}
priorityClassName: {{ .Values.priority.name }}
{{- else }}
priorityClassName: {{ template "cost-analyzer.fullname" . }}-priority
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,53 @@
{{- if eq (include "frontend.deployMethod" .) "haMode" }}
kind: Service
apiVersion: v1
metadata:
name: {{ template "frontend.serviceName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
selector:
{{- include "frontend.selectorLabels" . | nindent 4 }}
{{- if .Values.service -}}
{{- if .Values.service.type }}
type: "{{ .Values.service.type }}"
{{- else }}
type: ClusterIP
{{- end }}
{{- else }}
type: ClusterIP
{{- end }}
{{- if (eq .Values.service.type "LoadBalancer") }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- end }}
ports:
- name: tcp-frontend
{{- if (eq .Values.service.type "NodePort") }}
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
{{- end }}
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
{{- if .Values.service.sessionAffinity.enabled }}
sessionAffinity: ClientIP
{{- if .Values.service.sessionAffinity.timeoutSeconds }}
sessionAffinityConfig:
clientIP:
timeoutSeconds: {{ .Values.service.sessionAffinity.timeoutSeconds }}
{{- end }}
{{- else }}
sessionAffinity: None
{{- end }}
{{- end }}

View File

@ -0,0 +1,61 @@
{{- if .Values.global.gcpstore.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: ubbagent-config
data:
config.yaml: |
# The identity section contains authentication information used
# by the agent.
identities:
- name: gcp
gcp:
# This parameter accepts a base64-encoded JSON service
# account key. The value comes from the reporting secret.
encodedServiceAccountKey: $AGENT_ENCODED_KEY
# The metrics section defines the metric that will be reported.
# Metric names should match verbatim the identifiers created
# during pricing setup.
metrics:
- name: commercial_ent_node_hr
type: int
endpoints:
- name: servicecontrol
# The passthrough marker indicates that no aggregation should
# occur for this metric. Reports received are immediately sent
# to the reporting endpoint. We use passthrough for the
# instance_time metric since reports are generated
# automatically by a heartbeat source defined in a later
# section.
passthrough: {}
# The endpoints section defines where metering data is ultimately
# sent. Currently supported endpoints include:
# * disk - some directory on the local filesystem
# * servicecontrol - Google Service Control
endpoints:
- name: servicecontrol
servicecontrol:
identity: gcp
# The service name is unique to your application and will be
# provided during onboarding.
serviceName: kubecost-ent.endpoints.kubecost-public.cloud.goog
consumerId: $AGENT_CONSUMER_ID # From the reporting secret.
# The sources section lists metric data sources run by the agent
# itself. The currently-supported source is 'heartbeat', which
# sends a defined value to a metric at a defined interval. In
# this example, the heartbeat sends a 60-second value through the
# "instance_time" metric every minute.
sources:
- name: commercial_ent_node_hr_heartbeat
heartbeat:
metric: commercial_ent_node_hr
intervalSeconds: 3600
value:
int64Value: 1
{{- end }}

View File

@ -0,0 +1,24 @@
{{- if (eq (include "cost-analyzer.grafanaEnabled" .) "true") }}
{{- if .Values.grafana.rbac.create }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
app: {{ template "grafana.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.grafana.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
name: {{ template "grafana.fullname" . }}-clusterrole
{{- if or .Values.grafana.sidecar.dashboards.enabled .Values.grafana.sidecar.datasources.enabled }}
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["configmaps"]
verbs: ["get", "watch", "list"]
{{- else }}
rules: []
{{- end}}
{{- end}}
{{ end }}

View File

@ -0,0 +1,24 @@
{{- if (eq (include "cost-analyzer.grafanaEnabled" .) "true") }}
{{- if .Values.grafana.rbac.create }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "grafana.fullname" . }}-clusterrolebinding
labels:
app: {{ template "grafana.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.grafana.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ template "grafana.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "grafana.fullname" . }}-clusterrole
apiGroup: rbac.authorization.k8s.io
{{- end}}
{{ end }}

Some files were not shown because too many files have changed in this diff Show More