apiVersion: v1
kind: ConfigMap
metadata:
  name: k8s-resources-persistent-volumes
data:
  k8s-resources-persistent-volumes.json: |-
    {
        "__inputs": [

        ],
        "__requires": [

        ],
        "annotations": {
            "list": [

            ]
        },
        "editable": true,
        "gnetId": null,
        "graphTooltip": 0,
        "hideControls": false,
        "id": null,
        "links": [

        ],
        "refresh": "",
        "rows": [
            {
                "collapse": false,
                "collapsed": false,
                "panels": [
                    {
                        "aliasColors": {

                        },
                        "bars": false,
                        "dashLength": 10,
                        "dashes": false,
                        "datasource": "prometheus",
                        "fill": 1,
                        "gridPos": {

                        },
                        "id": 2,
                        "legend": {
                            "alignAsTable": true,
                            "avg": true,
                            "current": true,
                            "max": true,
                            "min": true,
                            "rightSide": false,
                            "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": 9,
                        "stack": true,
                        "steppedLine": false,
                        "targets": [
                            {
                                "expr": "(\n  sum without(instance, node) (kubelet_volume_stats_capacity_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"})\n  -\n  sum without(instance, node) (kubelet_volume_stats_available_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"})\n)\n",
                                "format": "time_series",
                                "intervalFactor": 1,
                                "legendFormat": "Used Space",
                                "refId": "A"
                            },
                            {
                                "expr": "sum without(instance, node) (kubelet_volume_stats_available_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"})\n",
                                "format": "time_series",
                                "intervalFactor": 1,
                                "legendFormat": "Free Space",
                                "refId": "B"
                            }
                        ],
                        "thresholds": [

                        ],
                        "timeFrom": null,
                        "timeShift": null,
                        "title": "Volume Space Usage",
                        "tooltip": {
                            "shared": false,
                            "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": "bytes",
                                "label": null,
                                "logBase": 1,
                                "max": null,
                                "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": "prometheus",
                        "format": "percent",
                        "gauge": {
                            "maxValue": 100,
                            "minValue": 0,
                            "show": true,
                            "thresholdLabels": false,
                            "thresholdMarkers": true
                        },
                        "gridPos": {

                        },
                        "id": 3,
                        "interval": null,
                        "links": [

                        ],
                        "mappingType": 1,
                        "mappingTypes": [
                            {
                                "name": "value to text",
                                "value": 1
                            },
                            {
                                "name": "range to text",
                                "value": 2
                            }
                        ],
                        "maxDataPoints": 100,
                        "nullPointMode": "connected",
                        "nullText": null,
                        "postfix": "",
                        "postfixFontSize": "50%",
                        "prefix": "",
                        "prefixFontSize": "50%",
                        "rangeMaps": [
                            {
                                "from": "null",
                                "text": "N/A",
                                "to": "null"
                            }
                        ],
                        "span": 3,
                        "sparkline": {
                            "fillColor": "rgba(31, 118, 189, 0.18)",
                            "full": false,
                            "lineColor": "rgb(31, 120, 193)",
                            "show": false
                        },
                        "tableColumn": "",
                        "targets": [
                            {
                                "expr": "(\n  kubelet_volume_stats_capacity_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"}\n  -\n  kubelet_volume_stats_available_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"}\n)\n/\nkubelet_volume_stats_capacity_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"}\n* 100\n",
                                "format": "time_series",
                                "intervalFactor": 2,
                                "legendFormat": "",
                                "refId": "A"
                            }
                        ],
                        "thresholds": "80, 90",
                        "title": "Volume Space Usage",
                        "tooltip": {
                            "shared": false
                        },
                        "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,
                "panels": [
                    {
                        "aliasColors": {

                        },
                        "bars": false,
                        "dashLength": 10,
                        "dashes": false,
                        "datasource": "prometheus",
                        "fill": 1,
                        "gridPos": {

                        },
                        "id": 4,
                        "legend": {
                            "alignAsTable": true,
                            "avg": true,
                            "current": true,
                            "max": true,
                            "min": true,
                            "rightSide": false,
                            "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": 9,
                        "stack": true,
                        "steppedLine": false,
                        "targets": [
                            {
                                "expr": "sum without(instance, node) (kubelet_volume_stats_inodes_used{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"})\n",
                                "format": "time_series",
                                "intervalFactor": 1,
                                "legendFormat": "Used inodes",
                                "refId": "A"
                            },
                            {
                                "expr": "(\n  sum without(instance, node) (kubelet_volume_stats_inodes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"})\n  -\n  sum without(instance, node) (kubelet_volume_stats_inodes_used{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"})\n)\n",
                                "format": "time_series",
                                "intervalFactor": 1,
                                "legendFormat": " Free inodes",
                                "refId": "B"
                            }
                        ],
                        "thresholds": [

                        ],
                        "timeFrom": null,
                        "timeShift": null,
                        "title": "Volume inodes Usage",
                        "tooltip": {
                            "shared": false,
                            "sort": 0,
                            "value_type": "individual"
                        },
                        "type": "graph",
                        "xaxis": {
                            "buckets": null,
                            "mode": "time",
                            "name": null,
                            "show": true,
                            "values": [

                            ]
                        },
                        "yaxes": [
                            {
                                "format": "none",
                                "label": null,
                                "logBase": 1,
                                "max": null,
                                "min": 0,
                                "show": true
                            },
                            {
                                "format": "none",
                                "label": null,
                                "logBase": 1,
                                "max": null,
                                "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": "prometheus",
                        "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": "kubelet_volume_stats_inodes_used{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"}\n/\nkubelet_volume_stats_inodes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\", persistentvolumeclaim=\"$volume\"}\n* 100\n",
                                "format": "time_series",
                                "intervalFactor": 2,
                                "legendFormat": "",
                                "refId": "A"
                            }
                        ],
                        "thresholds": "80, 90",
                        "title": "Volume inodes Usage",
                        "tooltip": {
                            "shared": false
                        },
                        "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"
            }
        ],
        "schemaVersion": 14,
        "style": "dark",
        "tags": [
            "kubernetes",
            "resources"
        ],
        "templating": {
            "list": [

                {
                    "allValue": null,
                    "current": {

                    },
                    "datasource": "prometheus",
                    "hide": 2,
                    "includeAll": false,
                    "label": "cluster",
                    "multi": false,
                    "name": "cluster",
                    "options": [

                    ],
                    "query": "label_values(kubelet_volume_stats_capacity_bytes, cluster)",
                    "refresh": 2,
                    "regex": "",
                    "sort": 1,
                    "tagValuesQuery": "",
                    "tags": [

                    ],
                    "tagsQuery": "",
                    "type": "query",
                    "useTags": false
                },
                {
                    "allValue": null,
                    "current": {

                    },
                    "datasource": "prometheus",
                    "hide": 0,
                    "includeAll": false,
                    "label": "Namespace",
                    "multi": false,
                    "name": "namespace",
                    "options": [

                    ],
                    "query": "label_values(kubelet_volume_stats_capacity_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\"}, namespace)",
                    "refresh": 2,
                    "regex": "",
                    "sort": 1,
                    "tagValuesQuery": "",
                    "tags": [

                    ],
                    "tagsQuery": "",
                    "type": "query",
                    "useTags": false
                },
                {
                    "allValue": null,
                    "current": {

                    },
                    "datasource": "prometheus",
                    "hide": 0,
                    "includeAll": false,
                    "label": "PersistentVolumeClaim",
                    "multi": false,
                    "name": "volume",
                    "options": [

                    ],
                    "query": "label_values(kubelet_volume_stats_capacity_bytes{cluster=\"$cluster\", job=\"kubelet\", metrics_path=\"/metrics\", namespace=\"$namespace\"}, persistentvolumeclaim)",
                    "refresh": 2,
                    "regex": "",
                    "sort": 1,
                    "tagValuesQuery": "",
                    "tags": [

                    ],
                    "tagsQuery": "",
                    "type": "query",
                    "useTags": false
                }
            ]
        },
        "time": {
            "from": "now-7d",
            "to": "now"
        },
        "timepicker": {
            "refresh_intervals": [
                "5s",
                "10s",
                "30s",
                "1m",
                "5m",
                "15m",
                "30m",
                "1h",
                "2h",
                "1d"
            ],
            "time_options": [
                "5m",
                "15m",
                "1h",
                "6h",
                "12h",
                "24h",
                "2d",
                "7d",
                "30d"
            ]
        },
        "timezone": "",
        "title": "K8S - Resources - Persistent volumes",
        "uid": "k8s-resources-persistent-volumes",
        "version": 0
    }
