#kubectl apply -f 08-graffanadashboard.yaml - or go through process
apiVersion: v1
kind: ConfigMap
metadata:
  name: peoplefinder-development
  namespace: peoplefinder-development
  labels:
    grafana_dashboard: "peoplefinder-development"
data:
  peoplefinder-development-dashboard.json: |
    {
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": "-- Grafana --",
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "limit": 100,
            "name": "Annotations & Alerts",
            "showIn": 0,
            "type": "dashboard"
          }
        ]
      },
      "editable": true,
      "gnetId": null,
      "graphTooltip": 1,
      "id": 47,
      "links": [],
      "panels": [
        {
          "collapsed": false,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 0
          },
          "id": 12,
          "panels": [],
          "title": "Deployment Replicas",
          "type": "row"
        },
        {
          "columns": [],
          "datasource": "Prometheus",
          "fontSize": "100%",
          "gridPos": {
            "h": 6,
            "w": 9,
            "x": 0,
            "y": 1
          },
          "id": 6,
          "links": [],
          "pageSize": null,
          "scroll": false,
          "showHeader": true,
          "sort": {
            "col": 0,
            "desc": true
          },
          "styles": [
            {
              "alias": "Time",
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "pattern": "Time",
              "type": "hidden"
            },
            {
              "alias": "Available",
              "colorMode": "cell",
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "#7eb26d",
                "#3f6833"
              ],
              "decimals": 0,
              "pattern": "Value #A",
              "thresholds": [
                "0",
                "1"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "Desired",
              "colorMode": "value",
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 0,
              "mappingType": 1,
              "pattern": "Value #B",
              "thresholds": [
                "0",
                "1"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "alias": "Deployment",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "deplyoment",
              "thresholds": [
                ""
              ],
              "type": "string",
              "unit": "short",
              "valueMaps": []
            }
          ],
          "targets": [
            {
              "expr": "max(kube_deployment_status_replicas_available{namespace=\"peoplefinder-development\"}) by (deployment)",
              "format": "table",
              "hide": false,
              "instant": true,
              "interval": "",
              "intervalFactor": 2,
              "refId": "A"
            },
            {
              "expr": "max(kube_deployment_spec_replicas{namespace=\"peoplefinder-development\"}) by (deployment)",
              "format": "table",
              "hide": false,
              "instant": true,
              "intervalFactor": 2,
              "refId": "B"
            }
          ],
          "title": "Currently Active",
          "transform": "table",
          "type": "table"
        },
        {
          "aliasColors": {
            "{status=\"404\"}": "#bf1b00"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "decimals": null,
          "fill": 1,
          "gridPos": {
            "h": 6,
            "w": 14,
            "x": 10,
            "y": 1
          },
          "id": 15,
          "interval": "1m",
          "legend": {
            "alignAsTable": true,
            "avg": false,
            "current": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": null,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum(rate(nginx_ingress_controller_requests{exported_namespace = \"peoplefinder-development\", ingress = \"peoplefinder-ingress\"}[5m])) by(status)",
              "format": "time_series",
              "hide": false,
              "interval": "60s",
              "intervalFactor": 5,
              "legendFormat": "",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Request HTTP Codes",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transparent": true,
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "decimals": 2,
          "fill": 1,
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 7
          },
          "id": 17,
          "interval": "30s",
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "max": false,
            "min": true,
            "rightSide": true,
            "show": true,
            "sideWidth": 500,
            "total": true,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum by (pod_name)(rate(container_cpu_usage_seconds_total{namespace='peoplefinder-development'}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "60s",
              "intervalFactor": 2,
              "legendFormat": "POD: {{ pod_name}}",
              "refId": "A"
            },
            {
              "expr": "avg(kube_pod_container_resource_requests_cpu_cores{namespace='peoplefinder-development'})  ",
              "format": "time_series",
              "hide": false,
              "instant": false,
              "interval": "60s",
              "intervalFactor": 2,
              "legendFormat": "Requested (soft limit)",
              "refId": "B"
            },
            {
              "expr": "avg(kube_pod_container_resource_limits_cpu_cores{namespace='peoplefinder-development'})",
              "format": "time_series",
              "hide": false,
              "interval": "60s",
              "intervalFactor": 2,
              "legendFormat": "Limit (Hard Limit)",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "CPU Usage",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transparent": true,
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Limit (Hard Limit)": "#890f02"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "decimals": 2,
          "fill": 1,
          "gridPos": {
            "h": 6,
            "w": 24,
            "x": 0,
            "y": 14
          },
          "id": 16,
          "interval": "30s",
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": 500,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum by(pod_name)(container_memory_usage_bytes{namespace='peoplefinder-development'})",
              "format": "time_series",
              "hide": false,
              "interval": "60s",
              "intervalFactor": 2,
              "legendFormat": "POD: {{ pod_name}}",
              "refId": "A"
            },
            {
              "expr": "avg(kube_pod_container_resource_requests_memory_bytes{namespace='peoplefinder-development'})",
              "format": "time_series",
              "hide": false,
              "instant": false,
              "interval": "60s",
              "intervalFactor": 2,
              "legendFormat": "Requested (soft limit)",
              "refId": "B"
            },
            {
              "expr": "avg(kube_pod_container_resource_limits_memory_bytes{namespace='peoplefinder-development'})",
              "format": "time_series",
              "hide": false,
              "interval": "60s",
              "intervalFactor": 2,
              "legendFormat": "Limit (Hard Limit)",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Memory Usage",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transparent": true,
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "decimals": 2,
          "fill": 1,
          "gridPos": {
            "h": 6,
            "w": 24,
            "x": 0,
            "y": 20
          },
          "id": 19,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "max": false,
            "min": true,
            "rightSide": true,
            "show": true,
            "sideWidth": 500,
            "total": true,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "expr": "avg(rate(nginx_ingress_controller_request_duration_seconds_sum{exported_namespace = \"peoplefinder-development\", ingress = \"peoplefinder-ingress\"}[5m]) / rate(nginx_ingress_controller_request_duration_seconds_count{exported_namespace = \"peoplefinder-development\", ingress = \"peoplefinder-ingress\"}[5m]) > 0)",
              "format": "time_series",
              "interval": "30s",
              "intervalFactor": 2,
              "legendFormat": "Recv",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Average Request Duration",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transparent": true,
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "s",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "deckbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "decimals": 2,
          "fill": 1,
          "gridPos": {
            "h": 6,
            "w": 24,
            "x": 0,
            "y": 26
          },
          "id": 18,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "max": false,
            "min": true,
            "rightSide": true,
            "show": true,
            "sideWidth": 500,
            "total": true,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "expr": "sort_desc(avg(sum by (pod_name) (rate(container_network_receive_bytes_total{namespace='peoplefinder-development'}[5m]))))",
              "format": "time_series",
              "interval": "30s",
              "intervalFactor": 2,
              "legendFormat": "Recv",
              "refId": "A"
            },
            {
              "expr": "sort_desc(avg(sum by (pod_name) (rate(container_network_transmit_bytes_total{namespace='peoplefinder-development'}[5m]))))",
              "format": "time_series",
              "hide": false,
              "instant": false,
              "interval": "30s",
              "intervalFactor": 2,
              "legendFormat": "Sent",
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Network",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "transparent": true,
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "deckbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "deckbytes",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        }
      ],
      "refresh": false,
      "schemaVersion": 16,
      "style": "dark",
      "tags": [],
      "templating": {
        "list": []
      },
      "time": {
        "from": "now-7d",
        "to": "now"
      },
      "timepicker": {
        "refresh_intervals": [
          "5s",
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "2h",
          "1d"
        ],
        "time_options": [
          "5m",
          "15m",
          "1h",
          "6h",
          "12h",
          "24h",
          "2d",
          "7d",
          "30d"
        ]
      },
      "timezone": "browser",
      "title": "Peoplefinder development",
      "uid": "urj2fVsWz",
      "version": 6
    }