diff --git a/cost-analyzer/Chart.yaml b/cost-analyzer/Chart.yaml index b337858cd..0d840cf99 100755 --- a/cost-analyzer/Chart.yaml +++ b/cost-analyzer/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 -appVersion: "1.75.1" +appVersion: "1.76.0" description: A Helm chart that sets up Kubecost, Prometheus, and Grafana to monitor cloud costs. name: cost-analyzer -version: 1.75.1 +version: 1.76.0 diff --git a/cost-analyzer/attached-disks.json b/cost-analyzer/attached-disks.json index 0ae9d4411..88f60d983 100644 --- a/cost-analyzer/attached-disks.json +++ b/cost-analyzer/attached-disks.json @@ -24,7 +24,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 9, @@ -107,7 +107,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 9, @@ -191,7 +191,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 9, @@ -275,7 +275,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 9, @@ -369,7 +369,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": null, @@ -386,6 +386,25 @@ "tagsQuery": "", "type": "query", "useTags": false + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/cluster-metrics.json b/cost-analyzer/cluster-metrics.json index 0e6638252..7c70a4095 100644 --- a/cost-analyzer/cluster-metrics.json +++ b/cost-analyzer/cluster-metrics.json @@ -44,7 +44,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Monthly run rate of CPU + GPU costs based on currently provisioned resources.", "format": "currencyUSD", @@ -132,7 +132,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Monthly run rate of memory costs based on currently provisioned expenses.", "format": "currencyUSD", @@ -220,7 +220,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Monthly run rate of attached storage and PV costs based on currently provisioned resources.", "format": "currencyUSD", @@ -308,7 +308,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Sum of compute, memory, storage and network costs.", "format": "currencyUSD", @@ -396,7 +396,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Current CPU use from applications divided by allocatable CPUs", "editable": true, @@ -486,7 +486,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Current CPU reservation requests from applications vs allocatable CPU", "editable": true, @@ -574,7 +574,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Current RAM use vs RAM available", "editable": true, "error": false, @@ -670,7 +670,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Current RAM requests vs RAM available", "editable": true, "error": false, @@ -758,7 +758,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "This gauge shows the current standard storage use, including cluster storage, vs storage available", "editable": true, @@ -844,7 +844,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Monthly run rate of CPU + GPU costs", "fill": 1, "gridPos": { @@ -930,7 +930,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Monthly run rate of memory costs", "fill": 1, "gridPos": { @@ -1016,7 +1016,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Monthly run rate of attached disk + PV storage costs", "fill": 1, "gridPos": { @@ -1102,7 +1102,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Sum of compute, memory, and storage costs", "fill": 1, "gridPos": { @@ -1185,7 +1185,7 @@ }, { "columns": [], - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Cost of by resource class of currently provisioned nodes", "fontSize": "100%", "gridPos": { @@ -1372,7 +1372,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Monthly run rate of attached disk + PV storage costs based on currently provisioned resources.", "fill": 1, "gridPos": { @@ -1624,6 +1624,25 @@ "query": ".12", "skipUrlSync": false, "type": "constant" + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/cluster-utilization.json b/cost-analyzer/cluster-utilization.json index 0c3acfc76..50f6aec1f 100644 --- a/cost-analyzer/cluster-utilization.json +++ b/cost-analyzer/cluster-utilization.json @@ -48,7 +48,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "format":"currencyUSD", "gauge":{ @@ -137,7 +137,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "format":"currencyUSD", "gauge":{ @@ -226,7 +226,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "format":"currencyUSD", "gauge":{ @@ -315,7 +315,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Represents a near worst-case approximation of network costs.", "format":"currencyUSD", @@ -405,7 +405,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Current CPU use from applications divided by allocatable CPUs", "editable":true, @@ -497,7 +497,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Current CPU reservation requests from applications vs allocatable CPU", "editable":true, @@ -587,7 +587,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"Current RAM use vs RAM available", "editable":true, "error":false, @@ -685,7 +685,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"Current RAM requests vs RAM available", "editable":true, "error":false, @@ -775,7 +775,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"This gauge shows the current standard storage use, including cluster storage, vs storage available", "editable":true, @@ -867,7 +867,7 @@ "rgba(50, 172, 45, 0.97)", "#c15c17" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"This gauge shows the current SSD use vs SSD available", "editable":true, @@ -959,7 +959,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Expected monthly cost given current CPU, memory storage, and network resource consumption", "format":"currencyUSD", @@ -1047,7 +1047,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"Expected monthly CPU, memory and storage costs given provisioned resources", "fill":1, "gridPos":{ @@ -1142,7 +1142,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"Resources allocated to namespace based on container requests", "fontSize":"100%", "gridPos":{ @@ -1380,7 +1380,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":8, @@ -1498,7 +1498,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":8, @@ -1592,7 +1592,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"This table shows the comparison of CPU requests and usage by namespace", "fontSize":"100%", "gridPos":{ @@ -1761,7 +1761,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"This table shows the comparison of application CPU usage vs the capacity of the node (measured over last 60 minutes)", "fontSize":"100%", "gridPos":{ @@ -1922,7 +1922,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":8, @@ -2037,7 +2037,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":8, @@ -2131,7 +2131,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"Comparison of memory requests and current usage by namespace", "fontSize":"100%", "gridPos":{ @@ -2301,7 +2301,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"Container RAM usage vs node capacity", "fontSize":"100%", "gridPos":{ @@ -2462,7 +2462,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "fontSize":"100%", "gridPos":{ "h":9, @@ -2669,7 +2669,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":9, @@ -2763,7 +2763,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "fontSize":"100%", "gridPos":{ "h":10, @@ -2973,7 +2973,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":10, @@ -3074,7 +3074,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":9, @@ -3183,7 +3183,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "fill":1, "gridPos":{ "h":9, @@ -3433,6 +3433,25 @@ "query":"30", "skipUrlSync":false, "type":"constant" + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/deployment-utilization.json b/cost-analyzer/deployment-utilization.json index ff5526c15..9f92fd0dd 100644 --- a/cost-analyzer/deployment-utilization.json +++ b/cost-analyzer/deployment-utilization.json @@ -29,7 +29,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "percent", @@ -115,7 +115,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "editable": true, "error": false, @@ -201,7 +201,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "percent", @@ -285,7 +285,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "bytes", @@ -369,7 +369,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "bytes", @@ -453,7 +453,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "none", @@ -537,7 +537,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "none", @@ -620,7 +620,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "none", @@ -704,7 +704,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "format": "none", @@ -785,7 +785,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 3, "editable": true, "error": false, @@ -909,7 +909,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "editable": true, "error": false, @@ -1029,7 +1029,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 9, @@ -1118,7 +1118,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "editable": true, "error": false, @@ -1238,7 +1238,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": null, @@ -1262,7 +1262,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": null, @@ -1286,7 +1286,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": null, @@ -1310,7 +1310,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": null, @@ -1327,6 +1327,25 @@ "tagsQuery": "", "type": "query", "useTags": false + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/label-cost-utilization.json b/cost-analyzer/label-cost-utilization.json index 46d508aa0..673f32e71 100644 --- a/cost-analyzer/label-cost-utilization.json +++ b/cost-analyzer/label-cost-utilization.json @@ -28,7 +28,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Monthly projected CPU cost given last 10m", "format": "currencyUSD", @@ -116,7 +116,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Based on CPU usage over last 24 hours", "format": "currencyUSD", @@ -204,7 +204,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "", "format": "currencyUSD", @@ -292,7 +292,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Cost of memory + CPU usage", "format": "currencyUSD", @@ -380,7 +380,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "format": "none", "gauge": { "maxValue": 100, @@ -460,7 +460,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "format": "none", "gauge": { @@ -541,7 +541,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 0, "format": "bytes", "gauge": { @@ -622,7 +622,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "format": "bytes", "gauge": { "maxValue": 100, @@ -703,7 +703,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 0, "format": "bytes", "gauge": { @@ -781,7 +781,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 8, @@ -879,7 +879,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fill": 1, "gridPos": { "h": 8, @@ -984,7 +984,7 @@ "templating": { "list": [ { - "datasource": "default-kubecost", + "datasource": "${datasource}", "filters": [], "hide": 0, "label": "", @@ -1062,7 +1062,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": "Value", @@ -1086,7 +1086,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": "", @@ -1111,7 +1111,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": true, "label": null, @@ -1154,6 +1154,25 @@ "tagsQuery": "", "type": "query", "useTags": false + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/namespace-utilization.json b/cost-analyzer/namespace-utilization.json index 7260cced1..414bbd05a 100644 --- a/cost-analyzer/namespace-utilization.json +++ b/cost-analyzer/namespace-utilization.json @@ -236,7 +236,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "fontSize":"100%", "gridPos":{ "h":9, @@ -375,7 +375,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "description":"CPU requests by pod divided by the rate of CPU usage over the last hour", "fill":1, "gridPos":{ @@ -469,7 +469,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "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, @@ -586,7 +586,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "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, @@ -696,7 +696,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Traffic in and out of this namespace, as a sum of the pods within it", "editable":true, @@ -822,7 +822,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Disk reads and writes for the namespace, as a sum of the pods within it", "editable":true, @@ -1084,7 +1084,7 @@ "text":"kube-system", "value":"kube-system" }, - "datasource":"default-kubecost", + "datasource":"${datasource}", "hide":0, "includeAll":false, "label":"NS", @@ -1107,7 +1107,7 @@ "useTags":false }, { - "datasource":"default-kubecost", + "datasource":"${datasource}", "filters":[ ], @@ -1116,6 +1116,25 @@ "name":"Filters", "skipUrlSync":false, "type":"adhoc" + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/node-utilization.json b/cost-analyzer/node-utilization.json index ce751c199..61e042a5a 100644 --- a/cost-analyzer/node-utilization.json +++ b/cost-analyzer/node-utilization.json @@ -30,7 +30,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "format":"percentunit", "gauge":{ "maxValue":100, @@ -112,7 +112,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "format":"percentunit", "gauge":{ "maxValue":100, @@ -194,7 +194,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "format":"percentunit", "gauge":{ "maxValue":100, @@ -274,7 +274,7 @@ "value":"avg" } ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "fontSize":"100%", "gridPos":{ "h":8, @@ -491,7 +491,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":0, "format":"none", "gauge":{ @@ -575,7 +575,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "format":"bytes", "gauge":{ "maxValue":100, @@ -657,7 +657,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "format":"none", "gauge":{ "maxValue":100, @@ -739,7 +739,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource":"default-kubecost", + "datasource":"${datasource}", "format":"bytes", "gauge":{ "maxValue":100, @@ -819,7 +819,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":3, "description":"This panel shows historical utilization for the node.", "editable":true, @@ -936,7 +936,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"This panel shows historical utilization for the node.", "editable":true, @@ -1049,7 +1049,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Traffic in and out of this namespace, as a sum of the pods within it", "editable":true, @@ -1175,7 +1175,7 @@ "bars":false, "dashLength":10, "dashes":false, - "datasource":"default-kubecost", + "datasource":"${datasource}", "decimals":2, "description":"Disk reads and writes for the namespace, as a sum of the pods within it", "editable":true, @@ -1310,7 +1310,7 @@ "text":"ip-172-20-44-170.us-east-2.compute.internal", "value":"ip-172-20-44-170.us-east-2.compute.internal" }, - "datasource":"default-kubecost", + "datasource":"${datasource}", "hide":0, "includeAll":false, "label":null, @@ -1331,6 +1331,25 @@ "tagsQuery":"", "type":"query", "useTags":false + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/pod-utilization.json b/cost-analyzer/pod-utilization.json index 4e0abff2d..7118eac96 100644 --- a/cost-analyzer/pod-utilization.json +++ b/cost-analyzer/pod-utilization.json @@ -27,7 +27,7 @@ "value": "avg" } ], - "datasource": "default-kubecost", + "datasource": "${datasource}", "fontSize": "100%", "gridPos": { "h": 5, @@ -195,7 +195,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 3, "description": "This graph attempts to show you CPU use of your application vs its requests", "editable": true, @@ -307,7 +307,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 3, "description": "This graph attempts to show you RAM use of your application vs its requests", "editable": true, @@ -420,7 +420,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Traffic in and out of this pod, as a sum of its containers", "editable": true, @@ -534,7 +534,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "description": "Disk read writes", "editable": true, @@ -715,7 +715,7 @@ "text": "kubecost", "value": "kubecost" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": false, "label": "NS", @@ -741,7 +741,7 @@ "text": "kubecost-grafana-5cc9f5bf6-7kmgl", "value": "kubecost-grafana-5cc9f5bf6-7kmgl" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "hide": 0, "includeAll": false, "label": "Pod", @@ -758,6 +758,25 @@ "tagsQuery": "", "type": "query", "useTags": false + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/prom-benchmark.json b/cost-analyzer/prom-benchmark.json index 83c778bd5..0c5eae7e5 100644 --- a/cost-analyzer/prom-benchmark.json +++ b/cost-analyzer/prom-benchmark.json @@ -22,7 +22,7 @@ "panels": [ { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -39,7 +39,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -135,7 +135,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -230,7 +230,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -322,7 +322,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -345,7 +345,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -450,7 +450,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -552,7 +552,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -659,7 +659,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -769,7 +769,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -886,7 +886,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -984,7 +984,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -1009,7 +1009,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1138,7 +1138,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1244,7 +1244,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1356,7 +1356,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1463,7 +1463,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1581,7 +1581,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1748,7 +1748,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1854,7 +1854,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -1961,7 +1961,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -2075,7 +2075,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -2181,7 +2181,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -2287,7 +2287,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -2385,7 +2385,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -2413,7 +2413,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": null, "editable": true, "error": false, @@ -2549,7 +2549,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -2649,7 +2649,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "editable": true, "error": false, @@ -2762,7 +2762,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "editable": true, "error": false, @@ -2868,7 +2868,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "decimals": 2, "editable": true, "error": false, @@ -2977,7 +2977,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3076,7 +3076,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -3093,7 +3093,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3189,7 +3189,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3285,7 +3285,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3378,7 +3378,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -3395,7 +3395,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3491,7 +3491,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3611,7 +3611,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "fieldConfig": { "defaults": { "custom": {}, @@ -3704,7 +3704,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -3726,7 +3726,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "Time spent in each mode, per second", "editable": true, "error": false, @@ -3833,7 +3833,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -3948,7 +3948,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4046,7 +4046,7 @@ }, { "collapsed": true, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -4065,7 +4065,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4171,7 +4171,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4277,7 +4277,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4383,7 +4383,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4489,7 +4489,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4595,7 +4595,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -4707,7 +4707,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -4729,7 +4729,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "", "editable": true, "error": false, @@ -4836,7 +4836,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "", "editable": true, "error": false, @@ -4943,7 +4943,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "description": "", "editable": true, "error": false, @@ -5042,7 +5042,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -5074,7 +5074,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -5199,7 +5199,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -5305,7 +5305,7 @@ }, { "collapsed": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "gridPos": { "h": 1, "w": 24, @@ -5339,7 +5339,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -5467,7 +5467,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "default-kubecost", + "datasource": "${datasource}", "editable": true, "error": false, "fieldConfig": { @@ -5588,7 +5588,7 @@ "text": "localhost", "value": "localhost" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "definition": "", "hide": 0, "includeAll": false, @@ -5614,7 +5614,7 @@ "text": "All", "value": "$__all" }, - "datasource": "default-kubecost", + "datasource": "${datasource}", "definition": "", "hide": 2, "includeAll": true, @@ -5632,6 +5632,25 @@ "tagsQuery": "", "type": "query", "useTags": false + }, + { + "current": { + "selected": true, + "text": "default-kubecost", + "value": "default-kubecost" + }, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" } ] }, diff --git a/cost-analyzer/templates/cost-analyzer-checks-template.yaml b/cost-analyzer/templates/cost-analyzer-checks-template.yaml index 490764124..a65a6ee8e 100644 --- a/cost-analyzer/templates/cost-analyzer-checks-template.yaml +++ b/cost-analyzer/templates/cost-analyzer-checks-template.yaml @@ -27,7 +27,11 @@ spec: containers: - name: cost-analyzer-checks {{- if .Values.kubecostChecks }} + {{- if .Values.kubecostChecks.fullImageName }} + image: {{ .Values.kubecostChecks.fullImageName }} + {{- else }} image: {{ .Values.kubecostChecks.image }}:prod-{{ $.Chart.AppVersion }} + {{ end }} {{- else }} image: gcr.io/kubecost1/checks:prod-{{ $.Chart.AppVersion }} {{ end }} diff --git a/cost-analyzer/templates/cost-analyzer-deployment-template.yaml b/cost-analyzer/templates/cost-analyzer-deployment-template.yaml index 9024ea1f7..d68ad8bdd 100755 --- a/cost-analyzer/templates/cost-analyzer-deployment-template.yaml +++ b/cost-analyzer/templates/cost-analyzer-deployment-template.yaml @@ -199,7 +199,7 @@ spec: {{- end }} resources: {{ toYaml .Values.initChownData.resources | indent 12 }} - {{- if and (.Values.kubecostModel.etlToDisk | default true) .Values.persistentVolume.dbPVEnabled }} + {{- if and (.Values.kubecostModel.etlToDisk | default true) .Values.persistentVolume.dbPVEnabled }} command: ["sh", "-c", "/bin/chmod -R 777 /var/configs && /bin/chmod -R 777 /var/db"] {{- else }} command: ["sh", "-c", "/bin/chmod -R 777 /var/configs"] @@ -216,7 +216,9 @@ spec: {{ end }} containers: {{- if .Values.kubecostModel }} - {{- if .Values.imageVersion}} + {{- if .Values.kubecostModel.fullImageName }} + - image: {{ .Values.kubecostModel.fullImageName }} + {{- else if .Values.imageVersion }} - image: {{ .Values.kubecostModel.image }}:{{ .Values.imageVersion }} {{- else }} - image: {{ .Values.kubecostModel.image }}:prod-{{ $.Chart.AppVersion }} @@ -257,7 +259,7 @@ spec: - name: gcp-key-secret mountPath: /models {{- end }} - {{- if .Values.kubecostProductConfigs.azureStorageSecretName }} + {{- if or .Values.kubecostProductConfigs.azureStorageSecretName .Values.kubecostProductConfigs.azureStorageCreateSecret}} - name: azure-storage-config mountPath: /var/azure-storage-config {{- end }} @@ -349,7 +351,7 @@ spec: secretKeyRef: name: {{ .Values.global.prometheus.queryServiceBasicAuthSecretName }} key: PASSWORD - {{- end }} + {{- end }} {{- if .Values.global.prometheus.queryServiceBearerTokenSecretName }} - name: DB_BEARER_TOKEN valueFrom: @@ -436,6 +438,10 @@ spec: - name: ETL_STORE_DURATION_DAYS value: {{ (quote .Values.kubecostModel.etlStoreDurationDays) | default (quote 120) }} {{- end }} + - name: ETL_RESOLUTION_SECONDS + value: {{ (quote .Values.kubecostModel.etlResolutionSeconds) | default (quote 300) }} + - name: ETL_MAX_BATCH_HOURS + value: {{ (quote .Values.kubecostModel.etlMaxBatchHours) | default (quote 6) }} {{- if .Values.systemProxy.enabled }} - name: HTTP_PROXY value: {{ .Values.systemProxy.httpProxyUrl }} @@ -542,7 +548,9 @@ spec: - name: CUSTOM_ALERTS_ENABLED value: {{ (quote .Values.global.notifications.alertConfigs.enabled) | default (quote false) }} {{- if .Values.kubecostFrontend }} - {{- if .Values.imageVersion}} + {{- if .Values.kubecostFrontend.fullImageName }} + - image: {{ .Values.kubecostFrontend.fullImageName }} + {{- else if .Values.imageVersion }} - image: {{ .Values.kubecostFrontend.image }}:{{ .Values.imageVersion }} {{- else }} - image: {{ .Values.kubecostFrontend.image }}:prod-{{ $.Chart.AppVersion }} @@ -585,7 +593,9 @@ spec: periodSeconds: 10 failureThreshold: 200 {{- if .Values.kubecost }} - {{- if .Values.imageVersion}} + {{- if .Values.kubecost.fullImageName }} + - image: {{ .Values.kubecost.fullImageName }} + {{- else if .Values.imageVersion}} - image: {{ .Values.kubecost.image }}:{{ .Values.imageVersion }} {{- else }} - image: {{ .Values.kubecost.image }}:prod-{{ $.Chart.AppVersion }} @@ -707,7 +717,7 @@ spec: {{- if .Values.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.imagePullSecrets | indent 2 }} - {{- end }} + {{- end }} {{- if .Values.priority }} {{- if .Values.priority.enabled }} priorityClassName: {{ template "cost-analyzer.fullname" . }}-priority diff --git a/cost-analyzer/templates/cost-analyzer-network-costs-template.yaml b/cost-analyzer/templates/cost-analyzer-network-costs-template.yaml index cc2bf515b..24d9a1a6d 100644 --- a/cost-analyzer/templates/cost-analyzer-network-costs-template.yaml +++ b/cost-analyzer/templates/cost-analyzer-network-costs-template.yaml @@ -72,7 +72,7 @@ spec: {{- if .Values.networkCosts.priorityClassName }} priorityClassName: "{{ .Values.networkCosts.priorityClassName }}" {{- end }} - {{- with .Values.nodeSelector }} + {{- with .Values.networkCosts.nodeSelector }} nodeSelector: {{- toYaml . | nindent 10 }} {{- end }} diff --git a/cost-analyzer/templates/cost-analyzer-network-policy.yaml b/cost-analyzer/templates/cost-analyzer-network-policy.yaml index 872951bd1..c806c3d51 100644 --- a/cost-analyzer/templates/cost-analyzer-network-policy.yaml +++ b/cost-analyzer/templates/cost-analyzer-network-policy.yaml @@ -2,18 +2,49 @@ {{- if .Values.networkPolicy.enabled -}} apiVersion: {{ include "cost-analyzer.networkPolicy.apiVersion" . }} kind: NetworkPolicy +{{- if .Values.networkPolicy.denyEgress }} metadata: name: deny-egress labels: - {{ include "cost-analyzer.commonLabels" . | nindent 4 }} + {{- include "cost-analyzer.commonLabels" . | nindent 4 }} spec: podSelector: matchLabels: - {{ include "cost-analyzer.selectorLabels" . | nindent 6 }} + {{- include "cost-analyzer.selectorLabels" . | nindent 6 }} policyTypes: - Egress egress: - to: - namespaceSelector: {} +{{- else }} +{{- if .Values.networkPolicy.sameNamespace}} +metadata: + name: shared-namespace + namespace: {{ default "kubecost" .Values.networkPolicy.namespace}} +spec: + podSelector: + matchLabels: + app: prometheus + component: server +{{- else }} +metadata: + name: closed-traffic + namespace: {{ default "kubecost" .Values.networkPolicy.namespace}} +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: cost-analyzer +{{- end }} + policyTypes: + - Ingress + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: cost-analyzer + - namespaceSelector: + matchLabels: + name: k8s-kubecost +{{- end }} {{- end -}} {{- end -}} diff --git a/cost-analyzer/templates/grafana-datasource-template.yaml b/cost-analyzer/templates/grafana-datasource-template.yaml index e79d2fa35..d92a95023 100644 --- a/cost-analyzer/templates/grafana-datasource-template.yaml +++ b/cost-analyzer/templates/grafana-datasource-template.yaml @@ -10,7 +10,7 @@ metadata: namespace: {{ $.Values.grafana.namespace_datasources }} {{- end }} labels: - {{ include "cost-analyzer.commonLabels" . | nindent 4 }} + {{- include "cost-analyzer.commonLabels" . | nindent 4 }} {{- if $.Values.grafana.sidecar.datasources.label }} {{ $.Values.grafana.sidecar.datasources.label }}: "1" {{- else }} @@ -25,45 +25,29 @@ data: apiVersion: 1 datasources: - access: proxy -{{- if .Values.global.thanos }} -{{- if .Values.global.thanos.enabled }} - name: {{ default "Prometheus" .Values.grafana.sidecar.datasources.dataSourceName }} - isDefault: false -{{- else }} - name: "default-kubecost" -{{- if .Values.grafana.sidecar.datasources.defaultDatasourceEnabled }} - isDefault: true -{{- else }} - isDefault: false -{{- end }} -{{- end }} -{{- else }} - name: "default-kubecost" + name: default-kubecost + type: prometheus {{- if .Values.grafana.sidecar.datasources.defaultDatasourceEnabled }} isDefault: true {{- else }} isDefault: false {{- end }} -{{- end }} - type: prometheus +{{- if .Values.global.thanos }} +{{- if .Values.global.thanos.enabled }} {{- if .Values.global.prometheus.enabled }} - url: http://{{ template "cost-analyzer.prometheus.server.name" . }}.{{ .Release.Namespace }} + url: http://{{ .Release.Name }}-thanos-query-http.{{ .Release.Namespace }}:{{ .Values.thanos.query.http.port }} {{- else }} - url: {{ .Values.global.prometheus.fqdn }} + url: {{ .Values.global.thanos.queryService }} {{- end }} -{{- if .Values.global.thanos.enabled }} - access: proxy - name: "default-kubecost" - type: prometheus -{{- if .Values.grafana.sidecar.datasources.defaultDatasourceEnabled }} - isDefault: true -{{- else }} + name: {{ default "Prometheus" .Values.grafana.sidecar.datasources.dataSourceName}} isDefault: false + type: prometheus {{- end }} {{- if .Values.global.prometheus.enabled }} - url: http://{{ .Release.Name }}-thanos-query-http.{{ .Release.Namespace }}:{{ .Values.thanos.query.http.port }} -{{ else }} - url: {{ .Values.global.thanos.queryService }} + url: http://{{ template "cost-analyzer.prometheus.server.name" . }}.{{ .Release.Namespace }} +{{- else }} + url: {{ .Values.global.prometheus.fqdn }} {{- end }} {{- end }} {{- end -}} diff --git a/cost-analyzer/values.yaml b/cost-analyzer/values.yaml index 0f48fcb2f..9c3f8cb64 100755 --- a/cost-analyzer/values.yaml +++ b/cost-analyzer/values.yaml @@ -249,6 +249,9 @@ priority: # If true, enable creation of NetworkPolicy resources. networkPolicy: enabled: false + denyEgress: true # create a network policy that denies egress from kubecost + sameNamespace: true # Set to true if cost analyser and prometheus are on the same namespace +# namespace: kubecost # Namespace where prometheus is installed podSecurityPolicy: enabled: true @@ -335,7 +338,7 @@ prometheus: # value: "value" # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" alertmanager: - # enabled: false + enabled: false persistentVolume: enabled: true nodeExporter: @@ -471,6 +474,8 @@ networkCosts: enabled: false additionalLabels: {} additionalLabels: {} + nodeSelector: {} + # Kubecost Deployment Configuration # Used for HA mode in Business & Enterprise tier kubecostDeployment: @@ -522,7 +527,7 @@ grafana: # dataSourceFilename: foo.yml # If you need to change the name of the datasource file enabled: true defaultDatasourceEnabled: false - dataSourceName: default-kubecost + dataSourceName: prometheus-kubecost # label that the configmaps with datasources are marked with label: kubecost_grafana_datasource # For grafana to be accessible, add the path to root_url. For example, if you run kubecost at www.foo.com:9090/kubecost