diff --git a/jsonnetfile.lock.json b/jsonnetfile.lock.json index 64e89c9bdec60ffedcc3d3478de84351be7852dd..6bc1aaa1fd88e102fd9169469c284d6736d11df3 100644 --- a/jsonnetfile.lock.json +++ b/jsonnetfile.lock.json @@ -8,7 +8,7 @@ "subdir": "contrib/kube-prometheus/jsonnet/kube-prometheus" } }, - "version": "d7afb094898de5817f3cb49807dee44513d6d121" + "version": "87358f68efee390c30c7d26ea98faeee331a177a" }, { "name": "ksonnet", @@ -28,7 +28,7 @@ "subdir": "" } }, - "version": "2644ba2e0002715d0a079b5e1214128f72cbcc3b" + "version": "3c341913ddd3882c8f1edc1c20accdbcaaf10525" }, { "name": "grafonnet", diff --git a/manifests/grafana-dashboardDefinitions.yaml b/manifests/grafana-dashboardDefinitions.yaml index e3fa61c7b6074fa319aaf3ed9257047801336b43..af2b2b0a860a5c2e86078b8d1f5198d0c30605cc 100644 --- a/manifests/grafana-dashboardDefinitions.yaml +++ b/manifests/grafana-dashboardDefinitions.yaml @@ -1915,7 +1915,91 @@ items: ], "spaceLength": 10, - "span": 3, + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": ":node_cpu_utilisation:avg1m", + "format": "time_series", + "instant": true, + "intervalFactor": 2, + "refId": "A" + } + ], + "thresholds": "70,80", + "timeFrom": null, + "timeShift": null, + "title": "CPU Utilisation", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "singlestat", + "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": false + } + ] + }, + { + "aliasColors": { + + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "format": "percentunit", + "id": 1, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + + ], + "nullPointMode": "null as zero", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + + ], + "spaceLength": 10, + "span": 2, "stack": false, "steppedLine": false, "targets": [ @@ -1975,7 +2059,7 @@ items: "datasource": "$datasource", "fill": 1, "format": "percentunit", - "id": 1, + "id": 2, "legend": { "avg": false, "current": false, @@ -1999,7 +2083,7 @@ items: ], "spaceLength": 10, - "span": 3, + "span": 2, "stack": false, "steppedLine": false, "targets": [ @@ -2059,7 +2143,7 @@ items: "datasource": "$datasource", "fill": 1, "format": "percentunit", - "id": 2, + "id": 3, "legend": { "avg": false, "current": false, @@ -2083,7 +2167,91 @@ items: ], "spaceLength": 10, - "span": 3, + "span": 2, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": ":node_memory_utilisation:", + "format": "time_series", + "instant": true, + "intervalFactor": 2, + "refId": "A" + } + ], + "thresholds": "70,80", + "timeFrom": null, + "timeShift": null, + "title": "Memory Utilisation", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "singlestat", + "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": false + } + ] + }, + { + "aliasColors": { + + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "format": "percentunit", + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + + ], + "nullPointMode": "null as zero", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + + ], + "spaceLength": 10, + "span": 2, "stack": false, "steppedLine": false, "targets": [ @@ -2143,7 +2311,7 @@ items: "datasource": "$datasource", "fill": 1, "format": "percentunit", - "id": 3, + "id": 5, "legend": { "avg": false, "current": false, @@ -2167,7 +2335,7 @@ items: ], "spaceLength": 10, - "span": 3, + "span": 2, "stack": false, "steppedLine": false, "targets": [ @@ -2238,7 +2406,7 @@ items: "dashes": false, "datasource": "$datasource", "fill": 10, - "id": 4, + "id": 6, "legend": { "avg": false, "current": false, @@ -2336,7 +2504,7 @@ items: "dashes": false, "datasource": "$datasource", "fill": 1, - "id": 5, + "id": 7, "legend": { "avg": false, "current": false, @@ -2603,7 +2771,7 @@ items: "dashes": false, "datasource": "$datasource", "fill": 10, - "id": 6, + "id": 8, "legend": { "avg": false, "current": false, @@ -2701,7 +2869,7 @@ items: "dashes": false, "datasource": "$datasource", "fill": 1, - "id": 7, + "id": 9, "legend": { "avg": false, "current": false, @@ -4792,11 +4960,25 @@ items: "steppedLine": false, "targets": [ { - "expr": "1 - (avg by (cpu) (irate(node_cpu{job=\"node-exporter\", mode=\"idle\", instance=\"$instance\"}[5m])))\n", + "expr": "max(node_load1{job=\"node-exporter\", instance=\"$instance\"})", "format": "time_series", - "intervalFactor": 10, - "legendFormat": "{{cpu}}", + "intervalFactor": 2, + "legendFormat": "load 1m", "refId": "A" + }, + { + "expr": "max(node_load5{job=\"node-exporter\", instance=\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "load 5m", + "refId": "B" + }, + { + "expr": "max(node_load15{job=\"node-exporter\", instance=\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "load 15m", + "refId": "C" } ], "thresholds": [ @@ -4804,7 +4986,7 @@ items: ], "timeFrom": null, "timeShift": null, - "title": "Idle CPU", + "title": "System load", "tooltip": { "shared": true, "sort": 0, @@ -4825,16 +5007,16 @@ items: "format": "percentunit", "label": null, "logBase": 1, - "max": 1, - "min": 0, + "max": null, + "min": null, "show": true }, { "format": "percentunit", "label": null, "logBase": 1, - "max": 1, - "min": 0, + "max": null, + "min": null, "show": true } ] @@ -4883,25 +5065,11 @@ items: "steppedLine": false, "targets": [ { - "expr": "max(node_load1{job=\"node-exporter\", instance=\"$instance\"})", + "expr": "avg by (cpu) (irate(node_cpu{job=\"node-exporter\", mode!=\"idle\", instance=\"$instance\"}[5m])) * 100", "format": "time_series", "intervalFactor": 2, - "legendFormat": "load 1m", + "legendFormat": "{{cpu}}", "refId": "A" - }, - { - "expr": "max(node_load5{job=\"node-exporter\", instance=\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "load 5m", - "refId": "B" - }, - { - "expr": "max(node_load15{job=\"node-exporter\", instance=\"$instance\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "load 15m", - "refId": "C" } ], "thresholds": [ @@ -4971,6 +5139,191 @@ items: }, "id": 4, + "legend": { + "alignAsTable": "true", + "avg": "true", + "current": "true", + "max": "false", + "min": "false", + "rightSide": "true", + "show": "true", + "total": "false", + "values": "true" + }, + "lines": true, + "linewidth": 1, + "links": [ + + ], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "repeat": null, + "seriesOverrides": [ + + ], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg (sum by (cpu) (irate(node_cpu{job=\"node-exporter\", mode!=\"idle\", instance=\"$instance\"}[2m])) ) * 100\n", + "format": "time_series", + "intervalFactor": 10, + "legendFormat": "{{ cpu }}", + "refId": "A" + } + ], + "thresholds": [ + + ], + "timeFrom": null, + "timeShift": null, + "title": "CPU Utilizaion", + "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": 100, + "min": 0, + "show": true + }, + { + "format": "percent", + "label": null, + "logBase": 1, + "max": 100, + "min": 0, + "show": true + } + ] + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "$datasource", + "format": "percent", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + + }, + "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" + } + ], + "span": 3, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(sum by (cpu) (irate(node_cpu{job=\"node-exporter\", mode!=\"idle\", instance=\"$instance\"}[2m]))) * 100\n", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "" + } + ], + "thresholds": "80, 90", + "title": "CPU Usage", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6", + "type": "row" + }, + { + "collapse": false, + "collapsed": false, + "height": "250px", + "panels": [ + { + "aliasColors": { + + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + + }, + "id": 6, "legend": { "alignAsTable": false, "avg": false, @@ -5091,7 +5444,7 @@ items: "gridPos": { }, - "id": 5, + "id": 7, "interval": null, "links": [ @@ -5176,7 +5529,7 @@ items: "gridPos": { }, - "id": 6, + "id": 8, "legend": { "alignAsTable": false, "avg": false, @@ -5297,7 +5650,7 @@ items: "gridPos": { }, - "id": 7, + "id": 9, "interval": null, "links": [ @@ -5382,7 +5735,7 @@ items: "gridPos": { }, - "id": 8, + "id": 10, "legend": { "alignAsTable": false, "avg": false, @@ -5473,7 +5826,7 @@ items: "gridPos": { }, - "id": 9, + "id": 11, "legend": { "alignAsTable": false, "avg": false, diff --git a/manifests/prometheus-roleBindingDefault.yaml b/manifests/prometheus-roleBindingDefault.yaml deleted file mode 100644 index c40397108012dde1390d3e5e5301c77f2d41b1fb..0000000000000000000000000000000000000000 --- a/manifests/prometheus-roleBindingDefault.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: prometheus-k8s - namespace: default -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: prometheus-k8s -subjects: -- kind: ServiceAccount - name: prometheus-k8s - namespace: monitoring diff --git a/manifests/prometheus-roleBindingKubeSystem.yaml b/manifests/prometheus-roleBindingKubeSystem.yaml deleted file mode 100644 index 250c7307540671cb11c18185cdb7a80d38c42647..0000000000000000000000000000000000000000 --- a/manifests/prometheus-roleBindingKubeSystem.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: prometheus-k8s - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: prometheus-k8s -subjects: -- kind: ServiceAccount - name: prometheus-k8s - namespace: monitoring diff --git a/manifests/prometheus-roleBindingNamespace.yaml b/manifests/prometheus-roleBindingNamespace.yaml deleted file mode 100644 index 068c77d37d9b1c54b6216994b01efd260b64a35a..0000000000000000000000000000000000000000 --- a/manifests/prometheus-roleBindingNamespace.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: prometheus-k8s - namespace: monitoring -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: prometheus-k8s -subjects: -- kind: ServiceAccount - name: prometheus-k8s - namespace: monitoring diff --git a/manifests/prometheus-roleBindingSpecificNamespaces.yaml b/manifests/prometheus-roleBindingSpecificNamespaces.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c7527f6aa1330f894adb83136444c8160ea92e90 --- /dev/null +++ b/manifests/prometheus-roleBindingSpecificNamespaces.yaml @@ -0,0 +1,42 @@ +apiVersion: rbac.authorization.k8s.io/v1 +items: +- apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: prometheus-k8s + namespace: default + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: prometheus-k8s + subjects: + - kind: ServiceAccount + name: prometheus-k8s + namespace: monitoring +- apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: prometheus-k8s + namespace: kube-system + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: prometheus-k8s + subjects: + - kind: ServiceAccount + name: prometheus-k8s + namespace: monitoring +- apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: prometheus-k8s + namespace: monitoring + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: prometheus-k8s + subjects: + - kind: ServiceAccount + name: prometheus-k8s + namespace: monitoring +kind: RoleBindingList diff --git a/manifests/prometheus-roleDefault.yaml b/manifests/prometheus-roleDefault.yaml deleted file mode 100644 index 1c336117a26c5efa32dca57a1b73c2a8b4245162..0000000000000000000000000000000000000000 --- a/manifests/prometheus-roleDefault.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: prometheus-k8s - namespace: default -rules: -- apiGroups: - - "" - resources: - - nodes - - services - - endpoints - - pods - verbs: - - get - - list - - watch diff --git a/manifests/prometheus-roleKubeSystem.yaml b/manifests/prometheus-roleKubeSystem.yaml deleted file mode 100644 index d82fe3ab8b2d12352dcf390a4dc8cf4d47277b1c..0000000000000000000000000000000000000000 --- a/manifests/prometheus-roleKubeSystem.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: prometheus-k8s - namespace: kube-system -rules: -- apiGroups: - - "" - resources: - - nodes - - services - - endpoints - - pods - verbs: - - get - - list - - watch diff --git a/manifests/prometheus-roleNamespace.yaml b/manifests/prometheus-roleNamespace.yaml deleted file mode 100644 index 343cfc6dff7e41ff59ced5a55f093da3032aecd7..0000000000000000000000000000000000000000 --- a/manifests/prometheus-roleNamespace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: prometheus-k8s - namespace: monitoring -rules: -- apiGroups: - - "" - resources: - - nodes - - services - - endpoints - - pods - verbs: - - get - - list - - watch diff --git a/manifests/prometheus-roleSpecificNamespaces.yaml b/manifests/prometheus-roleSpecificNamespaces.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b305774acb0327f0048282118132d635578cea2f --- /dev/null +++ b/manifests/prometheus-roleSpecificNamespaces.yaml @@ -0,0 +1,54 @@ +apiVersion: rbac.authorization.k8s.io/v1 +items: +- apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: prometheus-k8s + namespace: default + rules: + - apiGroups: + - "" + resources: + - nodes + - services + - endpoints + - pods + verbs: + - get + - list + - watch +- apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: prometheus-k8s + namespace: kube-system + rules: + - apiGroups: + - "" + resources: + - nodes + - services + - endpoints + - pods + verbs: + - get + - list + - watch +- apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: prometheus-k8s + namespace: monitoring + rules: + - apiGroups: + - "" + resources: + - nodes + - services + - endpoints + - pods + verbs: + - get + - list + - watch +kind: RoleList