kind: ConfigMap
apiVersion: v1
metadata:
  name: grafana-dashboard-k8s-namespaces-in-cluster-ocp311
  namespace: open-cluster-management-observability
  annotations:
    observability.open-cluster-management.io/dashboard-folder: "OCP 3.11"
data:
  k8s-namespaces-in-cluster-ocp311.json: |
    {
      "__inputs": [],
      "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": null,
      "iteration": 1570200640181,
      "links": [],
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
          "fill": 1,
          "gridPos": {
            "h": 5,
            "w": 12,
            "x": 0,
            "y": 0
          },
          "id": 15,
          "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 by (phase) (    \n    ( kube_pod_status_phase{namespace=~\"$Namespace\",cluster=\"$cluster\"}\n      or\n      label_replace ( kube_pod_status_ready{namespace=~\"$Namespace\",condition=\"true\",cluster=\"$cluster\"}, \"phase\",\"Ready\",\"\",\"\" )\n    )\n) ",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{phase}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Pod Phase",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "decimals": null,
              "format": "locale",
              "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": "$datasource",
          "fill": 1,
          "gridPos": {
            "h": 5,
            "w": 12,
            "x": 12,
            "y": 0
          },
          "id": 17,
          "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 (increase(kube_pod_container_status_restarts_total{cluster=\"$cluster\",namespace=~\"$Namespace\"}[1h])) by (namespace) ",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{namespace}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Pod Restarts",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "decimals": null,
              "format": "locale",
              "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": 5
          },
          "id": 11,
          "panels": [],
          "repeat": null,
          "title": "CPU",
          "type": "row"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
          "fill": 1,
          "gridPos": {
            "h": 6,
            "w": 12,
            "x": 0,
            "y": 6
          },
          "id": 6,
          "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,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum by (namespace) (\n    namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{namespace=~\"$Namespace\", cluster=\"$cluster\"}\n    ) ",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "{{namespace}}",
              "legendLink": null,
              "refId": "A",
              "step": 10
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "CPU Usage",
          "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": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "columns": [],
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
          "fill": 1,
          "fontSize": "100%",
          "gridPos": {
            "h": 6,
            "w": 12,
            "x": 12,
            "y": 6
          },
          "id": 7,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [
            {
              "type": "dashboard"
            }
          ],
          "nullPointMode": "null as zero",
          "pageSize": null,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "scroll": true,
          "seriesOverrides": [],
          "showHeader": true,
          "sort": {
            "col": 3,
            "desc": false
          },
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "styles": [
            {
              "alias": "Time",
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "pattern": "Time",
              "type": "hidden"
            },
            {
              "alias": "CPU Usage",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #A",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "CPU Requests",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #B",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "CPU Requests %",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #C",
              "thresholds": [],
              "type": "number",
              "unit": "percentunit"
            },
            {
              "alias": "CPU Limits",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #D",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "CPU Limits %",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #E",
              "thresholds": [],
              "type": "number",
              "unit": "percentunit"
            },
            {
              "alias": "Namespace",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTooltip": "Drill down to Namespaces",
              "linkUrl": "./d/pods-in-namespaces/kubernetes-pods-in-namespace-ocp-3-11?var-datasource=$datasource&var-Namespace=$__cell",
              "pattern": "namespace",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "pattern": "/.*/",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "expr": "sum by (namespace) (\n    namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{namespace=~\"$Namespace\", cluster=\"$cluster\"}\n    ) ",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "A",
              "step": 10
            },
            {
              "expr": "sum by (namespace) (kube_pod_container_resource_requests_cpu_cores{namespace=~\"$Namespace\", cluster=\"$cluster\"}) ",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "B",
              "step": 10
            },
            {
              "expr": "sum(namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace) / sum(kube_pod_container_resource_requests_cpu_cores{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)\n",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "C",
              "step": 10
            },
            {
              "expr": "sum(kube_pod_container_resource_limits_cpu_cores{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "D",
              "step": 10
            },
            {
              "expr": "sum(namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace) / sum(kube_pod_container_resource_limits_cpu_cores{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "E",
              "step": 10
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "CPU Quota",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transform": "table",
          "type": "table",
          "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
            }
          ]
        },
        {
          "collapsed": false,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 12
          },
          "id": 13,
          "panels": [],
          "repeat": null,
          "title": "Memory",
          "type": "row"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
          "fill": 1,
          "gridPos": {
            "h": 6,
            "w": 12,
            "x": 0,
            "y": 13
          },
          "id": 8,
          "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,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum(container_memory_rss{container_name!=\"\",namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "{{namespace}}",
              "legendLink": null,
              "refId": "A",
              "step": 10
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Memory Usage (w/o cache)",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "label": null,
              "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,
          "columns": [],
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
          "fill": 1,
          "fontSize": "100%",
          "gridPos": {
            "h": 6,
            "w": 12,
            "x": 12,
            "y": 13
          },
          "id": 9,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null as zero",
          "pageSize": null,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "scroll": true,
          "seriesOverrides": [],
          "showHeader": true,
          "sort": {
            "col": 0,
            "desc": true
          },
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "styles": [
            {
              "alias": "Time",
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "pattern": "Time",
              "type": "hidden"
            },
            {
              "alias": "Memory Usage",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": null,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #A",
              "thresholds": [],
              "type": "number",
              "unit": "bytes"
            },
            {
              "alias": "Memory Requests",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": null,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #B",
              "thresholds": [],
              "type": "number",
              "unit": "bytes"
            },
            {
              "alias": "Memory Requests %",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #C",
              "thresholds": [],
              "type": "number",
              "unit": "percentunit"
            },
            {
              "alias": "Memory Limits",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #D",
              "thresholds": [],
              "type": "number",
              "unit": "bytes"
            },
            {
              "alias": "Memory Limits %",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "linkTooltip": "Drill down",
              "linkUrl": "",
              "pattern": "Value #E",
              "thresholds": [],
              "type": "number",
              "unit": "percentunit"
            },
            {
              "alias": "Namespace",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTooltip": "Drill down to Namespaces",
              "linkUrl": "./d/pods-in-namespaces/kubernetes-pods-in-namespace-ocp-3-11?var-datasource=$datasource&var-Namespace=$__cell",
              "pattern": "namespace",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "pattern": "/.*/",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "expr": "sum(container_memory_rss{container_name!=\"\",namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "A",
              "step": 10
            },
            {
              "expr": "sum(kube_pod_container_resource_requests_memory_bytes{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "B",
              "step": 10
            },
            {
              "expr": "sum(container_memory_rss{container_name!=\"\",namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace) / sum(kube_pod_container_resource_requests_memory_bytes{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "C",
              "step": 10
            },
            {
              "expr": "sum(kube_pod_container_resource_limits_memory_bytes{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "D",
              "step": 10
            },
            {
              "expr": "sum(container_memory_rss{container_name!=\"\",namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace) / sum(kube_pod_container_resource_limits_memory_bytes{namespace=~\"$Namespace\", cluster=\"$cluster\"}) by (namespace)",
              "format": "table",
              "instant": true,
              "intervalFactor": 2,
              "legendFormat": "",
              "refId": "E",
              "step": 10
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "Requests by Namespace",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transform": "table",
          "type": "table",
          "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
            }
          ]
        }
      ],
      "refresh": "10s",
      "schemaVersion": 16,
      "style": "dark",
      "tags": [
        "kubernetes-mixin"
      ],
      "templating": {
        "list": [
          {
            "allValue": null,
            "current": {},
            "datasource": "$datasource",
            "definition": "label_values(kube_pod_info{clusterType=\"ocp3\"},cluster)",
            "hide": 0,
            "includeAll": false,
            "label": null,
            "multi": false,
            "name": "cluster",
            "options": [],
            "query": "label_values(kube_pod_info{clusterType=\"ocp3\"},cluster)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 0,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          },
          {
            "allValue": "",
            "current": {},
            "datasource": "$datasource",
            "definition": "label_values(kube_namespace_labels{cluster=\"$cluster\"},namespace)",
            "hide": 0,
            "includeAll": true,
            "label": "Project",
            "multi": true,
            "name": "Namespace",
            "options": [],
            "query": "label_values(kube_namespace_labels{cluster=\"$cluster\"},namespace)",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
          },
          {
            "current": {
              "text": "prometheus",
              "value": "prometheus"
            },
            "hide": 0,
            "label": null,
            "name": "datasource",
            "options": [],
            "query": "prometheus",
            "refresh": 1,
            "regex": "",
            "skipUrlSync": false,
            "type": "datasource"
          }
        ]
      },
      "time": {
        "from": "now-1h",
        "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": "Kubernetes / Namespaces in Cluster - OCP 3.11",
      "uid": "namespaces-in-cluster",
      "version": 17
    }
