Skip to content

Instantly share code, notes, and snippets.

@liskl
Last active August 14, 2019 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liskl/374f41485bf592442a2f89ae862117b3 to your computer and use it in GitHub Desktop.
Save liskl/374f41485bf592442a2f89ae862117b3 to your computer and use it in GitHub Desktop.
kubecost.yaml
---
# Source: cost-analyzer/charts/grafana/templates/podsecuritypolicy.yaml
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
heritage: Tiller
release: kubecost
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
privileged: false
allowPrivilegeEscalation: false
requiredDropCapabilities:
- ALL
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: false
---
# Source: cost-analyzer/charts/grafana/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
type: Opaque
data:
admin-user: "YWRtaW4="
admin-password: "MGFhOWU2NGY4OGIxNDMyOWI4MjVkMjY3NjdiNDA4YmE="
ldap-toml: ""
---
# Source: cost-analyzer/charts/grafana/templates/configmap-dashboard-provider.yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
name: kubecost-grafana-config-dashboards
data:
provider.yaml: |-
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
options:
path: /tmp/dashboards
---
# Source: cost-analyzer/charts/grafana/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
data:
grafana.ini: |
[analytics]
check_for_updates = true
[auth.anonymous]
enabled = true
org_name = Main Org.
org_role = Admin
[grafana_net]
url = https://grafana.net
[log]
mode = console
[paths]
data = /var/lib/grafana/data
logs = /var/log/grafana
plugins = /var/lib/grafana/plugins
provisioning = /etc/grafana/provisioning
[server]
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana
- access: proxy
isDefault: true
name: Prometheus
type: prometheus
url: http://kubecost-prometheus-server.kubecost.svc.cluster.local
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
component: "alertmanager"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-alertmanager
data:
alertmanager.yml: |
global: {}
receivers:
- name: default-receiver
route:
group_interval: 5m
group_wait: 10s
receiver: default-receiver
repeat_interval: 3h
---
# Source: cost-analyzer/charts/prometheus/templates/server-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
data:
alerts: |
{}
prometheus.yml: |
global:
evaluation_interval: 1m
scrape_interval: 1m
scrape_timeout: 10s
rule_files:
- /etc/config/rules
- /etc/config/alerts
scrape_configs:
- job_name: prometheus
static_configs:
- targets:
- localhost:9090
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
job_name: kubernetes-apiservers
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
regex: default;kubernetes;https
source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
job_name: kubernetes-nodes
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- replacement: kubernetes.default.svc:443
target_label: __address__
- regex: (.+)
replacement: /api/v1/nodes/$1/proxy/metrics
source_labels:
- __meta_kubernetes_node_name
target_label: __metrics_path__
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
job_name: kubernetes-nodes-cadvisor
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- replacement: kubernetes.default.svc:443
target_label: __address__
- regex: (.+)
replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
source_labels:
- __meta_kubernetes_node_name
target_label: __metrics_path__
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
- job_name: kubernetes-service-endpoints
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_scrape
- action: replace
regex: (https?)
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_scheme
target_label: __scheme__
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_path
target_label: __metrics_path__
- action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
source_labels:
- __address__
- __meta_kubernetes_service_annotation_prometheus_io_port
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: kubernetes_namespace
- action: replace
source_labels:
- __meta_kubernetes_service_name
target_label: kubernetes_name
- action: replace
source_labels:
- __meta_kubernetes_pod_node_name
target_label: kubernetes_node
- honor_labels: true
job_name: prometheus-pushgateway
kubernetes_sd_configs:
- role: service
relabel_configs:
- action: keep
regex: pushgateway
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_probe
- job_name: kubernetes-services
kubernetes_sd_configs:
- role: service
metrics_path: /probe
params:
module:
- http_2xx
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_probe
- source_labels:
- __address__
target_label: __param_target
- replacement: blackbox
target_label: __address__
- source_labels:
- __param_target
target_label: instance
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels:
- __meta_kubernetes_namespace
target_label: kubernetes_namespace
- source_labels:
- __meta_kubernetes_service_name
target_label: kubernetes_name
- job_name: kubernetes-pods
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_path
target_label: __metrics_path__
- action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
source_labels:
- __address__
- __meta_kubernetes_pod_annotation_prometheus_io_port
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: kubernetes_namespace
- action: replace
source_labels:
- __meta_kubernetes_pod_name
target_label: kubernetes_pod_name
- job_name: kubecost
honor_labels: true
scrape_interval: 1m
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
dns_sd_configs:
- names:
- kubecost-cost-analyzer
type: 'A'
port: 9003
alerting:
alertmanagers:
- kubernetes_sd_configs:
- role: pod
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
relabel_configs:
- source_labels: [__meta_kubernetes_namespace]
regex: kubecost
action: keep
- source_labels: [__meta_kubernetes_pod_label_app]
regex: prometheus
action: keep
- source_labels: [__meta_kubernetes_pod_label_component]
regex: alertmanager
action: keep
- source_labels: [__meta_kubernetes_pod_container_port_number]
regex:
action: drop
rules: |
groups:
- name: CPU
rules:
- expr: sum(rate(container_cpu_usage_seconds_total{container_name!=""}[5m]))
record: cluster:cpu_usage:rate5m
- expr: rate(container_cpu_usage_seconds_total{container_name!=""}[5m])
record: cluster:cpu_usage_nosum:rate5m
---
# Source: cost-analyzer/templates/cost-analyzer-config-map-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
data:
prometheus-alertmanager-endpoint: http://kubecost-prometheus-alertmanager.kubecost.svc.cluster.local
prometheus-server-endpoint: http://kubecost-prometheus-server.kubecost.svc.cluster.local
kubecost-token: not-applied
---
# Source: cost-analyzer/templates/cost-analyzer-frontend-config-map-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
data:
nginx.conf: |
gzip_static on;
upstream api {
server kubecost-cost-analyzer.kubecost:9001;
}
upstream model {
server kubecost-cost-analyzer.kubecost:9003;
}
upstream grafana {
server kubecost-grafana.kubecost;
}
server {
listen 9090;
server_name _;
root /var/www;
index index.html;
add_header Cache-Control "no-cache";
add_header ETag "1.38.0";
location /api/ {
proxy_pass http://api/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /model/ {
proxy_connect_timeout 180;
proxy_send_timeout 180;
proxy_read_timeout 180;
proxy_pass http://model/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /grafana/ {
proxy_pass http://grafana/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
---
# Source: cost-analyzer/templates/grafana-dashboard-cluster-metrics-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-metrics-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
cluster-metrics.json: |-
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Cost metrics from the Kubecost product",
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 7,
"iteration": 1558062099204,
"links": [],
"panels": [
{
"content": "Note: this dashboard requires Kubecost metrics to be available in your Prometheus deployment. [Learn more](https://github.com/kubecost/cost-model/blob/master/PROMETHEUS.md)",
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 0
},
"id": 27,
"links": [],
"mode": "markdown",
"title": "",
"transparent": true,
"type": "text"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "Monthly run rate of CPU + GPU costs based on currently provisioned resources.",
"format": "currencyUSD",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 3,
"w": 6,
"x": 0,
"y": 2
},
"hideTimeOverride": true,
"id": 2,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": true,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "label_cloud_google_com_gke_preemptible",
"targets": [
{
"expr": "sum(\n avg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100) +\n avg(node_gpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n)",
"format": "time_series",
"instant": true,
"interval": "",
"intervalFactor": 1,
"legendFormat": " {{ node }}",
"refId": "A"
}
],
"thresholds": "",
"timeFrom": "15m",
"timeShift": null,
"title": "CPU Cost",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "Monthly run rate of memory costs based on currently provisioned expenses.",
"format": "currencyUSD",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 3,
"w": 6,
"x": 6,
"y": 2
},
"hideTimeOverride": true,
"id": 3,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "label_cloud_google_com_gke_preemptible",
"targets": [
{
"expr": "sum(\n avg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n)",
"format": "time_series",
"instant": true,
"interval": "",
"intervalFactor": 1,
"legendFormat": " {{ node }}",
"refId": "A"
}
],
"thresholds": "",
"timeFrom": "15m",
"timeShift": null,
"title": "Memory Cost",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "Monthly run rate of attached storage and PV costs based on currently provisioned resources.",
"format": "currencyUSD",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 3,
"w": 6,
"x": 12,
"y": 2
},
"hideTimeOverride": true,
"id": 4,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "label_cloud_google_com_gke_preemptible",
"targets": [
{
"expr": "sum(avg(pv_hourly_cost) by (persistentvolume) * 730 * avg(kube_persistentvolume_capacity_bytes) by (persistentvolume) / 1024 / 1024 / 1024) \n+\nsum(sum(container_fs_limit_bytes{device!=\"tmpfs\", id=\"/\"}) by (instance) / 1024 / 1024 / 1024) * $localStorageGBCost",
"format": "time_series",
"instant": true,
"interval": "",
"intervalFactor": 1,
"legendFormat": " {{ node }}",
"refId": "A"
}
],
"thresholds": "",
"timeFrom": "15m",
"timeShift": null,
"title": "Storage Cost",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "Sum of compute, memory, storage and network costs.",
"format": "currencyUSD",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 7,
"w": 6,
"x": 18,
"y": 2
},
"hideTimeOverride": true,
"id": 11,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "label_cloud_google_com_gke_preemptible",
"targets": [
{
"expr": "# Compute\nsum(\n avg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100) +\n avg(node_gpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n) +\n\n\n# Memory\nsum(\n avg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n) +\n\n# Storage \n\nsum(avg(pv_hourly_cost) by (persistentvolume) * 730 * avg(kube_persistentvolume_capacity_bytes) by (persistentvolume) / 1024 / 1024 / 1024) \n+\nsum(sum(container_fs_limit_bytes{device!=\"tmpfs\", id=\"/\"}) by (instance) / 1024 / 1024 / 1024) * $localStorageGBCost",
"format": "time_series",
"instant": true,
"interval": "",
"intervalFactor": 1,
"legendFormat": " {{ node }}",
"refId": "A"
}
],
"thresholds": "",
"timeFrom": "15m",
"timeShift": null,
"title": "Total Cost",
"type": "singlestat",
"valueFontSize": "120%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": true,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "Current CPU use from applications divided by allocatable CPUs",
"editable": true,
"error": false,
"format": "percent",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 4,
"w": 3,
"x": 0,
"y": 5
},
"height": "180px",
"hideTimeOverride": true,
"id": 13,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"expr": "(\n sum(\n count(irate(container_cpu_usage_seconds_total{id=\"/\"}[10m])) by (instance)\n * on (instance) \n sum(irate(container_cpu_usage_seconds_total{id=\"/\"}[10m])) by (instance)\n ) \n / \n (sum (kube_node_status_allocatable_cpu_cores))\n) * 100",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"refId": "A",
"step": 10
}
],
"thresholds": "30, 80",
"timeFrom": "",
"title": "CPU Utilization",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": true,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "Current CPU reservation requests from applications vs allocatable CPU",
"editable": true,
"error": false,
"format": "percent",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 4,
"w": 3,
"x": 3,
"y": 5
},
"height": "180px",
"id": 15,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"expr": "SUM(kube_pod_container_resource_requests_cpu_cores) / SUM(kube_node_status_allocatable_cpu_cores) * 100",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"refId": "A",
"step": 10
}
],
"thresholds": "30, 80",
"title": "CPU Requests",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": true,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource": "Prometheus",
"description": "Current RAM use vs RAM available",
"editable": true,
"error": false,
"format": "percent",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 4,
"w": 3,
"x": 6,
"y": 5
},
"height": "180px",
"hideTimeOverride": true,
"id": 17,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"expr": "SUM(container_memory_usage_bytes{namespace!=\"\"}) / SUM(kube_node_status_allocatable_memory_bytes) * 100",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"refId": "A",
"step": 10
},
{
"expr": "",
"format": "time_series",
"intervalFactor": 1,
"refId": "B"
}
],
"thresholds": "30,80",
"timeFrom": "",
"title": "RAM Utilization",
"transparent": false,
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": true,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource": "Prometheus",
"description": "Current RAM requests vs RAM available",
"editable": true,
"error": false,
"format": "percent",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 4,
"w": 3,
"x": 9,
"y": 5
},
"height": "180px",
"id": 19,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"expr": "(\n sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\"})\n /\n sum(kube_node_status_allocatable_memory_bytes)\n) * 100",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"refId": "A",
"step": 10
}
],
"thresholds": "30,80",
"title": "RAM Requests",
"transparent": false,
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": true,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource": "Prometheus",
"decimals": 2,
"description": "This gauge shows the current standard storage use, including cluster storage, vs storage available",
"editable": true,
"error": false,
"format": "percent",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 4,
"w": 6,
"x": 12,
"y": 5
},
"height": "180px",
"hideTimeOverride": true,
"id": 21,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"expr": "sum (\n sum(kube_persistentvolumeclaim_info) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim, namespace) or up * 0\n + sum(container_fs_usage_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\"})\n) /\nsum (\n sum(kube_persistentvolumeclaim_info) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n + sum(container_fs_limit_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\"})\n) * 100",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"refId": "A",
"step": 10
}
],
"thresholds": "30, 80",
"timeFrom": "",
"title": "Storage Utilization",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "current"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"description": "Monthly run rate of CPU + GPU costs",
"fill": 1,
"gridPos": {
"h": 7,
"w": 6,
"x": 0,
"y": 9
},
"id": 6,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(\n avg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost) by (node) * 730 +\n avg(node_gpu_hourly_cost) by (node) * 730\n)",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "compute cost",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Compute Cost",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "currencyUSD",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"description": "Monthly run rate of memory costs",
"fill": 1,
"gridPos": {
"h": 7,
"w": 6,
"x": 6,
"y": 9
},
"id": 9,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(\n avg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730\n)",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "memory cost",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Memory Cost",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "currencyUSD",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"description": "Monthly run rate of attached disk + PV storage costs",
"fill": 1,
"gridPos": {
"h": 7,
"w": 6,
"x": 12,
"y": 9
},
"id": 10,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(\n avg(avg_over_time(pv_hourly_cost[$timeRange] offset 1m)) by (persistentvolume) * 730 \n * avg(avg_over_time(kube_persistentvolume_capacity_bytes[$timeRange] offset 1m)) by (persistentvolume) / 1024 / 1024 / 1024\n) +\nsum(avg(container_fs_limit_bytes{device!=\"tmpfs\", id=\"/\"}) by (instance) / 1024 / 1024 / 1024) * $localStorageGBCost",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "storage cost",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Storage Cost",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"description": "Sum of compute, memory, and storage costs",
"fill": 1,
"gridPos": {
"h": 7,
"w": 6,
"x": 18,
"y": 9
},
"id": 22,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": false,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "# Compute\nsum(\n avg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100) +\n avg(node_gpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n) +\n\n\n# Memory\nsum(\n avg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n) +\n\n# Storage \n\nsum(avg(pv_hourly_cost) by (persistentvolume) * 730 * avg(kube_persistentvolume_capacity_bytes) by (persistentvolume) / 1024 / 1024 / 1024) \n+\nsum(sum(container_fs_limit_bytes{device!=\"tmpfs\", id=\"/\"}) by (instance) / 1024 / 1024 / 1024) * $localStorageGBCost",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "total cost",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Total Cost",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"columns": [],
"datasource": "Prometheus",
"description": "Cost of by resource class of currently provisioned nodes",
"fontSize": "100%",
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 16
},
"id": 8,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 4,
"desc": false
},
"styles": [
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Time",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"alias": "Compute Cost",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value",
"thresholds": [],
"type": "number",
"unit": "short"
},
{
"alias": "CPU Cost",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #A",
"thresholds": [],
"type": "number",
"unit": "currencyUSD"
},
{
"alias": "Mem Cost",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #B",
"thresholds": [],
"type": "number",
"unit": "currencyUSD"
},
{
"alias": "Total",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #C",
"thresholds": [],
"type": "number",
"unit": "currencyUSD"
},
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "instance",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"alias": "GPU",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #D",
"thresholds": [],
"type": "number",
"unit": "short"
},
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "/.*/",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"expr": "avg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost or up * 0) by (node) * 730 * (1-$useDiscount/100)",
"format": "table",
"instant": true,
"intervalFactor": 1,
"legendFormat": "",
"refId": "A"
},
{
"expr": "avg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730 * (1-$useDiscount/100)",
"format": "table",
"instant": true,
"intervalFactor": 1,
"legendFormat": "",
"refId": "B"
},
{
"expr": "avg(node_gpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100)",
"format": "table",
"instant": true,
"intervalFactor": 1,
"refId": "D"
},
{
"expr": "# CPU \navg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost or up * 0) by (node) * 730 * (1-$useDiscount/100) +\n# GPU\navg(node_gpu_hourly_cost) by (node) * 730 * (1-$useDiscount/100) +\n# Memory\navg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730 * (1-$useDiscount/100)\n",
"format": "table",
"instant": true,
"intervalFactor": 1,
"refId": "C"
}
],
"title": "Cost by node",
"transform": "table",
"type": "table"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"description": "Monthly run rate of attached disk + PV storage costs based on currently provisioned resources.",
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 16
},
"id": 25,
"interval": "1m",
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "sum(\n avg(kube_node_status_capacity_cpu_cores) by (node) * avg(node_cpu_hourly_cost) by (node) * 730 +\n avg(node_gpu_hourly_cost) by (node) * 730\n)",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "cpu",
"refId": "B"
},
{
"expr": "sum(\n avg(kube_node_status_capacity_memory_bytes) by (node) / 1024 / 1024 / 1024 * avg(node_ram_hourly_cost) by (node) * 730\n)",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "memory",
"refId": "A"
},
{
"expr": "sum(\n avg(avg_over_time(pv_hourly_cost[$timeRange] offset 1m)) by (persistentvolume) * 730 \n * avg(avg_over_time(kube_persistentvolume_capacity_bytes[$timeRange] offset 1m)) by (persistentvolume) / 1024 / 1024 / 1024\n) +\nsum(avg(container_fs_limit_bytes{device!=\"tmpfs\", id=\"/\"}) by (instance) / 1024 / 1024 / 1024) * $localStorageGBCost",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "storage",
"refId": "C"
},
{
"expr": "SUM(rate(node_network_transmit_bytes_total{device=\"eth0\"}[60m]) / 1024 / 1024 / 1024 ) * (60 * 60 * 24 * 30) * $percentEgress * $egressCost ",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "network",
"refId": "D"
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Cost by Resource",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "currencyUSD",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": false,
"schemaVersion": 16,
"style": "dark",
"tags": [
"cost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"auto": true,
"auto_count": 1,
"auto_min": "1m",
"current": {
"text": "auto",
"value": "$__auto_interval_timeRange"
},
"hide": 2,
"label": null,
"name": "timeRange",
"options": [
{
"selected": true,
"text": "auto",
"value": "$__auto_interval_timeRange"
},
{
"selected": false,
"text": "1h",
"value": "1h"
},
{
"selected": false,
"text": "6h",
"value": "6h"
},
{
"selected": false,
"text": "12h",
"value": "12h"
},
{
"selected": false,
"text": "1d",
"value": "1d"
},
{
"selected": false,
"text": "7d",
"value": "7d"
},
{
"selected": false,
"text": "14d",
"value": "14d"
},
{
"selected": false,
"text": "30d",
"value": "30d"
},
{
"selected": false,
"text": "90d",
"value": "90d"
}
],
"query": "1h,6h,12h,1d,7d,14d,30d,90d",
"refresh": 2,
"skipUrlSync": false,
"type": "interval"
},
{
"current": {
"text": ".04",
"value": ".04"
},
"hide": 2,
"label": "Cost per Gb hour for attached disks",
"name": "localStorageGBCost",
"options": [
{
"selected": true,
"text": ".04",
"value": ".04"
}
],
"query": ".04",
"skipUrlSync": false,
"type": "constant"
},
{
"current": {
"tags": [],
"text": "0",
"value": "0"
},
"hide": 0,
"label": "Sustained Use Discount %",
"name": "useDiscount",
"options": [
{
"selected": true,
"text": "0",
"value": "0"
}
],
"query": "0",
"skipUrlSync": false,
"type": "constant"
},
{
"current": {
"text": ".1",
"value": ".1"
},
"hide": 2,
"label": null,
"name": "percentEgress",
"options": [
{
"selected": true,
"text": ".1",
"value": ".1"
}
],
"query": ".1",
"skipUrlSync": false,
"type": "constant"
},
{
"current": {
"text": ".12",
"value": ".12"
},
"hide": 2,
"label": null,
"name": "egressCost",
"options": [
{
"selected": true,
"text": ".12",
"value": ".12"
}
],
"query": ".12",
"skipUrlSync": false,
"type": "constant"
}
]
},
"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": "Kubecost cluster metrics",
"uid": "JOUdHGZZz",
"version": 20
}
---
# Source: cost-analyzer/templates/grafana-dashboard-cluster-utilization-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-utilization-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
cluster-utilization.json: |-
{
"annotations":{
"list":[
{
"builtIn":1,
"datasource":"-- Grafana --",
"enable":true,
"hide":true,
"iconColor":"rgba(0, 211, 255, 1)",
"name":"Annotations & Alerts",
"type":"dashboard"
}
]
},
"description":"A dashboard to help manage Kubernetes cluster costs and resources",
"editable":true,
"gnetId":6873,
"graphTooltip":0,
"id":4,
"iteration":1556759633456,
"links":[
],
"panels":[
{
"content":"This dashboard shows monthly cost estimates for the cluster, based on **current** CPU, RAM and storage provisioned.",
"gridPos":{
"h":2,
"w":24,
"x":0,
"y":0
},
"id":86,
"links":[
],
"mode":"markdown",
"title":"",
"transparent":true,
"type":"text"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":6,
"x":0,
"y":2
},
"hideTimeOverride":true,
"id":75,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"sum(\n (\n (\n sum(kube_node_status_capacity_cpu_cores) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"}) by (node)\n ) * $costpcpu\n )\n or\n (\n (\n sum(kube_node_status_capacity_cpu_cores) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"}) by (node)\n ) * ($costcpu - ($costcpu / 100 * $costDiscount))\n )\n) ",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"CPU Cost",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":6,
"x":6,
"y":2
},
"hideTimeOverride":true,
"id":77,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"sum(\n (\n (\n sum(kube_node_status_capacity_memory_bytes) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"}) by (node)\n ) /1024/1024/1024 * $costpram\n )\n or\n (\n (\n sum(kube_node_status_capacity_memory_bytes) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"}) by (node)\n ) /1024/1024/1024 * ($costram - ($costram / 100 * $costDiscount))\n)\n) ",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"RAM Cost",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":6,
"x":12,
"y":2
},
"hideTimeOverride":true,
"id":78,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n) / 1024 / 1024 /1024 * $costStorageSSD\n\n+\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n) / 1024 / 1024 /1024 * $costStorageStandard\n\n+ \n\nsum(container_fs_limit_bytes{id=\"/\"}) / 1024 / 1024 / 1024 * 1.03 * $costStorageStandard",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"Storage Cost (Cluster and PVC)",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Represents a near worst-case approximation of network costs.",
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":6,
"x":18,
"y":2
},
"hideTimeOverride":true,
"id":129,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"SUM(rate(node_network_transmit_bytes_total{device=\"eth0\"}[60m]) / 1024 / 1024 / 1024 ) * (60 * 60 * 24 * 30) * $costEgress",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"Network Egress Cost",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Current CPU use from applications divided by allocatable CPUs",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":0,
"y":6
},
"height":"180px",
"hideTimeOverride":true,
"id":82,
"interval":null,
"isNew":true,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"(\n sum(\n count(irate(container_cpu_usage_seconds_total{id=\"/\"}[10m])) by (instance)\n * on (instance) \n sum(irate(container_cpu_usage_seconds_total{id=\"/\"}[10m])) by (instance)\n ) \n / \n (sum (kube_node_status_allocatable_cpu_cores))\n) * 100",
"format":"time_series",
"interval":"",
"intervalFactor":1,
"refId":"A",
"step":10
}
],
"thresholds":"30, 80",
"timeFrom":"",
"title":"CPU Utilization",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Current CPU reservation requests from applications vs allocatable CPU",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":3,
"y":6
},
"height":"180px",
"id":91,
"interval":null,
"isNew":true,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"SUM(kube_pod_container_resource_requests_cpu_cores) / SUM(kube_node_status_allocatable_cpu_cores) * 100",
"format":"time_series",
"interval":"",
"intervalFactor":1,
"refId":"A",
"step":10
}
],
"thresholds":"30, 80",
"title":"CPU Requests",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource":"Prometheus",
"description":"Current RAM use vs RAM available",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":6,
"y":6
},
"height":"180px",
"hideTimeOverride":true,
"id":80,
"interval":null,
"isNew":true,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"SUM(container_memory_usage_bytes{namespace!=\"\"}) / SUM(kube_node_status_allocatable_memory_bytes) * 100",
"format":"time_series",
"interval":"",
"intervalFactor":1,
"refId":"A",
"step":10
},
{
"expr":"",
"format":"time_series",
"intervalFactor":1,
"refId":"B"
}
],
"thresholds":"30,80",
"timeFrom":"",
"title":"RAM Utilization",
"transparent":false,
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource":"Prometheus",
"description":"Current RAM requests vs RAM available",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":9,
"y":6
},
"height":"180px",
"id":92,
"interval":null,
"isNew":true,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"(\n sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\"})\n /\n sum(kube_node_status_allocatable_memory_bytes)\n) * 100",
"format":"time_series",
"interval":"",
"intervalFactor":1,
"refId":"A",
"step":10
}
],
"thresholds":"30,80",
"title":"RAM Requests",
"transparent":false,
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource":"Prometheus",
"decimals":2,
"description":"This gauge shows the current standard storage use, including cluster storage, vs storage available",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":12,
"y":6
},
"height":"180px",
"hideTimeOverride":true,
"id":95,
"interval":null,
"isNew":true,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim, namespace) or up * 0\n + sum(container_fs_usage_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\"})\n) /\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n + sum(container_fs_limit_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\"})\n) * 100",
"format":"time_series",
"interval":"",
"intervalFactor":1,
"refId":"A",
"step":10
}
],
"thresholds":"30, 80",
"timeFrom":"",
"title":"Storage Utilization",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"datasource":"Prometheus",
"decimals":2,
"description":"This gauge shows the current SSD use vs SSD available",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":15,
"y":6
},
"height":"180px",
"hideTimeOverride":true,
"id":96,
"interval":null,
"isNew":true,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim, namespace)\n) /\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace)\n) * 100",
"format":"time_series",
"interval":"",
"intervalFactor":1,
"refId":"A",
"step":10
}
],
"thresholds":"30, 80",
"timeFrom":"",
"title":"SSD Utilization",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Expected monthly cost given current CPU, memory storage, and network resource consumption",
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":6,
"x":18,
"y":6
},
"hideTimeOverride":true,
"id":93,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"# CPU\nsum(\n (\n (\n sum(kube_node_status_capacity_cpu_cores) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"}) by (node)\n ) * $costpcpu\n )\n or\n (\n (\n sum(kube_node_status_capacity_cpu_cores) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"}) by (node)\n ) * ($costcpu - ($costcpu / 100 * $costDiscount))\n )\n) \n\n+ \n\n# Storage\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n) / 1024 / 1024 /1024 * $costStorageSSD\n\n+\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n) / 1024 / 1024 /1024 * $costStorageStandard\n\n+ \n\nsum(container_fs_limit_bytes{id=\"/\"}) / 1024 / 1024 / 1024 * 1.03 * $costStorageStandard \n\n+\n\n# END STORAGE\n# RAM \nsum(\n (\n (\n sum(kube_node_status_capacity_memory_bytes) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"}) by (node)\n ) /1024/1024/1024 * $costpram\n )\n or\n (\n (\n sum(kube_node_status_capacity_memory_bytes) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"}) by (node)\n ) /1024/1024/1024 * ($costram - ($costram / 100 * $costDiscount))\n)\n)\n\n+\n\n#Network \nSUM(rate(node_network_transmit_bytes_total{device=\"eth0\"}[60m]) / 1024 / 1024 / 1024 ) * (60 * 60 * 24 * 30) * $costEgress",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"Total Monthly Cost",
"type":"singlestat",
"valueFontSize":"120%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"description":"Expected monthly CPU, memory and storage costs given provisioned resources",
"fill":1,
"gridPos":{
"h":8,
"w":12,
"x":0,
"y":10
},
"id":120,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":false,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"# CPU\nsum(\n (\n (\n sum(kube_node_status_capacity_cpu_cores) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"}) by (node)\n ) * $costpcpu\n )\n or\n (\n (\n sum(kube_node_status_capacity_cpu_cores) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"}) by (node)\n ) * ($costcpu - ($costcpu / 100 * $costDiscount))\n )\n) \n\n+ \n\n# Storage\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n) / 1024 / 1024 /1024 * $costStorageSSD\n\n+\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) or up * 0\n) / 1024 / 1024 /1024 * $costStorageStandard\n\n+ \n\nsum(container_fs_limit_bytes{id=\"/\"}) / 1024 / 1024 / 1024 * 1.03 * $costStorageStandard \n\n+\n\n# END STORAGE\n# RAM \nsum(\n (\n (\n sum(kube_node_status_capacity_memory_bytes) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"}) by (node)\n ) /1024/1024/1024 * $costpram\n )\n or\n (\n (\n sum(kube_node_status_capacity_memory_bytes) by (node)\n * on (node) group_left (label_cloud_google_com_gke_preemptible)\n avg(kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"}) by (node)\n ) /1024/1024/1024 * ($costram - ($costram / 100 * $costDiscount))\n)\n) \n\n+\n\n#Network \nSUM(rate(node_network_transmit_bytes_total{device=\"eth0\"}[60m]) / 1024 / 1024 / 1024 ) * (60 * 60 * 24 * 30) * $costEgress",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"cluster cost",
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Total monthly cost",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"currencyUSD",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"description":"Resources allocated to namespace based on container requests",
"fontSize":"100%",
"gridPos":{
"h":8,
"w":12,
"x":12,
"y":10
},
"hideTimeOverride":false,
"id":73,
"links":[
],
"pageSize":10,
"repeat":null,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":7,
"desc":true
},
"styles":[
{
"alias":"Namespace",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"link":true,
"linkTooltip":"View namespace cost metrics",
"linkUrl":"d/at-cost-analysis-namespace2/namespace-cost-metrics?&var-namespace=$__cell",
"pattern":"namespace",
"thresholds":[
"30",
"80"
],
"type":"string",
"unit":"currencyUSD"
},
{
"alias":"RAM",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"pattern":"Value #B",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"CPU",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"PV Storage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"Total",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #D",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"CPU Utilization",
"colorMode":"value",
"colors":[
"#bf1b00",
"rgba(50, 172, 45, 0.97)",
"#ef843c"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #E",
"thresholds":[
"30",
"80"
],
"type":"number",
"unit":"percent"
},
{
"alias":"RAM Utilization",
"colorMode":"value",
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#ef843c"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #F",
"thresholds":[
"30",
"80"
],
"type":"number",
"unit":"percent"
}
],
"targets":[
{
"expr":"(\n sum(kube_pod_container_resource_requests_cpu_cores{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible!=\"true\"}*($costcpu - ($costcpu / 100 * $costDiscount))) by(namespace)\n or\n count(\n count(container_spec_cpu_shares{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)\n\n+\n\n(\n sum(kube_pod_container_resource_requests_cpu_cores{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible=\"true\"}*$costpcpu) by(namespace)\n or\n count(\n count(container_spec_cpu_shares{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"{{ namespace }}",
"refId":"A"
},
{
"expr":"(\n sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible!=\"true\"} / 1024 / 1024 / 1024*($costram- ($costram / 100 * $costDiscount))) by (namespace) \n or\n count(\n count(container_spec_memory_limit_bytes{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)\n\n+\n\n(\n sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible=\"true\"} / 1024 / 1024 / 1024 * $costpram ) by (namespace) \n or\n count(\n count(container_spec_memory_limit_bytes{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)",
"format":"table",
"instant":true,
"intervalFactor":1,
"legendFormat":"{{ namespace }}",
"refId":"B"
},
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) \n) by (namespace) / 1024 / 1024 /1024 * $costStorageSSD \n\nor\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) \n) by (namespace) / 1024 / 1024 /1024 * $costStorageStandard",
"format":"table",
"instant":true,
"intervalFactor":1,
"legendFormat":"{{ namespace }}",
"refId":"C"
},
{
"expr":"# CPU \n(\n sum(kube_pod_container_resource_requests_cpu_cores{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible!=\"true\"}*($costcpu - ($costcpu / 100 * $costDiscount))) by(namespace)\n or\n count(\n count(container_spec_cpu_shares{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)\n\n+\n\n(\n sum(kube_pod_container_resource_requests_cpu_cores{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible=\"true\"}*$costpcpu) by(namespace)\n or\n count(\n count(container_spec_cpu_shares{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)\n\n+\n\n#END CPU \n# Memory \n\n(\n sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible!=\"true\"} / 1024 / 1024 / 1024*($costram- ($costram / 100 * $costDiscount))) by (namespace) \n or\n count(\n count(container_spec_memory_limit_bytes{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)\n\n+\n\n(\n sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\",namespace!=\"kube-system\",cloud_google_com_gke_preemptible=\"true\"} / 1024 / 1024 / 1024 * $costpram ) by (namespace) \n or\n count(\n count(container_spec_memory_limit_bytes{namespace!=\"\",namespace!=\"kube-system\"}) by(namespace)\n ) by(namespace) -1\n)\n\n+\n\n# PV storage\n\n(\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) \n) by (namespace) / 1024 / 1024 /1024 * $costStorageSSD \n\nor\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim, namespace) \n) by (namespace) / 1024 / 1024 /1024 * $costStorageStandard \n)",
"format":"table",
"instant":true,
"intervalFactor":1,
"legendFormat":"Total",
"refId":"D"
}
],
"timeFrom":"",
"timeShift":null,
"title":"Namespace cost allocation",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"collapsed":false,
"gridPos":{
"h":1,
"w":24,
"x":0,
"y":18
},
"id":108,
"panels":[
],
"title":"CPU Metrics",
"type":"row"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":8,
"w":24,
"x":0,
"y":19
},
"id":116,
"legend":{
"alignAsTable":false,
"avg":false,
"current":false,
"max":false,
"min":false,
"rightSide":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"SUM(kube_node_status_capacity_cpu_cores)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"capacity",
"refId":"A"
},
{
"expr":"SUM(kube_pod_container_resource_requests_cpu_cores)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"requests",
"refId":"C"
},
{
"expr":"SUM(irate(container_cpu_usage_seconds_total{id=\"/\"}[5m]))",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"usage",
"refId":"B"
},
{
"expr":"SUM(kube_pod_container_resource_limits_cpu_cores) ",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"limits",
"refId":"D"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Cluster CPUs",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"decimals":1,
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":8,
"w":24,
"x":0,
"y":27
},
"id":130,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"avg(irate(node_cpu_seconds_total{mode!=\"idle\"}[5m])) by (mode) * 100",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"{{mode}}",
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"CPU Mode",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"percent",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"percent",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"description":"This table shows the comparison of CPU requests and usage by namespace",
"fontSize":"100%",
"gridPos":{
"h":10,
"w":12,
"x":0,
"y":35
},
"hideTimeOverride":true,
"id":104,
"links":[
],
"pageSize":8,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":1,
"desc":true
},
"styles":[
{
"alias":"CPU Requests",
"colorMode":null,
"colors":[
"#fceaca",
"#fce2de",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
""
],
"type":"number",
"unit":"short"
},
{
"alias":"Node",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"node",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"CPU Requests",
"colorMode":"value",
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#cffaff"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
""
],
"type":"number",
"unit":"short"
},
{
"alias":"24h CPU Usage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
"30"
],
"type":"number",
"unit":"none"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"link":true,
"linkTooltip":"View namespace cost metrics",
"linkUrl":"d/at-cost-analysis-namespace2/namespace-cost-metrics?&var-namespace=$__cell",
"mappingType":1,
"pattern":"namespace",
"thresholds":[
],
"type":"number",
"unit":"short"
}
],
"targets":[
{
"expr":"sum(kube_pod_container_resource_requests_cpu_cores{namespace!=\"\"}) by (namespace) ",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"",
"refId":"A"
},
{
"expr":"sum (rate (container_cpu_usage_seconds_total{image!=\"\",namespace!=\"\"}[24h])) by (namespace)",
"format":"table",
"instant":true,
"intervalFactor":1,
"legendFormat":"{{ namespace }}",
"refId":"C"
}
],
"timeFrom":null,
"timeShift":null,
"title":"CPU request utilization by namespace",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"description":"This table shows the comparison of application CPU usage vs the capacity of the node (measured over last 60 minutes)",
"fontSize":"100%",
"gridPos":{
"h":10,
"w":12,
"x":12,
"y":35
},
"hideTimeOverride":true,
"id":90,
"links":[
],
"pageSize":8,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":2,
"desc":true
},
"styles":[
{
"alias":"CPU Request Utilization",
"colorMode":"value",
"colors":[
"#ef843c",
"rgba(50, 172, 45, 0.97)",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
".30",
" .80"
],
"type":"number",
"unit":"percentunit"
},
{
"alias":"Node",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"node",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"CPU Utilization",
"colorMode":"value",
"colors":[
"#ef843c",
"rgba(50, 172, 45, 0.97)",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
".20",
" .80"
],
"type":"number",
"unit":"percentunit"
},
{
"alias":"24h Utilization ",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value",
"thresholds":[
],
"type":"number",
"unit":"percentunit"
}
],
"targets":[
{
"expr":"SUM(\nSUM(rate(container_cpu_usage_seconds_total[24h])) by (pod_name)\n* on (pod_name) group_left (node) \nlabel_replace(\n avg(kube_pod_info{}),\n \"pod_name\", \n \"$1\", \n \"pod\", \n \"(.+)\"\n)\n) by (node) \n/ \nsum(kube_node_status_capacity_cpu_cores) by (node)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"B"
},
{
"expr":"sum(kube_pod_container_resource_requests_cpu_cores) by (node) / sum(kube_node_status_capacity_cpu_cores) by (node)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"A"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Cluster cost & utilization by node",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"collapsed":false,
"gridPos":{
"h":1,
"w":24,
"x":0,
"y":45
},
"id":113,
"panels":[
],
"title":"Memory Metrics",
"type":"row"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":8,
"w":24,
"x":0,
"y":46
},
"id":117,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":false,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"SUM(kube_node_status_capacity_memory_bytes / 1024 / 1024 / 1024)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"capacity",
"refId":"A"
},
{
"expr":"SUM(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\"} / 1024 / 1024 / 1024)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"requests",
"refId":"C"
},
{
"expr":"SUM(container_memory_usage_bytes{image!=\"\"} / 1024 / 1024 / 1024)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"usage",
"refId":"B"
},
{
"expr":"SUM(kube_pod_container_resource_limits_memory_bytes {namespace!=\"\"} / 1024 / 1024 / 1024)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"limits",
"refId":"D"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Cluster memory (GB)",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"decgbytes",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":8,
"w":24,
"x":0,
"y":54
},
"id":131,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":false,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"1 - sum(node_memory_MemAvailable_bytes) by (node) / sum(node_memory_MemTotal_bytes) by (node)",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"usage",
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Cluster Memory Utilization",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"percentunit",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"description":"Comparison of memory requests and current usage by namespace",
"fontSize":"100%",
"gridPos":{
"h":10,
"w":12,
"x":0,
"y":62
},
"hideTimeOverride":true,
"id":109,
"links":[
],
"pageSize":7,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":1,
"desc":true
},
"styles":[
{
"alias":"Mem Requests (GB)",
"colorMode":null,
"colors":[
"#fceaca",
"#fce2de",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
""
],
"type":"number",
"unit":"short"
},
{
"alias":"Node",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"node",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"CPU Requests",
"colorMode":"value",
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#cffaff"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
""
],
"type":"number",
"unit":"short"
},
{
"alias":"24h Mem Usage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"#508642",
"#e5ac0e"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
".30",
".75"
],
"type":"number",
"unit":"none"
},
{
"alias":"Namespace",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"link":true,
"linkTooltip":"View namespace cost metrics",
"linkUrl":"d/at-cost-analysis-namespace2/namespace-cost-metrics?&var-namespace=$__cell",
"mappingType":1,
"pattern":"namespace",
"thresholds":[
],
"type":"number",
"unit":"short"
}
],
"targets":[
{
"expr":"sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\"} / 1024 / 1024 / 1024) by (namespace) ",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"",
"refId":"A"
},
{
"expr":"SUM(container_memory_usage_bytes{image!=\"\",namespace!=\"\"} / 1024 / 1024 / 1024) by (namespace)",
"format":"table",
"instant":true,
"intervalFactor":1,
"legendFormat":"",
"refId":"C"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Memory requests & utilization by namespace",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"description":"Container RAM usage vs node capacity",
"fontSize":"100%",
"gridPos":{
"h":10,
"w":12,
"x":12,
"y":62
},
"hideTimeOverride":true,
"id":114,
"links":[
],
"pageSize":8,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":1,
"desc":true
},
"styles":[
{
"alias":"RAM Requests",
"colorMode":"value",
"colors":[
"#ef843c",
"rgba(50, 172, 45, 0.97)",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
"30",
" 80"
],
"type":"number",
"unit":"percentunit"
},
{
"alias":"Node",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"node",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"RAM Usage",
"colorMode":"value",
"colors":[
"#ef843c",
"rgba(50, 172, 45, 0.97)",
"rgba(245, 54, 54, 0.9)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
"25",
" 80"
],
"type":"number",
"unit":"percent"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"",
"thresholds":[
],
"type":"number",
"unit":"short"
}
],
"targets":[
{
"expr":"SUM(label_replace(container_memory_usage_bytes{namespace!=\"\"}, \"node\", \"$1\", \"instance\",\"(.+)\")) by (node) * 100\n/\nSUM(kube_node_status_capacity_memory_bytes) by (node)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"B"
},
{
"expr":"sum(kube_pod_container_resource_requests_memory_bytes{namespace!=\"\"}) by (node) / SUM(kube_node_status_capacity_memory_bytes) by (node)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"A"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Node utilization of allocatable RAM",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"collapsed":false,
"gridPos":{
"h":1,
"w":24,
"x":0,
"y":72
},
"id":101,
"panels":[
],
"title":"Storage Metrics",
"type":"row"
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"fontSize":"100%",
"gridPos":{
"h":9,
"w":12,
"x":0,
"y":73
},
"hideTimeOverride":true,
"id":97,
"links":[
],
"pageSize":8,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":4,
"desc":true
},
"styles":[
{
"alias":"Node",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"instance",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"PVC Name",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"persistentvolumeclaim",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Storage Class",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"storageclass",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Cost",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"Cost",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"Size (GB)",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Usage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
],
"type":"number",
"unit":"percentunit"
}
],
"targets":[
{
"expr":"SUM(container_fs_limit_bytes{id=\"/\"}) by (instance) / 1024 / 1024 / 1024 * 1.03",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"B"
},
{
"expr":"SUM(container_fs_limit_bytes{id=\"/\"}) by (instance) / 1024 / 1024 / 1024 * 1.03 * $costStorageStandard\n",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"{{ persistentvolumeclaim }}",
"refId":"A"
},
{
"expr":"sum(container_fs_usage_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\"} / container_fs_limit_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\"}) by (instance) \n",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"C"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Local Storage",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":9,
"w":12,
"x":12,
"y":73
},
"id":128,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"SUM(container_fs_usage_bytes{id=\"/\"}) / SUM(container_fs_limit_bytes{id=\"/\"})",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"reads",
"refId":"D"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Local storage utilization",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"percent",
"label":"IOPS",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"fontSize":"100%",
"gridPos":{
"h":10,
"w":12,
"x":0,
"y":82
},
"hideTimeOverride":true,
"id":94,
"links":[
],
"pageSize":10,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":2,
"desc":true
},
"styles":[
{
"alias":"Namespace",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"link":true,
"linkTooltip":"View namespace cost metrics",
"linkUrl":"d/at-cost-analysis-namespace2/namespace-cost-metrics?&var-namespace=$__cell",
"mappingType":1,
"pattern":"namespace",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"PVC Name",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"persistentvolumeclaim",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Storage Class",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"storageclass",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Cost",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"Cost",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"Usage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
],
"type":"number",
"unit":"percentunit"
},
{
"alias":"Size (GB)",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
],
"type":"number",
"unit":"short"
}
],
"targets":[
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n * on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024\n\nor\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n * on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024\n\n\n",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"C"
},
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n * on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024 * $costStorageSSD\n\nor\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n * on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024 * $costStorageStandard\n",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"{{ persistentvolumeclaim }}",
"refId":"A"
},
{
"expr":"sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim, namespace) \n/\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n * on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"B"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Persistent Volume Claims",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":10,
"w":12,
"x":12,
"y":82
},
"id":132,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"SUM(rate(node_disk_reads_completed_total[10m])) or SUM(rate(node_disk_reads_completed[10m]))\n",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"reads",
"refId":"D"
},
{
"expr":"SUM(rate(node_disk_writes_completed_total[10m])) or SUM(rate(node_disk_writes_completed[10m]))",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"writes",
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Disk IOPS",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"none",
"label":"IOPS",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":9,
"w":24,
"x":0,
"y":92
},
"id":122,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"SUM( kubelet_volume_stats_inodes_used / kubelet_volume_stats_inodes) by (persistentvolumeclaim) * 100",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"",
"refId":"D"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Inode usage",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"percent",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"collapsed":false,
"gridPos":{
"h":1,
"w":24,
"x":0,
"y":101
},
"id":127,
"panels":[
],
"title":"Network",
"type":"row"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":9,
"w":24,
"x":0,
"y":102
},
"id":123,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (node_network_transmit_bytes_total{}[60m]))\n",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"node_out",
"refId":"B"
},
{
"expr":"SUM ( rate(node_network_transmit_bytes_total{device=\"eth0\"}[60m]))",
"format":"time_series",
"instant":false,
"intervalFactor":1,
"legendFormat":"eth0 out",
"refId":"C"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Node network transmit",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"decbytes",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
}
],
"refresh":"15m",
"schemaVersion":16,
"style":"dark",
"tags":[
"cost",
"utilization",
"metrics"
],
"templating":{
"list":[
{
"current":{
"text":"23.076",
"value":"23.076"
},
"hide":0,
"label":"CPU",
"name":"costcpu",
"options":[
{
"text":"23.076",
"value":"23.076"
}
],
"query":"23.076",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"5.10",
"value":"5.10"
},
"hide":0,
"label":"PE CPU",
"name":"costpcpu",
"options":[
{
"text":"5.10",
"value":"5.10"
}
],
"query":"5.10",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"3.25",
"value":"3.25"
},
"hide":0,
"label":"RAM",
"name":"costram",
"options":[
{
"text":"3.25",
"value":"3.25"
}
],
"query":"3.25",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"0.6862",
"value":"0.6862"
},
"hide":0,
"label":"PE RAM",
"name":"costpram",
"options":[
{
"text":"0.6862",
"value":"0.6862"
}
],
"query":"0.6862",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"0.040",
"value":"0.040"
},
"hide":0,
"label":"Storage",
"name":"costStorageStandard",
"options":[
{
"text":"0.040",
"value":"0.040"
}
],
"query":"0.040",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":".17",
"value":".17"
},
"hide":0,
"label":"SSD",
"name":"costStorageSSD",
"options":[
{
"text":".17",
"value":".17"
}
],
"query":".17",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":".12",
"value":".12"
},
"hide":0,
"label":"Egress",
"name":"costEgress",
"options":[
{
"selected":true,
"text":".12",
"value":".12"
}
],
"query":".12",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"30",
"value":"30"
},
"hide":0,
"label":"Discount",
"name":"costDiscount",
"options":[
{
"text":"30",
"value":"30"
}
],
"query":"30",
"skipUrlSync":false,
"type":"constant"
}
]
},
"time":{
"from":"now-24h",
"to":"now"
},
"timepicker":{
"hidden":false,
"refresh_intervals":[
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options":[
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone":"browser",
"title":"Cluster cost & utilization metrics",
"uid":"cluster-costs",
"version":1
}
---
# Source: cost-analyzer/templates/grafana-dashboard-deployment-utilization-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: deployment-utilization-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
deployment-utilization.json: |-
{
"annotations":{
"list":[
{
"builtIn":1,
"datasource":"-- Grafana --",
"enable":true,
"hide":true,
"iconColor":"rgba(0, 211, 255, 1)",
"name":"Annotations & Alerts",
"type":"dashboard"
}
]
},
"description":"Monitors Kubernetes deployments in cluster using Prometheus and kube-state-metrics. Shows resource utilization of deployments, daemonsets, and statefulsets.",
"editable":true,
"gnetId":8588,
"graphTooltip":0,
"id":9,
"iteration":1550606633321,
"links":[
],
"panels":[
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":8,
"x":0,
"y":0
},
"height":"180px",
"id":1,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (container_memory_working_set_bytes{pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\", kubernetes_io_hostname=~\"^$Node$\", pod_name!=\"\"}) / sum (kube_node_status_allocatable_memory_bytes{node=~\"^$Node.*$\"}) * 100",
"format":"time_series",
"interval":"10s",
"intervalFactor":1,
"refId":"A",
"step":900
}
],
"thresholds":"65, 90",
"title":"Deployment memory usage",
"transparent":false,
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource":"Prometheus",
"decimals":2,
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":8,
"x":8,
"y":0
},
"height":"180px",
"id":2,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (rate (container_cpu_usage_seconds_total{pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\", kubernetes_io_hostname=~\"^$Node$\"}[2m])) / sum (machine_cpu_cores{kubernetes_io_hostname=~\"^$Node$\"}) * 100",
"format":"time_series",
"interval":"10s",
"intervalFactor":1,
"refId":"A",
"step":900
}
],
"thresholds":"65, 90",
"title":"Deployment CPU usage",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":true,
"colors":[
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"percent",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":8,
"x":16,
"y":0
},
"height":"180px",
"id":3,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"(((sum(kube_deployment_status_replicas{deployment=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_statefulset_replicas{statefulset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_daemonset_status_desired_number_scheduled{daemonset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0))) - ((sum(kube_deployment_status_replicas_available{deployment=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_statefulset_status_replicas{statefulset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_daemonset_status_number_ready{daemonset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)))) / ((sum(kube_deployment_status_replicas{deployment=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_statefulset_replicas{statefulset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_daemonset_status_desired_number_scheduled{daemonset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0))) * 100",
"format":"time_series",
"intervalFactor":2,
"refId":"A",
"step":1800
}
],
"thresholds":"1,30",
"title":"Unavailable Replicas",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":3,
"w":4,
"x":0,
"y":5
},
"height":"100px",
"id":4,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (container_memory_working_set_bytes{pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\", kubernetes_io_hostname=~\"^$Node$\", pod_name!=\"\"})",
"format":"time_series",
"intervalFactor":2,
"refId":"A",
"step":1800
}
],
"thresholds":"",
"title":"Used",
"type":"singlestat",
"valueFontSize":"50%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":3,
"w":4,
"x":4,
"y":5
},
"height":"100px",
"id":5,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (kube_node_status_allocatable_memory_bytes{node=~\"^$Node.*$\"})",
"format":"time_series",
"intervalFactor":2,
"refId":"A",
"step":1800
}
],
"thresholds":"",
"title":"Total",
"type":"singlestat",
"valueFontSize":"50%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":3,
"w":4,
"x":8,
"y":5
},
"height":"100px",
"id":6,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":" cores",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (rate (container_cpu_usage_seconds_total{pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\", kubernetes_io_hostname=~\"^$Node$\"}[1m]))",
"format":"time_series",
"intervalFactor":2,
"refId":"A",
"step":1800
}
],
"thresholds":"",
"title":"Used",
"type":"singlestat",
"valueFontSize":"50%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":3,
"w":4,
"x":12,
"y":5
},
"height":"100px",
"id":7,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":" cores",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum (machine_cpu_cores{kubernetes_io_hostname=~\"^$Node$\"})",
"intervalFactor":2,
"refId":"A",
"step":1800
}
],
"thresholds":"",
"title":"Total",
"type":"singlestat",
"valueFontSize":"50%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"avg"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":3,
"w":4,
"x":16,
"y":5
},
"height":"100px",
"id":8,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"(sum(kube_deployment_status_replicas_available{deployment=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_statefulset_status_replicas{statefulset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_daemonset_status_number_ready{daemonset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0))",
"format":"time_series",
"intervalFactor":2,
"refId":"A",
"step":1800
}
],
"thresholds":"",
"title":"Available (cluster)",
"type":"singlestat",
"valueFontSize":"50%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"datasource":"Prometheus",
"editable":true,
"error":false,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":3,
"w":4,
"x":20,
"y":5
},
"height":"100px",
"id":9,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"(sum(kube_deployment_status_replicas{deployment=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_statefulset_replicas{statefulset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0)) + (sum(kube_daemonset_status_desired_number_scheduled{daemonset=~\".*$Deployment$Statefulset$Daemonset\"}) or vector(0))",
"format":"time_series",
"intervalFactor":2,
"legendFormat":"{{ $Daemonset }}",
"refId":"A",
"step":1800
}
],
"thresholds":"",
"title":"Total (cluster)",
"type":"singlestat",
"valueFontSize":"50%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":3,
"editable":true,
"error":false,
"fill":0,
"grid":{
},
"gridPos":{
"h":11,
"w":24,
"x":0,
"y":8
},
"height":"",
"id":10,
"legend":{
"alignAsTable":true,
"avg":false,
"current":true,
"hideEmpty":false,
"hideZero":false,
"max":true,
"min":false,
"rightSide":true,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
{
"alias":"/avlbl.*/",
"yaxis":2
}
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (container_cpu_usage_seconds_total{image!=\"\",name=~\"^k8s_.*\",io_kubernetes_container_name!=\"POD\",pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\",kubernetes_io_hostname=~\"^$Node$\"}[1m])) by (pod_name,kubernetes_io_hostname)",
"format":"time_series",
"hide":false,
"interval":"10s",
"intervalFactor":1,
"legendFormat":"usage: {{ kubernetes_io_hostname }} | {{ pod_name }} ",
"metric":"container_cpu",
"refId":"A",
"step":60
},
{
"expr":"sum (kube_pod_container_resource_requests_cpu_cores{pod=~\"^$Deployment$Statefulset$Daemonset.*$\",node=~\"^$Node$\"}) by (pod,node)",
"format":"time_series",
"hide":false,
"intervalFactor":2,
"legendFormat":"rqst: {{ node }} | {{ pod }}",
"refId":"B",
"step":120
},
{
"expr":"sum ((kube_node_status_allocatable_cpu_cores{node=~\"^$Node$\"})) by (node)",
"format":"time_series",
"hide":true,
"intervalFactor":2,
"legendFormat":"avlbl: {{ node }}",
"refId":"C",
"step":30
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"CPU usage & requests",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"none",
"label":"cores",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"editable":true,
"error":false,
"fill":0,
"grid":{
},
"gridPos":{
"h":13,
"w":24,
"x":0,
"y":19
},
"id":11,
"legend":{
"alignAsTable":true,
"avg":false,
"current":true,
"max":true,
"min":false,
"rightSide":true,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
{
"alias":"/^avlbl.*$/",
"yaxis":2
}
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (container_memory_working_set_bytes{id!=\"/\",pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\",kubernetes_io_hostname=~\"^$Node$\"}) by (pod_name,kubernetes_io_hostname)",
"format":"time_series",
"hide":false,
"interval":"10s",
"intervalFactor":1,
"legendFormat":"usage: {{kubernetes_io_hostname }} | {{ pod_name }}",
"metric":"container_memory_usage:sort_desc",
"refId":"A",
"step":60
},
{
"expr":"sum ((kube_pod_container_resource_requests_memory_bytes{pod=~\"^$Deployment$Statefulset$Daemonset.*$\",node=~\"^$Node$\"})) by (pod,node)",
"format":"time_series",
"intervalFactor":2,
"legendFormat":"rqst: {{ node }} | {{ pod }}",
"refId":"B",
"step":120
},
{
"expr":"sum ((kube_node_status_allocatable_memory_bytes{node=~\"^$Node$\"})) by (node)",
"format":"time_series",
"hide":true,
"intervalFactor":2,
"legendFormat":"avlbl: {{ node }}",
"refId":"C",
"step":30
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Memory usage & requests",
"tooltip":{
"msResolution":false,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"bytes",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"bytes",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"fill":1,
"gridPos":{
"h":9,
"w":24,
"x":0,
"y":32
},
"id":12,
"legend":{
"alignAsTable":true,
"avg":false,
"current":true,
"max":false,
"min":false,
"rightSide":true,
"show":true,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"100 * (kubelet_volume_stats_used_bytes{kubernetes_io_hostname=~\"^$Node$\", persistentvolumeclaim=~\".*$Deployment$Statefulset$Daemonset.*$\"} / kubelet_volume_stats_capacity_bytes{kubernetes_io_hostname=~\"^$Node$\", persistentvolumeclaim=~\".*$Deployment$Statefulset$Daemonset.*$\"})",
"format":"time_series",
"intervalFactor":2,
"legendFormat":"{{ persistentvolumeclaim }} | {{ kubernetes_io_hostname }}",
"refId":"A",
"step":120
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Disk Usage",
"tooltip":{
"shared":true,
"sort":2,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"percent",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"editable":true,
"error":false,
"fill":1,
"grid":{
},
"gridPos":{
"h":13,
"w":24,
"x":0,
"y":41
},
"id":13,
"legend":{
"alignAsTable":true,
"avg":true,
"current":true,
"max":true,
"min":false,
"rightSide":true,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (container_network_receive_bytes_total{id!=\"/\",pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\",kubernetes_io_hostname=~\"^$Node$\"}[2m])) by (pod_name, kubernetes_io_hostname)",
"format":"time_series",
"interval":"10s",
"intervalFactor":1,
"legendFormat":"-> {{ kubernetes_io_hostname }} | {{ pod_name }}",
"metric":"network",
"refId":"A",
"step":60
},
{
"expr":"- sum( rate (container_network_transmit_bytes_total{id!=\"/\",pod_name=~\"^$Deployment$Statefulset$Daemonset.*$\",kubernetes_io_hostname=~\"^$Node$\"}[2m])) by (pod_name, kubernetes_io_hostname)",
"format":"time_series",
"interval":"10s",
"intervalFactor":1,
"legendFormat":"<- {{ kubernetes_io_hostname }} | {{ pod_name }}",
"metric":"network",
"refId":"B",
"step":60
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"All processes network I/O",
"tooltip":{
"msResolution":false,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"Bps",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
}
],
"refresh":false,
"schemaVersion":16,
"style":"dark",
"tags":[
"kubernetes",
"deployment"
],
"templating":{
"list":[
{
"allValue":"()",
"current":{
"tags":[
],
"text":"All",
"value":"$__all"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":null,
"multi":false,
"name":"Deployment",
"options":[
],
"query":"label_values(deployment)",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"allValue":"()",
"current":{
"text":"All",
"value":"$__all"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":null,
"multi":false,
"name":"Statefulset",
"options":[
],
"query":"label_values(statefulset)",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"allValue":"()",
"current":{
"tags":[
],
"text":"aws-node",
"value":"aws-node"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":null,
"multi":false,
"name":"Daemonset",
"options":[
],
"query":"label_values(daemonset)",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"allValue":".*",
"current":{
"text":"All",
"value":"$__all"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":null,
"multi":false,
"name":"Node",
"options":[
],
"query":"label_values(kubernetes_io_hostname)",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
}
]
},
"time":{
"from":"2019-02-05T22:22:45.431Z",
"to":"2019-02-19T22:22:45.431Z"
},
"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":"browser",
"title":"Deployment/Statefulset/Daemonset utilization metrics",
"uid":"deployment-metrics",
"version":1
}
---
# Source: cost-analyzer/templates/grafana-dashboard-label-cost-utilization-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: label-cost-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
label-cost-utilization.json: |-
{
"annotations":{
"list":[
{
"builtIn":1,
"datasource":"-- Grafana --",
"enable":true,
"hide":true,
"iconColor":"rgba(0, 211, 255, 1)",
"name":"Annotations & Alerts",
"type":"dashboard"
}
]
},
"editable":true,
"gnetId":null,
"graphTooltip":0,
"id":5,
"iteration":1542347581633,
"links":[
],
"panels":[
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Based on CPU usage over last 24 hours",
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":6,
"x":0,
"y":0
},
"hideTimeOverride":true,
"id":15,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"sum(\n label_replace(\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[24h])) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 23.076\n\n+ \n\nsum(\n label_replace(\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[24h])) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 5.1",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"CPU Cost",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Based on CPU usage over last 24 hours",
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":6,
"x":6,
"y":0
},
"hideTimeOverride":true,
"id":16,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"sum(\n label_replace(\n sum(container_memory_working_set_bytes{image!=\"\",container_name!=\"POD\"}) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 4 / 1024 / 1024 / 1024\n\n+ \n\nsum(\n label_replace(\n sum(container_memory_working_set_bytes{image!=\"\",container_name!=\"POD\"}) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 11 / 1024 / 1024 / 1024",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"Memory Cost",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"description":"",
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":6,
"x":12,
"y":0
},
"hideTimeOverride":true,
"id":21,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"sum(\n sum(kube_persistentvolumeclaim_info{storageclass!=\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) / 1024 / 1024 /1024 * .04 \n\n+\n\nsum(\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) / 1024 / 1024 /1024 * .17 \n",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"Storage Cost",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"description":"Cost of memory + CPU usage",
"format":"currencyUSD",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":5,
"w":6,
"x":18,
"y":0
},
"hideTimeOverride":true,
"id":20,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"label_cloud_google_com_gke_preemptible",
"targets":[
{
"expr":"# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CPU ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nsum(\n label_replace(\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[24h])) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 23.076\n\n+ \n\nsum(\n label_replace(\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[24h])) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 5.1\n\n#END CPU\n+\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nsum(\n label_replace(\n sum(container_memory_working_set_bytes{image!=\"\",container_name!=\"POD\"}) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible!=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 4 / 1024 / 1024 / 1024\n\n+ \n\nsum(\n label_replace(\n sum(container_memory_working_set_bytes{image!=\"\",container_name!=\"POD\"}) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) * on (node) group_left (label_cloud_google_com_gke_preemptible)\n kube_node_labels{label_cloud_google_com_gke_preemptible=\"true\"} \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) * 11 / 1024 / 1024 / 1024\n\n# END MEMORY\n\n+\n\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ STORAGE ~~~~~~~~~~~~~~~~~~~~~~~~~\n\nsum(\n sum(kube_persistentvolumeclaim_info{storageclass!=\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) / 1024 / 1024 /1024 * .04 \n\n+\n\nsum(\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) / 1024 / 1024 /1024 * .17 \n\n\n# END STORAGE\n",
"format":"time_series",
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":" {{ node }}",
"refId":"A"
}
],
"thresholds":"",
"timeFrom":"15m",
"timeShift":null,
"title":"Total Cost",
"type":"singlestat",
"valueFontSize":"110%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":0,
"y":5
},
"id":10,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":" cores",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n sum (kube_pod_container_resource_requests_cpu_cores) by (pod)\n * on (pod) group_left()\n kube_pod_labels{label_$label=~\"$label_value\"}\n or up * 0\n) ",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"CPU Request",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":2,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":3,
"y":5
},
"id":17,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":" cores",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n label_replace(\n sum(rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[1h])) by (kubernetes_io_hostname,pod_name),\n \"node\",\n \"$1\", \n \"kubernetes_io_hostname\", \n \"(.+)\"\n ) \n * on (pod_name) group_left()\n label_replace(\n sum(kube_pod_labels{label_$label=~\"$label_value\"}) by (pod),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\"\n ) or up * 0\n) ",
"format":"time_series",
"intervalFactor":2,
"refId":"A"
}
],
"thresholds":"",
"title":"CPU Used",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":0,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":6,
"y":5
},
"id":11,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":true,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n sum (kube_pod_container_resource_requests_memory_bytes) by (pod)\n * on (pod) group_left()\n kube_pod_labels{label_$label=~\"$label_value\"}\n or up * 0\n) ",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Memory Request",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":9,
"y":5
},
"id":18,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n label_replace(\n sum (container_memory_working_set_bytes{pod_name!=\"\"}) by (pod_name),\n \"pod\",\n \"$1\", \n \"pod_name\", \n \"(.+)\")\n * on (pod) group_left()\n kube_pod_labels{label_$label=~\"$label_value\"} \n or up * 0\n)",
"format":"time_series",
"instant":true,
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Memory Usage",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":0,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":12,
"y":5
},
"id":22,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n sum(kube_persistentvolumeclaim_info{storageclass!=\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) \n\n+\n\nsum(\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) \n",
"format":"time_series",
"instant":true,
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Storage Request",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":"Prometheus",
"decimals":0,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":3,
"x":15,
"y":5
},
"id":23,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n sum(kube_persistentvolumeclaim_info{storageclass!=\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) \n\n+\n\nsum(\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, storageclass)\n * on (persistentvolumeclaim) group_right(storageclass)\n sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim)\n * on (persistentvolumeclaim) group_left(label_app)\n kube_persistentvolumeclaim_labels{label_$label=~\"$label_value\"} or up * 0\n) \n",
"format":"time_series",
"instant":true,
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Storage Used",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":null,
"fill":1,
"gridPos":{
"h":8,
"w":12,
"x":0,
"y":9
},
"id":8,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum(\n label_replace(\n sum (kube_pod_container_resource_limits_cpu_cores) by (pod, container)\n * on (pod) group_left()\n kube_pod_labels{label_$label=~\"$label_value\"},\n \"container_name\",\n \"$1\", \n \"container\", \n \"(.+)\"\n )\n) \n",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"limit",
"refId":"C"
},
{
"expr":"sum(\n label_replace(\n sum (kube_pod_container_resource_requests_cpu_cores) by (pod, container)\n * on (pod) group_left()\n kube_pod_labels{label_$label=~\"$label_value\"},\n \"container_name\",\n \"$1\", \n \"container\", \n \"(.+)\"\n )\n) \n",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"request",
"refId":"B"
},
{
"expr":"sum(\n label_replace(\n sum (rate (container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[10m])) by (container_name,pod_name),\n \"pod\", \n \"$1\", \n \"pod_name\", \n \"(.+)\"\n )\n * on (pod) group_left (label_app)\n kube_pod_labels{label_$label=~\"$label_value\"}\n)\n",
"format":"time_series",
"intervalFactor":1,
"legendFormat":"usage",
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"CPU Usage vs Requests vs Limits",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":"0",
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":null,
"fill":1,
"gridPos":{
"h":8,
"w":12,
"x":12,
"y":9
},
"id":12,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum(\nlabel_replace(\nsum (rate (container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\"}[10m])) by (container_name,pod_name),\n\"pod\", \n \"$1\", \n \"pod_name\", \n \"(.+)\"\n)\n* on (pod) group_left (label_app)\n kube_pod_labels{label_app=~\"$label_value\"}\n ) by (container_name,pod)\n",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Container CPU Utilization",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"percentunit",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"description":"This table shows the comparison of CPU requests and usage by namespace",
"fontSize":"100%",
"gridPos":{
"h":8,
"w":12,
"x":0,
"y":17
},
"hideTimeOverride":true,
"id":4,
"links":[
],
"pageSize":8,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":3,
"desc":true
},
"styles":[
{
"alias":"Node",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"node",
"thresholds":[
],
"type":"string",
"unit":"short"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"CPU Requests",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#cffaff"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
""
],
"type":"number",
"unit":"short"
},
{
"alias":"Request Utilization",
"colorMode":"value",
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
"30"
],
"type":"number",
"unit":"percentunit"
},
{
"alias":"Utilization",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"#3f6833",
"#cca300"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
"20",
"90"
],
"type":"number",
"unit":"percentunit"
}
],
"targets":[
{
"expr":"sum(\nsum (rate (container_cpu_usage_seconds_total{image!=\"\",container_name!=\"POD\",pod_name!=\"\"}[10m])) by (container_name,pod_name)\n* on (pod_name) group_left (label_$label)\nlabel_replace(\n kube_pod_labels{label_$label=~\"$label_value\"},\n \"pod_name\", \n \"$1\", \n \"pod\", \n \"(.+)\"\n)) by (container_name,pod_name)",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"",
"refId":"A"
},
{
"expr":"sum(\n label_replace(\n label_replace(\n sum (kube_pod_container_resource_requests_cpu_cores) by (pod, container),\n \"container_name\",\n \"$1\", \n \"container\", \n \"(.+)\"),\n \"pod_name\",\n \"$1\", \n \"pod\", \n \"(.+)\")\n * on (pod) group_left()\n kube_pod_labels{label_$label=~\"$label_value\"}\n) by (pod_name,container_name)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"B"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Average CPU usage by container",
"transform":"table",
"transparent":false,
"type":"table"
}
],
"refresh":false,
"schemaVersion":16,
"style":"dark",
"tags":[
"cost",
"utilization",
"metrics"
],
"templating":{
"list":[
{
"datasource":"Prometheus",
"filters":[
],
"hide":0,
"label":"",
"name":"Filters",
"skipUrlSync":false,
"type":"adhoc"
},
{
"allValue":null,
"current":{
"tags":[
],
"text":"app",
"value":"app"
},
"hide":0,
"includeAll":false,
"label":"Label",
"multi":false,
"name":"label",
"options":[
{
"selected":false,
"text":"app",
"value":"app"
},
{
"selected":false,
"text":"tier",
"value":"tier"
},
{
"selected":false,
"text":"component",
"value":"component"
},
{
"selected":true,
"text":"release",
"value":"release"
},
{
"selected":false,
"text":"name",
"value":"name"
},
{
"selected":false,
"text":"team",
"value":"team"
},
{
"selected":false,
"text":"department",
"value":"department"
},
{
"selected":false,
"text":"owner",
"value":"owner"
},
{
"selected":false,
"text":"contact",
"value":"contact"
}
],
"query":"app, tier, component, release, name, team, department, owner, contact",
"skipUrlSync":false,
"type":"custom"
},
{
"allValue":".*",
"current":{
"text":"redis",
"value":"redis"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":"Value",
"multi":false,
"name":"label_value",
"options":[
],
"query":"query_result(SUM(kube_pod_labels{label_$label!=\"\",namespace!=\"kube-system\"}) by (label_$label))",
"refresh":1,
"regex":"/label_$label=\\\"(.*?)(\\\")/",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"allValue":"()",
"current":{
"text":"cost-analyzer-grafana",
"value":"cost-analyzer-grafana"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":"",
"multi":false,
"name":"Deployments",
"options":[
],
"query":"label_values(deployment)",
"refresh":1,
"regex":"",
"skipUrlSync":false,
"sort":1,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"allValue":null,
"current":{
"tags":[
],
"text":"All",
"value":"$__all"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":true,
"label":null,
"multi":false,
"name":"Secondary",
"options":[
{
"selected":true,
"text":"All",
"value":"$__all"
},
{
"selected":false,
"text":"app",
"value":"app"
},
{
"selected":false,
"text":"component",
"value":"component"
},
{
"selected":false,
"text":"controller_revision_hash",
"value":"controller_revision_hash"
},
{
"selected":false,
"text":"k8s_app",
"value":"k8s_app"
}
],
"query":"query_result(kube_pod_labels)",
"refresh":0,
"regex":"/.+?label_([^=]*).*/",
"skipUrlSync":false,
"sort":1,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
}
]
},
"time":{
"from":"now-6h",
"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":"Label costs & utilization",
"uid":"lWMhIA-ik",
"version":28
}
---
# Source: cost-analyzer/templates/grafana-dashboard-namespace-utilization-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: namespace-utilization-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
namespace-utilization.json: |-
{
"annotations":{
"list":[
{
"builtIn":1,
"datasource":"-- Grafana --",
"enable":true,
"hide":true,
"iconColor":"rgba(0, 211, 255, 1)",
"name":"Annotations & Alerts",
"type":"dashboard"
}
]
},
"description":"A dashboard to help with utilization and resource allocation",
"editable":true,
"gnetId":8673,
"graphTooltip":0,
"id":9,
"iteration":1553150922105,
"links":[
],
"panels":[
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"fontSize":"100%",
"gridPos":{
"h":9,
"w":16,
"x":0,
"y":0
},
"hideTimeOverride":true,
"id":73,
"links":[
],
"pageSize":8,
"repeat":null,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":2,
"desc":false
},
"styles":[
{
"alias":"Pod",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"link":false,
"linkTooltip":"",
"linkUrl":"",
"pattern":"pod_name",
"thresholds":[
"30",
"80"
],
"type":"string",
"unit":"currencyUSD"
},
{
"alias":"RAM",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"pattern":"Value #B",
"thresholds":[
],
"type":"number",
"unit":"decbytes"
},
{
"alias":"CPU %",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
],
"type":"number",
"unit":"percent"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"Storage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"Total",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #D",
"thresholds":[
],
"type":"number",
"unit":"currencyUSD"
},
{
"alias":"CPU Utilization",
"colorMode":"value",
"colors":[
"#bf1b00",
"rgba(50, 172, 45, 0.97)",
"#ef843c"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #E",
"thresholds":[
"30",
"80"
],
"type":"number",
"unit":"percent"
},
{
"alias":"RAM Utilization",
"colorMode":"value",
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#ef843c"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #F",
"thresholds":[
"30",
"80"
],
"type":"number",
"unit":"percent"
}
],
"targets":[
{
"expr":"sum (rate (container_cpu_usage_seconds_total{namespace=\"$namespace\"}[10m])) by (pod_name) * 100",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"{{ pod_name }}",
"refId":"A"
},
{
"expr":"sum (avg_over_time (container_memory_working_set_bytes{namespace=\"$namespace\", container_name!=\"POD\"}[10m])) by (pod_name)",
"format":"table",
"hide":false,
"instant":true,
"intervalFactor":1,
"legendFormat":"{{ pod_name }}",
"refId":"B"
}
],
"timeFrom":"1M",
"timeShift":null,
"title":"Pod utilization analysis",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"fontSize":"100%",
"gridPos":{
"h":9,
"w":8,
"x":16,
"y":0
},
"hideTimeOverride":true,
"id":90,
"links":[
],
"pageSize":8,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":4,
"desc":true
},
"styles":[
{
"alias":"Namespace",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"namespace",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"PVC Name",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"persistentvolumeclaim",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Storage Class",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"storageclass",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Size",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":1,
"mappingType":1,
"pattern":"Value",
"thresholds":[
],
"type":"number",
"unit":"gbytes"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
}
],
"targets":[
{
"expr":"sum (\n sum(kube_persistentvolumeclaim_info) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right (storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{namespace=~\"$namespace\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024 ",
"format":"table",
"hide":false,
"instant":true,
"interval":"",
"intervalFactor":1,
"legendFormat":"{{ persistentvolumeclaim }}",
"refId":"A"
}
],
"timeFrom":null,
"timeShift":null,
"title":"Persistent Volume Claims",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"description":"CPU requests by pod divided by the rate of CPU usage over the last hour",
"fill":1,
"gridPos":{
"h":9,
"w":24,
"x":0,
"y":9
},
"id":100,
"legend":{
"avg":false,
"current":false,
"max":false,
"min":false,
"show":true,
"total":false,
"values":false
},
"lines":true,
"linewidth":1,
"links":[
],
"nullPointMode":"null",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"topk(10,\n label_replace(\n sum(kube_pod_container_resource_requests_cpu_cores{namespace=\"$namespace\"}) by (pod),\n \"pod_name\", \n \"$1\", \n \"pod\", \n \"(.+)\"\n ) \n/ on (pod_name) sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\",pod_name=~\".+\"}[1h])) by (pod_name))",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":[
],
"timeFrom":null,
"timeShift":null,
"title":"Ratio of CPU requests to usage (Top 10 pods)",
"tooltip":{
"shared":true,
"sort":0,
"value_type":"individual"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":true
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":3,
"description":"This panel shows historical utilization as an average across all pods in this namespace. It only accounts for currently deployed pods",
"editable":true,
"error":false,
"fill":0,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":0,
"y":18
},
"height":"",
"id":94,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":false,
"current":false,
"hideEmpty":false,
"hideZero":false,
"max":false,
"min":false,
"rightSide":false,
"show":false,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":true,
"targets":[
{
"expr":"sum (rate (container_cpu_usage_seconds_total{namespace=\"$namespace\"}[10m])) by (namespace) * 100\n",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"10s",
"intervalFactor":1,
"legendFormat":"cpu utilization",
"metric":"container_cpu",
"refId":"A",
"step":10
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"Overall CPU Utilization",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"decimals":null,
"format":"percent",
"label":"",
"logBase":1,
"max":"110",
"min":"0",
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"description":"This panel shows historical utilization as an average across all pods in this namespace. It only accounts for currently deployed pods",
"editable":true,
"error":false,
"fill":0,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":12,
"y":18
},
"id":92,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":false,
"current":false,
"max":false,
"min":false,
"rightSide":false,
"show":false,
"sideWidth":200,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":true,
"targets":[
{
"expr":"sum (container_memory_working_set_bytes{namespace=\"$namespace\"})\n/\nsum(node_memory_MemTotal_bytes) * 100",
"format":"time_series",
"instant":false,
"intervalFactor":1,
"legendFormat":"mem utilization",
"refId":"B"
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"Overall RAM Utilization",
"tooltip":{
"msResolution":false,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"decimals":null,
"format":"percent",
"label":null,
"logBase":1,
"max":"110",
"min":"0",
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"description":"Traffic in and out of this namespace, as a sum of the pods within it",
"editable":true,
"error":false,
"fill":1,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":0,
"y":24
},
"height":"",
"id":96,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":true,
"current":true,
"hideEmpty":false,
"hideZero":false,
"max":false,
"min":false,
"rightSide":false,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (container_network_receive_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"<- in",
"metric":"container_cpu",
"refId":"A",
"step":10
},
{
"expr":"- sum (rate (container_network_transmit_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"-> out",
"refId":"B"
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"Network IO",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"Bps",
"label":"",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"description":"Disk reads and writes for the namespace, as a sum of the pods within it",
"editable":true,
"error":false,
"fill":1,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":12,
"y":24
},
"height":"",
"id":98,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":true,
"current":true,
"hideEmpty":false,
"hideZero":false,
"max":false,
"min":false,
"rightSide":false,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (container_fs_writes_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"<- write",
"metric":"container_cpu",
"refId":"A",
"step":10
},
{
"expr":"- sum (rate (container_fs_reads_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"-> read",
"refId":"B"
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"Disk IO",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"Bps",
"label":"",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
}
],
"refresh":"10s",
"schemaVersion":16,
"style":"dark",
"tags":[
"cost",
"utilization",
"metrics"
],
"templating":{
"list":[
{
"current":{
"text":"23.06",
"value":"23.06"
},
"hide":0,
"label":"CPU",
"name":"costcpu",
"options":[
{
"text":"23.06",
"value":"23.06"
}
],
"query":"23.06",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"7.28",
"value":"7.28"
},
"hide":0,
"label":"PE CPU",
"name":"costpcpu",
"options":[
{
"text":"7.28",
"value":"7.28"
}
],
"query":"7.28",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"3.25",
"value":"3.25"
},
"hide":0,
"label":"RAM",
"name":"costram",
"options":[
{
"text":"3.25",
"value":"3.25"
}
],
"query":"3.25",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"0.6862",
"value":"0.6862"
},
"hide":0,
"label":"PE RAM",
"name":"costpram",
"options":[
{
"text":"0.6862",
"value":"0.6862"
}
],
"query":"0.6862",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"0.04",
"value":"0.04"
},
"hide":0,
"label":"Storage",
"name":"costStorageStandard",
"options":[
{
"text":"0.04",
"value":"0.04"
}
],
"query":"0.04",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":".17",
"value":".17"
},
"hide":0,
"label":"SSD",
"name":"costStorageSSD",
"options":[
{
"text":".17",
"value":".17"
}
],
"query":".17",
"skipUrlSync":false,
"type":"constant"
},
{
"current":{
"text":"30",
"value":"30"
},
"hide":0,
"label":"Disc.",
"name":"costDiscount",
"options":[
{
"text":"30",
"value":"30"
}
],
"query":"30",
"skipUrlSync":false,
"type":"constant"
},
{
"allValue":null,
"current":{
"text":"kube-system",
"value":"kube-system"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":false,
"label":"NS",
"multi":false,
"name":"namespace",
"options":[
],
"query":"query_result(sum(kube_namespace_created{namespace!=\"\"}) by (namespace))",
"refresh":1,
"regex":"/namespace=\\\"(.*?)(\\\")/",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
},
{
"datasource":"Prometheus",
"filters":[
],
"hide":0,
"label":"",
"name":"Filters",
"skipUrlSync":false,
"type":"adhoc"
}
]
},
"time":{
"from":"now-15m",
"to":"now"
},
"timepicker":{
"hidden":false,
"refresh_intervals":[
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options":[
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone":"browser",
"title":"Namespace utilization metrics",
"uid":"at-cost-analysis-namespace2",
"version":1
}
---
# Source: cost-analyzer/templates/grafana-dashboard-node-utilization-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: node-utilization-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
node-utilization.json: |-
{
"annotations":{
"list":[
{
"builtIn":1,
"datasource":"-- Grafana --",
"enable":true,
"hide":true,
"iconColor":"rgba(0, 211, 255, 1)",
"name":"Annotations & Alerts",
"type":"dashboard"
}
]
},
"editable":true,
"gnetId":null,
"graphTooltip":0,
"id":6,
"iteration":1557245882378,
"links":[
],
"panels":[
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"format":"percentunit",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":7,
"w":8,
"x":0,
"y":0
},
"id":2,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(irate(container_cpu_usage_seconds_total{id=\"/\",instance=\"$node\"}[10m]))",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"CPU Usage",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"avg"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"format":"percentunit",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":7,
"w":8,
"x":8,
"y":0
},
"id":3,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"SUM(container_memory_usage_bytes{namespace!=\"\",instance=\"$node\"}) / SUM(kube_node_status_capacity_memory_bytes{node=\"$node\"})",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Memory Usage",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"avg"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"format":"percentunit",
"gauge":{
"maxValue":100,
"minValue":0,
"show":true,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":7,
"w":8,
"x":16,
"y":0
},
"id":4,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(container_fs_usage_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\",instance=\"$node\"}) /\nsum(container_fs_limit_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\",instance=\"$node\"})",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Storage Usage",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"avg"
},
{
"columns":[
{
"text":"Avg",
"value":"avg"
}
],
"datasource":"Prometheus",
"fontSize":"100%",
"gridPos":{
"h":8,
"w":16,
"x":0,
"y":7
},
"hideTimeOverride":true,
"id":21,
"links":[
],
"pageSize":8,
"repeat":null,
"repeatDirection":"v",
"scroll":true,
"showHeader":true,
"sort":{
"col":4,
"desc":true
},
"styles":[
{
"alias":"Pod",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"link":false,
"linkTooltip":"",
"linkUrl":"",
"pattern":"pod_name",
"thresholds":[
"30",
"80"
],
"type":"string",
"unit":"currencyUSD"
},
{
"alias":"",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Time",
"thresholds":[
],
"type":"hidden",
"unit":"short"
},
{
"alias":"CPU Usage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #C",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"CPU Request",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #A",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"CPU Limit",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #B",
"thresholds":[
],
"type":"number",
"unit":"short"
},
{
"alias":"Mem Usage",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #D",
"thresholds":[
],
"type":"number",
"unit":"bytes"
},
{
"alias":"Mem Request",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #E",
"thresholds":[
],
"type":"number",
"unit":"bytes"
},
{
"alias":"Mem Limit",
"colorMode":null,
"colors":[
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat":"YYYY-MM-DD HH:mm:ss",
"decimals":2,
"mappingType":1,
"pattern":"Value #F",
"thresholds":[
],
"type":"number",
"unit":"bytes"
}
],
"targets":[
{
"expr":"sum(rate(container_cpu_usage_seconds_total{container_name!=\"\",container_name!=\"POD\",pod_name!=\"\",instance=\"$node\"}[24h])) by (pod_name)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"C"
},
{
"expr":"sum(label_replace(\nsum(avg_over_time(kube_pod_container_resource_requests_cpu_cores{container!=\"\",container!=\"POD\",node=\"$node\"}[24h])) by (pod), \n\"pod_name\",\"$1\",\"pod\",\"(.+)\")\nor up * 0\n) by (pod_name)",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"A"
},
{
"expr":"sum(avg_over_time(container_memory_usage_bytes{container_name!=\"\",container_name!=\"POD\",pod_name!=\"\",instance=\"$node\"}[24h])) by (pod_name)\n",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"D"
},
{
"expr":"sum(label_replace(label_replace(\nsum(avg_over_time(kube_pod_container_resource_requests_memory_bytes{container!=\"\",container!=\"POD\",node=\"$node\"}[24h])) by (pod),\n\"container_name\",\"$1\",\"container\",\"(.+)\"), \"pod_name\",\"$1\",\"pod\",\"(.+)\")\nor up * 0\n) by (pod_name)\n",
"format":"table",
"instant":true,
"intervalFactor":1,
"refId":"E"
}
],
"timeFrom":"1M",
"timeShift":null,
"title":"Current pods",
"transform":"table",
"transparent":false,
"type":"table"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"decimals":0,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":4,
"x":16,
"y":7
},
"id":8,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(\n count(avg_over_time(kube_pod_container_resource_requests_cpu_cores{container!=\"\",container!=\"POD\",node=\"$node\"}[24h])) by (pod)\n * on (pod) group_right()\n sum(kube_pod_container_status_running) by (pod)\n)",
"format":"time_series",
"instant":true,
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Pods Running",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":4,
"x":20,
"y":7
},
"id":18,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"sum(container_fs_limit_bytes{device=~\"^/dev/[sv]d[a-z][1-9]$\",id=\"/\",instance=\"$node\"})",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"Storage Capacity",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"format":"none",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":4,
"x":16,
"y":11
},
"id":9,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"kube_node_status_capacity_cpu_cores{node=\"$node\"}",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"CPU Capacity",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"avg"
},
{
"cacheTimeout":null,
"colorBackground":false,
"colorValue":false,
"colors":[
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource":null,
"format":"bytes",
"gauge":{
"maxValue":100,
"minValue":0,
"show":false,
"thresholdLabels":false,
"thresholdMarkers":true
},
"gridPos":{
"h":4,
"w":4,
"x":20,
"y":11
},
"id":19,
"interval":null,
"links":[
],
"mappingType":1,
"mappingTypes":[
{
"name":"value to text",
"value":1
},
{
"name":"range to text",
"value":2
}
],
"maxDataPoints":100,
"nullPointMode":"connected",
"nullText":null,
"postfix":"",
"postfixFontSize":"50%",
"prefix":"",
"prefixFontSize":"50%",
"rangeMaps":[
{
"from":"null",
"text":"N/A",
"to":"null"
}
],
"sparkline":{
"fillColor":"rgba(31, 118, 189, 0.18)",
"full":false,
"lineColor":"rgb(31, 120, 193)",
"show":false
},
"tableColumn":"",
"targets":[
{
"expr":"kube_node_status_capacity_memory_bytes{node=\"$node\"}",
"format":"time_series",
"intervalFactor":1,
"refId":"A"
}
],
"thresholds":"",
"title":"RAM Capacity",
"type":"singlestat",
"valueFontSize":"80%",
"valueMaps":[
{
"op":"=",
"text":"N/A",
"value":"null"
}
],
"valueName":"current"
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":3,
"description":"This panel shows historical utilization for the node.",
"editable":true,
"error":false,
"fill":0,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":0,
"y":15
},
"height":"",
"id":11,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":false,
"current":false,
"hideEmpty":false,
"hideZero":false,
"max":false,
"min":false,
"rightSide":false,
"show":false,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":true,
"targets":[
{
"expr":"sum(irate(container_cpu_usage_seconds_total{id=\"/\",instance=\"$node\"}[10m]))",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"10s",
"intervalFactor":1,
"legendFormat":"cpu utilization",
"metric":"container_cpu",
"refId":"A",
"step":10
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"CPU Utilization",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"decimals":null,
"format":"percentunit",
"label":"",
"logBase":1,
"max":"1.1",
"min":"0",
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"description":"This panel shows historical utilization for the node.",
"editable":true,
"error":false,
"fill":0,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":12,
"y":15
},
"id":13,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":false,
"current":false,
"max":false,
"min":false,
"rightSide":false,
"show":false,
"sideWidth":200,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":true,
"targets":[
{
"expr":"SUM(container_memory_usage_bytes{namespace!=\"\",instance=\"$node\"}) / SUM(kube_node_status_capacity_memory_bytes{node=\"$node\"})",
"format":"time_series",
"instant":false,
"interval":"10s",
"intervalFactor":1,
"legendFormat":"ram utilization",
"metric":"container_memory_usage:sort_desc",
"refId":"A",
"step":10
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"RAM Utilization",
"tooltip":{
"msResolution":false,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"decimals":null,
"format":"percentunit",
"label":null,
"logBase":1,
"max":"1.1",
"min":"0",
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"description":"Traffic in and out of this namespace, as a sum of the pods within it",
"editable":true,
"error":false,
"fill":1,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":0,
"y":21
},
"height":"",
"id":15,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":true,
"current":true,
"hideEmpty":false,
"hideZero":false,
"max":false,
"min":false,
"rightSide":false,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (container_network_receive_bytes_total{instance=\"$node\"}[10m]))",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"<- in",
"metric":"container_cpu",
"refId":"A",
"step":10
},
{
"expr":"- sum (rate (container_network_transmit_bytes_total{instance=\"$node\"}[10m]))",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"-> out",
"refId":"B"
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"Network IO",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"Bps",
"label":"",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
},
{
"aliasColors":{
},
"bars":false,
"dashLength":10,
"dashes":false,
"datasource":"Prometheus",
"decimals":2,
"description":"Disk reads and writes for the namespace, as a sum of the pods within it",
"editable":true,
"error":false,
"fill":1,
"grid":{
},
"gridPos":{
"h":6,
"w":12,
"x":12,
"y":21
},
"height":"",
"id":17,
"isNew":true,
"legend":{
"alignAsTable":false,
"avg":true,
"current":true,
"hideEmpty":false,
"hideZero":false,
"max":false,
"min":false,
"rightSide":false,
"show":true,
"sideWidth":null,
"sort":"current",
"sortDesc":true,
"total":false,
"values":true
},
"lines":true,
"linewidth":2,
"links":[
],
"nullPointMode":"connected",
"percentage":false,
"pointradius":5,
"points":false,
"renderer":"flot",
"seriesOverrides":[
],
"spaceLength":10,
"stack":false,
"steppedLine":false,
"targets":[
{
"expr":"sum (rate (container_fs_writes_bytes_total{instance=\"$node\"}[10m]))",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"<- write",
"metric":"container_cpu",
"refId":"A",
"step":10
},
{
"expr":"- sum (rate (container_fs_reads_bytes_total{instance=\"$node\"}[10m]))",
"format":"time_series",
"hide":false,
"instant":false,
"interval":"",
"intervalFactor":1,
"legendFormat":"-> read",
"refId":"B"
}
],
"thresholds":[
],
"timeFrom":"",
"timeShift":null,
"title":"Disk IO",
"tooltip":{
"msResolution":true,
"shared":true,
"sort":2,
"value_type":"cumulative"
},
"type":"graph",
"xaxis":{
"buckets":null,
"mode":"time",
"name":null,
"show":true,
"values":[
]
},
"yaxes":[
{
"format":"Bps",
"label":"",
"logBase":1,
"max":null,
"min":null,
"show":true
},
{
"format":"short",
"label":null,
"logBase":1,
"max":null,
"min":null,
"show":false
}
],
"yaxis":{
"align":false,
"alignLevel":null
}
}
],
"schemaVersion":16,
"style":"dark",
"tags":[
"cost",
"utilization",
"metrics"
],
"templating":{
"list":[
{
"allValue":null,
"current":{
"text":"ip-172-20-44-170.us-east-2.compute.internal",
"value":"ip-172-20-44-170.us-east-2.compute.internal"
},
"datasource":"Prometheus",
"hide":0,
"includeAll":false,
"label":null,
"multi":false,
"name":"node",
"options":[
],
"query":"query_result(kube_node_labels)",
"refresh":1,
"regex":"/node=\\\"(.*?)(\\\")/",
"skipUrlSync":false,
"sort":0,
"tagValuesQuery":"",
"tags":[
],
"tagsQuery":"",
"type":"query",
"useTags":false
}
]
},
"time":{
"from":"now-6h",
"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":"Node utilization metrics",
"uid":"NUQW37Lmk",
"version":1
}
---
# Source: cost-analyzer/templates/grafana-dashboard-pod-utilization-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: pod-utilization-dashboard
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_dashboard: "1"
data:
pod-utilization.json: |-
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "Visualize your kubernetes costs at the pod level.",
"editable": true,
"gnetId": 9063,
"graphTooltip": 0,
"id": 4,
"iteration": 1560100821196,
"links": [],
"panels": [
{
"columns": [
{
"text": "Avg",
"value": "avg"
}
],
"datasource": "Prometheus",
"fontSize": "100%",
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 0
},
"hideTimeOverride": true,
"id": 98,
"links": [],
"pageSize": 5,
"repeatDirection": "v",
"scroll": true,
"showHeader": true,
"sort": {
"col": 6,
"desc": true
},
"styles": [
{
"alias": "Container",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(50, 172, 45, 0.97)",
"#c15c17"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"pattern": "container_name",
"thresholds": [
"30",
"80"
],
"type": "string",
"unit": "currencyUSD"
},
{
"alias": "Memory Allocation",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"pattern": "Value #B",
"thresholds": [],
"type": "number",
"unit": "bytes"
},
{
"alias": "CPU Allocation",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #A",
"thresholds": [],
"type": "number",
"unit": "none"
},
{
"alias": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Time",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"alias": "Memory ($/hour)",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #C",
"thresholds": [],
"type": "number",
"unit": "currencyUSD"
},
{
"alias": "Spot/PE RAM",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #D",
"thresholds": [],
"type": "number",
"unit": "currencyUSD"
},
{
"alias": "Total",
"colorMode": null,
"colors": [
"#bf1b00",
"rgba(50, 172, 45, 0.97)",
"#ef843c"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value #E",
"thresholds": [
""
],
"type": "number",
"unit": "currencyUSD"
}
],
"targets": [
{
"expr": "sum(\n avg_over_time(container_memory_allocation_bytes{namespace=\"$namespace\", pod=\"$pod\", container!=\"POD\"}[$__range])\n) by (container,node)",
"format": "table",
"instant": true,
"intervalFactor": 1,
"refId": "B"
},
{
"expr": "sum(\n avg_over_time(container_cpu_allocation{namespace=\"$namespace\", pod=\"$pod\", container!=\"POD\"}[$__range])\n or up * 0 \n) by (container,node)",
"format": "table",
"hide": false,
"instant": true,
"interval": "",
"intervalFactor": 1,
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": "1M",
"timeShift": null,
"title": "Container cost & allocation analysis",
"transform": "table",
"transparent": false,
"type": "table"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"decimals": 3,
"description": "This graph attempts to show you CPU use of your application vs its requests",
"editable": true,
"error": false,
"fill": 0,
"grid": {},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 5
},
"height": "",
"id": 94,
"isNew": true,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": false,
"hideZero": false,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"sideWidth": null,
"sort": "current",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": true,
"targets": [
{
"expr": "avg (rate (container_cpu_usage_seconds_total{namespace=~\"$namespace\", pod_name=\"$pod\", container_name!=\"POD\",container_name!=\"\"}[10m])) by (container_name)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{ container_name }} (usage)",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"expr": "avg(kube_pod_container_resource_requests_cpu_cores{namespace=~\"$namespace\", pod=\"$pod\", container!=\"POD\"}) by (container)",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
"legendFormat": "{{ container}} (request)",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": "",
"timeShift": null,
"title": "CPU Usage vs Requested",
"tooltip": {
"msResolution": true,
"shared": true,
"sort": 2,
"value_type": "cumulative"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "none",
"label": "",
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"decimals": 3,
"description": "This graph attempts to show you RAM use of your application vs its requests",
"editable": true,
"error": false,
"fill": 0,
"grid": {},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 5
},
"height": "",
"id": 96,
"isNew": true,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": false,
"hideZero": false,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"sideWidth": null,
"sort": "current",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": true,
"targets": [
{
"expr": "avg (avg_over_time (container_memory_working_set_bytes{namespace=\"$namespace\", pod_name=\"$pod\", container_name!=\"POD\",container_name!=\"\"}[1m])) by (container_name)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{ container_name }} (usage)",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"expr": "avg(kube_pod_container_resource_requests_memory_bytes{namespace=~\"$namespace\", pod=\"$pod\", container!=\"POD\"}) by (container)",
"format": "time_series",
"hide": false,
"instant": false,
"intervalFactor": 1,
"legendFormat": "{{ container }} (requested)",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": "",
"timeShift": null,
"title": "RAM Usage vs Requested",
"tooltip": {
"msResolution": true,
"shared": true,
"sort": 2,
"value_type": "cumulative"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "bytes",
"label": "",
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"decimals": 2,
"description": "Traffic in and out of this pod, as a sum of its containers",
"editable": true,
"error": false,
"fill": 1,
"grid": {},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 12
},
"height": "",
"id": 95,
"isNew": true,
"legend": {
"alignAsTable": false,
"avg": true,
"current": true,
"hideEmpty": false,
"hideZero": false,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"sideWidth": null,
"sort": "current",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg (rate (container_network_receive_bytes_total{namespace=\"$namespace\",pod_name=\"$pod\"}[10m])) by (pod_name)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "<- in",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"expr": "- avg (rate (container_network_transmit_bytes_total{namespace=\"$namespace\",pod_name=\"$pod\"}[10m])) by (pod_name)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "-> out",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": "",
"timeShift": null,
"title": "Network IO",
"tooltip": {
"msResolution": true,
"shared": true,
"sort": 2,
"value_type": "cumulative"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "Bps",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"decimals": 2,
"description": "Disk read writes",
"editable": true,
"error": false,
"fill": 1,
"grid": {},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 12
},
"height": "",
"id": 97,
"isNew": true,
"legend": {
"alignAsTable": false,
"avg": true,
"current": true,
"hideEmpty": false,
"hideZero": false,
"max": false,
"min": false,
"rightSide": false,
"show": true,
"sideWidth": null,
"sort": "current",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg (rate (container_fs_writes_bytes_total{namespace=\"$namespace\",pod_name=\"$pod\"}[10m])) by (pod_name)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "<- write",
"metric": "container_cpu",
"refId": "A",
"step": 10
},
{
"expr": "- avg (rate (container_fs_reads_bytes_total{namespace=\"$namespace\",pod_name=\"$pod\"}[10m])) by (pod_name)",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "-> read",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": "",
"timeShift": null,
"title": "Disk IO",
"tooltip": {
"msResolution": true,
"shared": true,
"sort": 2,
"value_type": "cumulative"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "Bps",
"label": "",
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": false,
"schemaVersion": 16,
"style": "dark",
"tags": [
"cost",
"utilization",
"metrics"
],
"templating": {
"list": [
{
"current": {
"text": "0.044",
"value": "0.044"
},
"hide": 0,
"label": "Storage",
"name": "costStorageStandard",
"options": [
{
"text": "0.044",
"value": "0.044"
}
],
"query": "0.044",
"skipUrlSync": false,
"type": "constant"
},
{
"current": {
"text": "0.187",
"value": "0.187"
},
"hide": 0,
"label": "SSD",
"name": "costStorageSSD",
"options": [
{
"text": "0.187",
"value": "0.187"
}
],
"query": "0.187",
"skipUrlSync": false,
"type": "constant"
},
{
"current": {
"text": "30",
"value": "30"
},
"hide": 0,
"label": "Disc.",
"name": "costDiscount",
"options": [
{
"text": "30",
"value": "30"
}
],
"query": "30",
"skipUrlSync": false,
"type": "constant"
},
{
"allValue": null,
"current": {
"selected": false,
"text": "kubecost",
"value": "kubecost"
},
"datasource": "Prometheus",
"hide": 0,
"includeAll": false,
"label": "NS",
"multi": false,
"name": "namespace",
"options": [],
"query": "query_result(sum(container_memory_working_set_bytes{namespace!=\"\"}) by (namespace))",
"refresh": 1,
"regex": "/namespace=\\\"(.*?)(\\\")/",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"tags": [],
"text": "kubecost-grafana-5cc9f5bf6-7kmgl",
"value": "kubecost-grafana-5cc9f5bf6-7kmgl"
},
"datasource": "Prometheus",
"hide": 0,
"includeAll": false,
"label": "Pod",
"multi": false,
"name": "pod",
"options": [],
"query": "query_result(sum(container_memory_working_set_bytes{namespace=\"$namespace\"}) by (pod_name))",
"refresh": 1,
"regex": "/pod_name=\\\"(.*?)(\\\")/",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"hidden": false,
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "Pod cost & utilization metrics",
"uid": "at-cost-analysis-pod",
"version": 1
}
---
# Source: cost-analyzer/templates/grafana-datasource-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-datasource
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
grafana_datasource: "1"
data:
datasource.yaml: |-
# config file version
apiVersion: 1
datasources:
- access: proxy
isDefault: true
name: Prometheus
type: prometheus
url: http://kubecost-prometheus-server.kubecost.svc.cluster.local
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
component: "alertmanager"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-alertmanager
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "2Gi"
---
# Source: cost-analyzer/charts/prometheus/templates/pushgateway-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
component: "pushgateway"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-pushgateway
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "2Gi"
---
# Source: cost-analyzer/charts/prometheus/templates/server-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "32Gi"
---
# Source: cost-analyzer/templates/cost-analyzer-pvc-template.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 0.2Gi
---
# Source: cost-analyzer/charts/grafana/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: grafana
chart: grafana-1.17.2
heritage: Tiller
release: kubecost
name: kubecost-grafana
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
component: "alertmanager"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-alertmanager
---
# Source: cost-analyzer/charts/prometheus/templates/kube-state-metrics-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-kube-state-metrics
---
# Source: cost-analyzer/charts/prometheus/templates/node-exporter-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
component: "node-exporter"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-node-exporter
---
# Source: cost-analyzer/charts/prometheus/templates/pushgateway-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
component: "pushgateway"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-pushgateway
---
# Source: cost-analyzer/charts/prometheus/templates/server-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
---
# Source: cost-analyzer/templates/cost-analyzer-service-account-template.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
---
# Source: cost-analyzer/charts/grafana/templates/clusterrole.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
name: kubecost-grafana-clusterrole
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["configmaps"]
verbs: ["get", "watch", "list"]
---
# Source: cost-analyzer/charts/prometheus/templates/kube-state-metrics-clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-kube-state-metrics
rules:
- apiGroups:
- ""
resources:
- namespaces
- nodes
- persistentvolumeclaims
- pods
- services
- resourcequotas
- replicationcontrollers
- limitranges
- persistentvolumeclaims
- persistentvolumes
- endpoints
- secrets
- configmaps
verbs:
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- ingresses
- replicasets
verbs:
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- list
- watch
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- list
- watch
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
verbs:
- list
- watch
---
# Source: cost-analyzer/charts/prometheus/templates/server-clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
rules:
- apiGroups:
- ""
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
- ingresses
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- "extensions"
resources:
- ingresses/status
- ingresses
verbs:
- get
- list
- watch
- nonResourceURLs:
- "/metrics"
verbs:
- get
---
# Source: cost-analyzer/templates/cost-analyzer-cluser-role-template.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
rules:
- apiGroups:
- ''
resources:
- configmaps
- deployments
- nodes
- pods
- events
- services
- resourcequotas
- replicationcontrollers
- limitranges
- persistentvolumeclaims
- persistentvolumes
- namespaces
- endpoints
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
- deployments
- daemonsets
- replicasets
verbs:
- 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
---
# Source: cost-analyzer/charts/grafana/templates/clusterrolebinding.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kubecost-grafana-clusterrolebinding
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
subjects:
- kind: ServiceAccount
name: kubecost-grafana
namespace: kubecost
roleRef:
kind: ClusterRole
name: kubecost-grafana-clusterrole
apiGroup: rbac.authorization.k8s.io
---
# Source: cost-analyzer/charts/prometheus/templates/kube-state-metrics-clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-kube-state-metrics
subjects:
- kind: ServiceAccount
name: kubecost-prometheus-kube-state-metrics
namespace: kubecost
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubecost-prometheus-kube-state-metrics
---
# Source: cost-analyzer/charts/prometheus/templates/server-clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
subjects:
- kind: ServiceAccount
name: kubecost-prometheus-server
namespace: kubecost
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubecost-prometheus-server
---
# Source: cost-analyzer/templates/cost-analyzer-cluster-role-binding-template.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubecost-cost-analyzer
subjects:
- kind: ServiceAccount
name: kubecost-cost-analyzer
namespace: kubecost
---
# Source: cost-analyzer/charts/grafana/templates/role.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
heritage: Tiller
release: kubecost
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: [kubecost-grafana]
---
# Source: cost-analyzer/charts/grafana/templates/rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
heritage: Tiller
release: kubecost
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubecost-grafana
subjects:
- kind: ServiceAccount
name: kubecost-grafana
---
# Source: cost-analyzer/charts/grafana/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
spec:
type: ClusterIP
ports:
- name: service
port: 80
protocol: TCP
targetPort: 3000
selector:
app: grafana
release: kubecost
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
component: "alertmanager"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-alertmanager
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 9093
selector:
component: "alertmanager"
app: prometheus
release: kubecost
type: "ClusterIP"
---
# Source: cost-analyzer/charts/prometheus/templates/kube-state-metrics-svc.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-kube-state-metrics
spec:
clusterIP: None
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
selector:
component: "kube-state-metrics"
app: prometheus
release: kubecost
type: "ClusterIP"
---
# Source: cost-analyzer/charts/prometheus/templates/node-exporter-service.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
component: "node-exporter"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-node-exporter
spec:
clusterIP: None
ports:
- name: metrics
port: 9100
protocol: TCP
targetPort: 9100
selector:
component: "node-exporter"
app: prometheus
release: kubecost
type: "ClusterIP"
---
# Source: cost-analyzer/charts/prometheus/templates/pushgateway-service.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/probe: pushgateway
labels:
component: "pushgateway"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-pushgateway
spec:
ports:
- name: http
port: 9091
protocol: TCP
targetPort: 9091
selector:
component: "pushgateway"
app: prometheus
release: kubecost
type: "ClusterIP"
---
# Source: cost-analyzer/charts/prometheus/templates/server-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 9090
selector:
component: "server"
app: prometheus
release: kubecost
type: "ClusterIP"
---
# Source: cost-analyzer/templates/cost-analyzer-service-template.yaml
kind: Service
apiVersion: v1
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
spec:
selector:
app.kubernetes.io/name: cost-analyzer
app.kubernetes.io/instance: kubecost
app: cost-analyzer
type: "ClusterIP"
ports:
- name: server
port: 9001
targetPort: 9001
- name: model
port: 9003
targetPort: 9003
- name: frontend
port: 9090
targetPort: 9090
---
# Source: cost-analyzer/charts/prometheus/templates/node-exporter-daemonset.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
component: "node-exporter"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-node-exporter
spec:
selector:
matchLabels:
component: "node-exporter"
app: prometheus
release: kubecost
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
component: "node-exporter"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
spec:
serviceAccountName: kubecost-prometheus-node-exporter
containers:
- name: prometheus-node-exporter
image: "prom/node-exporter:v0.18.0"
imagePullPolicy: "IfNotPresent"
args:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
ports:
- name: metrics
containerPort: 9100
hostPort: 9100
resources:
{}
volumeMounts:
- name: proc
mountPath: /host/proc
readOnly: true
- name: sys
mountPath: /host/sys
readOnly: true
hostNetwork: true
hostPID: true
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
---
# Source: cost-analyzer/charts/grafana/templates/deployment.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: kubecost-grafana
labels:
app: grafana
chart: grafana-1.17.2
release: kubecost
heritage: Tiller
spec:
replicas: 1
selector:
matchLabels:
app: grafana
release: kubecost
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: grafana
release: kubecost
spec:
serviceAccountName: kubecost-grafana
securityContext:
fsGroup: 472
runAsUser: 472
containers:
- name: grafana-sc-dashboard
image: "kiwigrid/k8s-sidecar:0.0.3"
imagePullPolicy: IfNotPresent
env:
- name: LABEL
value: "grafana_dashboard"
- name: FOLDER
value: "/tmp/dashboards"
resources:
null
volumeMounts:
- name: sc-dashboard-volume
mountPath: "/tmp/dashboards"
- name: grafana-sc-datasources
image: "kiwigrid/k8s-sidecar:0.0.3"
imagePullPolicy: IfNotPresent
env:
- name: LABEL
value: "grafana_datasource"
- name: FOLDER
value: "/etc/grafana/provisioning/datasources"
resources:
null
volumeMounts:
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
- name: grafana
image: "grafana/grafana:5.3.1"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: config
mountPath: "/etc/grafana/grafana.ini"
subPath: grafana.ini
- name: ldap
mountPath: "/etc/grafana/ldap.toml"
subPath: ldap.toml
- name: sc-dashboard-volume
mountPath: "/tmp/dashboards"
- name: sc-dashboard-provider
mountPath: "/etc/grafana/provisioning/dashboards/sc-dashboardproviders.yaml"
subPath: provider.yaml
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
- name: storage
mountPath: "/var/lib/grafana"
subPath:
ports:
- name: service
containerPort: 80
protocol: TCP
- name: grafana
containerPort: 3000
protocol: TCP
env:
- name: GF_SECURITY_ADMIN_USER
valueFrom:
secretKeyRef:
name: kubecost-grafana
key: admin-user
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: kubecost-grafana
key: admin-password
livenessProbe:
failureThreshold: 10
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 60
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /api/health
port: 3000
resources:
{}
volumes:
- name: config
configMap:
name: kubecost-grafana
- name: ldap
secret:
secretName: kubecost-grafana
items:
- key: ldap-toml
path: ldap.toml
- name: storage
emptyDir: {}
- name: sc-dashboard-volume
emptyDir: {}
- name: sc-dashboard-provider
configMap:
name: kubecost-grafana-config-dashboards
- name: sc-datasources-volume
emptyDir: {}
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
component: "alertmanager"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-alertmanager
spec:
selector:
matchLabels:
component: "alertmanager"
app: prometheus
release: kubecost
replicas: 1
template:
metadata:
labels:
component: "alertmanager"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
spec:
serviceAccountName: kubecost-prometheus-alertmanager
containers:
- name: prometheus-alertmanager
image: "prom/alertmanager:v0.18.0"
imagePullPolicy: "IfNotPresent"
env:
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
args:
- --config.file=/etc/config/alertmanager.yml
- --storage.path=/data
- --cluster.advertise-address=$(POD_IP):6783
- --web.external-url=/
ports:
- containerPort: 9093
readinessProbe:
httpGet:
path: /#/status
port: 9093
initialDelaySeconds: 30
timeoutSeconds: 30
resources:
{}
volumeMounts:
- name: config-volume
mountPath: /etc/config
- name: storage-volume
mountPath: "/data"
subPath: ""
- name: prometheus-alertmanager-configmap-reload
image: "jimmidyson/configmap-reload:v0.2.2"
imagePullPolicy: "IfNotPresent"
args:
- --volume-dir=/etc/config
- --webhook-url=http://127.0.0.1:9093/-/reload
resources:
{}
volumeMounts:
- name: config-volume
mountPath: /etc/config
readOnly: true
securityContext:
fsGroup: 65534
runAsGroup: 65534
runAsNonRoot: true
runAsUser: 65534
volumes:
- name: config-volume
configMap:
name: kubecost-prometheus-alertmanager
- name: storage-volume
persistentVolumeClaim:
claimName: kubecost-prometheus-alertmanager
---
# Source: cost-analyzer/charts/prometheus/templates/kube-state-metrics-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-kube-state-metrics
spec:
selector:
matchLabels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
replicas: 1
template:
metadata:
labels:
component: "kube-state-metrics"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
spec:
serviceAccountName: kubecost-prometheus-kube-state-metrics
containers:
- name: prometheus-kube-state-metrics
image: "quay.io/coreos/kube-state-metrics:v1.6.0"
imagePullPolicy: "IfNotPresent"
ports:
- name: metrics
containerPort: 8080
resources:
{}
securityContext:
runAsNonRoot: true
runAsUser: 65534
---
# Source: cost-analyzer/charts/prometheus/templates/pushgateway-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
component: "pushgateway"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-pushgateway
spec:
selector:
matchLabels:
component: "pushgateway"
app: prometheus
release: kubecost
replicas: 1
template:
metadata:
labels:
component: "pushgateway"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
spec:
serviceAccountName: kubecost-prometheus-pushgateway
containers:
- name: prometheus-pushgateway
image: "prom/pushgateway:v0.8.0"
imagePullPolicy: "IfNotPresent"
args:
ports:
- containerPort: 9091
readinessProbe:
httpGet:
path: /#/status
port: 9091
initialDelaySeconds: 10
timeoutSeconds: 10
resources:
{}
volumeMounts:
- name: storage-volume
mountPath: "/data"
subPath: ""
securityContext:
runAsNonRoot: true
runAsUser: 65534
volumes:
- name: storage-volume
persistentVolumeClaim:
claimName: kubecost-prometheus-pushgateway
---
# Source: cost-analyzer/charts/prometheus/templates/server-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
name: kubecost-prometheus-server
spec:
selector:
matchLabels:
component: "server"
app: prometheus
release: kubecost
replicas: 1
template:
metadata:
labels:
component: "server"
app: prometheus
release: kubecost
chart: prometheus-8.15.0
heritage: Tiller
spec:
serviceAccountName: kubecost-prometheus-server
containers:
- name: prometheus-server-configmap-reload
image: "jimmidyson/configmap-reload:v0.2.2"
imagePullPolicy: "IfNotPresent"
args:
- --volume-dir=/etc/config
- --webhook-url=http://127.0.0.1:9090/-/reload
resources:
{}
volumeMounts:
- name: config-volume
mountPath: /etc/config
readOnly: true
- name: prometheus-server
image: "prom/prometheus:v2.11.1"
imagePullPolicy: "IfNotPresent"
args:
- --storage.tsdb.retention.time=15d
- --config.file=/etc/config/prometheus.yml
- --storage.tsdb.path=/data
- --web.console.libraries=/etc/prometheus/console_libraries
- --web.console.templates=/etc/prometheus/consoles
- --web.enable-lifecycle
ports:
- containerPort: 9090
readinessProbe:
httpGet:
path: /-/ready
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
livenessProbe:
httpGet:
path: /-/healthy
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
resources:
{}
volumeMounts:
- name: config-volume
mountPath: /etc/config
- name: storage-volume
mountPath: /data
subPath: ""
securityContext:
fsGroup: 65534
runAsGroup: 65534
runAsNonRoot: true
runAsUser: 65534
terminationGracePeriodSeconds: 300
volumes:
- name: config-volume
configMap:
name: kubecost-prometheus-server
- name: storage-volume
persistentVolumeClaim:
claimName: kubecost-prometheus-server
---
# Source: cost-analyzer/templates/cost-analyzer-deployment-template.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kubecost-cost-analyzer
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
spec:
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: cost-analyzer
app.kubernetes.io/instance: kubecost
app: cost-analyzer
spec:
securityContext:
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
restartPolicy: Always
serviceAccountName: kubecost-cost-analyzer
volumes:
- name: nginx-conf
configMap:
name: nginx-conf
items:
- key: nginx.conf
path: default.conf
- name: persistent-configs
persistentVolumeClaim:
claimName: kubecost-cost-analyzer
initContainers:
- name: config-perms-fix
image: busybox
command: ["/bin/chmod", "-R", "777", "/var/configs"]
volumeMounts:
- name: persistent-configs
mountPath: /var/configs
securityContext:
runAsUser: 0
- image: ajaytripathy/kubecost-init:prod-1.38.0
name: cost-analyzer-init
imagePullPolicy: Always
env:
- name: PROMETHEUS_SERVER_ENDPOINT
valueFrom:
configMapKeyRef:
name: kubecost-cost-analyzer
key: prometheus-server-endpoint
containers:
- image: ajaytripathy/kubecost-frontend:prod-1.38.0
env:
- name: GET_HOSTS_FROM
value: dns
name: cost-analyzer-frontend
volumeMounts:
- name: nginx-conf
mountPath: /etc/nginx/conf.d/
resources:
requests:
cpu: "10m"
memory: "55Mi"
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /healthz
port: 9003
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 200
- image: ajaytripathy/kubecost:prod-1.38.0
resources:
requests:
cpu: "100m"
memory: "55Mi"
name: cost-analyzer-server
readinessProbe:
httpGet:
path: /healthz
port: 9003
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 200
volumeMounts:
- name: persistent-configs
mountPath: /var/configs
env:
- name: PROMETHEUS_SERVER_ENDPOINT
valueFrom:
configMapKeyRef:
name: kubecost-cost-analyzer
key: prometheus-server-endpoint
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/configs/key.json
- name: KUBECOST_TOKEN
valueFrom:
configMapKeyRef:
name: kubecost-cost-analyzer
key: kubecost-token
- image: ajaytripathy/kubecost-cost-model:prod-1.38.0
name: cost-model
imagePullPolicy: Always
resources:
requests:
cpu: "200m"
memory: "55Mi"
readinessProbe:
httpGet:
path: /healthz
port: 9003
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 200
volumeMounts:
- name: persistent-configs
mountPath: /var/configs
env:
- name: PROMETHEUS_SERVER_ENDPOINT
valueFrom:
configMapKeyRef:
name: kubecost-cost-analyzer
key: prometheus-server-endpoint
- name: CLOUD_PROVIDER_API_KEY
value: "AIzaSyDXQPG_MHUEy9neR7stolq6l0ujXmjJlvk" # The GCP Pricing API requires a key.
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/configs/key.json
- name: CONFIG_PATH
value: /var/configs/
- name: KUBECOST_TOKEN
valueFrom:
configMapKeyRef:
name: kubecost-cost-analyzer
key: kubecost-token
imagePullPolicy: Always
---
# Source: cost-analyzer/templates/cost-analyzer-checks-template.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: cost-analyzer-checks
labels:
app.kubernetes.io/name: cost-analyzer
helm.sh/chart: cost-analyzer-1.38.0
app.kubernetes.io/instance: kubecost
app.kubernetes.io/managed-by: Tiller
app: cost-analyzer
spec:
schedule: "*/10 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: cost-analyzer-checks
image: ajaytripathy/kubecost-checks:prod-1.38.0
args:
- node
- ./node/cron.js
resources:
requests:
cpu: "20m"
memory: "100Mi"
limits:
cpu: "100m"
memory: "200Mi"
env:
- name: COST_ANALYZER_SERVER_ENDPOINT
value: kubecost-cost-analyzer.kubecost.svc.cluster.local:9001
- name: COST_ANALYZER_MODEL_ENDPOINT
value: kubecost-cost-analyzer.kubecost.svc.cluster.local:9003
- name: PROMETHEUS_ALERTMANAGER_ENDPOINT
valueFrom:
configMapKeyRef:
name: kubecost-cost-analyzer
key: prometheus-alertmanager-endpoint
restartPolicy: OnFailure
---
# Source: cost-analyzer/charts/grafana/templates/dashboards-json-configmap.yaml
---
# Source: cost-analyzer/charts/grafana/templates/ingress.yaml
---
# Source: cost-analyzer/charts/grafana/templates/pvc.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-ingress.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-networkpolicy.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-service-headless.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/alertmanager-statefulset.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/kube-state-metrics-networkpolicy.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/node-exporter-podsecuritypolicy.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/node-exporter-role.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/node-exporter-rolebinding.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/pushgateway-ingress.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/pushgateway-networkpolicy.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/server-ingress.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/server-networkpolicy.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/server-service-headless.yaml
---
# Source: cost-analyzer/charts/prometheus/templates/server-statefulset.yaml
---
# Source: cost-analyzer/templates/cost-analyzer-ingress-template.yaml
---
# Source: cost-analyzer/templates/cost-analyzer-network-policy.yaml
---
# Source: cost-analyzer/templates/cost-analyzer-prometheusrule-template.yaml
---
# Source: cost-analyzer/templates/cost-analyzer-servicemonitor-template.yaml
---
# Source: cost-analyzer/templates/external-grafana-config-map-template.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment