From 65d65ea1262f5a2842a3c2d3ec3fd80da3522dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Mon, 2 Jun 2025 12:32:14 +0200 Subject: [PATCH 1/4] chore: Cleanup old nix code and add helmfile experiments --- .envrc | 15 +- default.nix | 33 - flake.lock | 666 ------------------ flake.nix | 148 ---- generate.nix | 44 -- helmfile.d/atlantis.yaml.gotmpl | 20 - helmfile.d/kyverno.yaml.gotmpl | 46 ++ helmfile.d/nix/argo.gotmpl.nix | 92 +++ helmfile.d/nix/helmfile.gotmpl.nix | 94 +++ helmfile.d/postgres-operator.yaml.gotmpl | 45 ++ helmfile.d/prometheus.yaml.gotmpl | 42 ++ helmfile.d/velero.yaml.gotmpl | 42 ++ justfile | 25 +- nix/default.nix | 80 --- nix/sources.json | 47 -- npins/default.nix | 146 ++++ npins/sources.json | 37 + shell.nix | 43 +- statix.toml | 7 - .../{app.yaml => manifests/atlantis.yaml} | 0 .../kyverno/kustomize/base/kustomization.yaml | 4 + .../kustomize/default/kustomization.yaml | 4 + values/kyverno/manifests/kyverno.yaml | 39 + values/kyverno/values.yaml.gotmpl | 11 + values/kyverno/values/kyverno.yaml.gotmpl | 41 ++ .../kustomize/base/kustomization.yaml | 4 + .../kustomize/default/kustomization.yaml | 4 + .../manifests/postgres-operator.yaml | 34 + values/postgres-operator/values.yaml.gotmpl | 3 + values/prometheus/manifests/prometheus.yaml | 74 ++ values/prometheus/values-oceanbox.yaml.gotmpl | 15 + values/prometheus/values.yaml.gotmpl | 32 + .../prometheus/values/prometheus.yaml.gotmpl | 106 +++ .../velero/kustomize/base/kustomization.yaml | 4 + .../kustomize/default/kustomization.yaml | 4 + values/velero/manifests/velero.yaml | 34 + values/velero/values.yaml.gotmpl | 28 + values/velero/values/velero.yaml.gotmpl | 74 ++ 38 files changed, 1109 insertions(+), 1078 deletions(-) delete mode 100644 default.nix delete mode 100644 flake.lock delete mode 100644 flake.nix delete mode 100644 generate.nix create mode 100644 helmfile.d/kyverno.yaml.gotmpl create mode 100644 helmfile.d/nix/argo.gotmpl.nix create mode 100644 helmfile.d/nix/helmfile.gotmpl.nix create mode 100644 helmfile.d/postgres-operator.yaml.gotmpl create mode 100644 helmfile.d/prometheus.yaml.gotmpl create mode 100644 helmfile.d/velero.yaml.gotmpl delete mode 100644 nix/default.nix delete mode 100644 nix/sources.json create mode 100644 npins/default.nix create mode 100644 npins/sources.json delete mode 100644 statix.toml rename values/atlantis/{app.yaml => manifests/atlantis.yaml} (100%) create mode 100644 values/kyverno/kustomize/base/kustomization.yaml create mode 100644 values/kyverno/kustomize/default/kustomization.yaml create mode 100644 values/kyverno/manifests/kyverno.yaml create mode 100644 values/kyverno/values.yaml.gotmpl create mode 100644 values/kyverno/values/kyverno.yaml.gotmpl create mode 100644 values/postgres-operator/kustomize/base/kustomization.yaml create mode 100644 values/postgres-operator/kustomize/default/kustomization.yaml create mode 100644 values/postgres-operator/manifests/postgres-operator.yaml create mode 100644 values/postgres-operator/values.yaml.gotmpl create mode 100644 values/prometheus/manifests/prometheus.yaml create mode 100644 values/prometheus/values-oceanbox.yaml.gotmpl create mode 100644 values/prometheus/values.yaml.gotmpl create mode 100644 values/prometheus/values/prometheus.yaml.gotmpl create mode 100644 values/velero/kustomize/base/kustomization.yaml create mode 100644 values/velero/kustomize/default/kustomization.yaml create mode 100644 values/velero/manifests/velero.yaml create mode 100644 values/velero/values.yaml.gotmpl create mode 100644 values/velero/values/velero.yaml.gotmpl diff --git a/.envrc b/.envrc index 1d953f4b..e72c864b 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,14 @@ -use nix +#!/usr/bin/env bash +# the shebang is ignored, but nice for editors +watch_file npins/sources.json + +# Load .env file if it exists +dotenv_if_exists + +# Activate development shell +if type -P lorri &>/dev/null; then + eval "$(lorri direnv)" +else + echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]' + use nix +fi diff --git a/default.nix b/default.nix deleted file mode 100644 index a40feab8..00000000 --- a/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -let - sources = import ./nix; - system = builtins.currentSystem; - pkgs = import sources.nixpkgs { - inherit system; - config = { }; - overlays = [ ]; - }; - nixpkgs = sources.nixpkgs; - nixhelm = sources.nixhelm; - nixidy = import sources.nixidy { inherit nixpkgs; }; - kube = pkgs.callPackage "${sources.nix-kube-gen}/lib/default.nix" { inherit pkgs; }; -in -nixidy.lib.mkEnvs { - libOverlay = self: super: { - apps = import ./modules/lib.nix { inherit pkgs kube; }; - }; - modules = [ - ( - { lib, ... }: - { - nixidy.charts = lib.helm.mkChartAttrs "${nixhelm}/charts"; - } - ) - ./modules - ./apps - ./policies - ]; - envs = { - prod.modules = [ ./envs/prod.nix ]; - staging.modules = [ ./envs/staging.nix ]; - }; -} diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 0dc2350e..00000000 --- a/flake.lock +++ /dev/null @@ -1,666 +0,0 @@ -{ - "nodes": { - "cargo2nix": { - "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_3", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1699033427, - "narHash": "sha256-OVtd5IPbb4NvHibN+QvMrMxq7aZN5GFoINZSAXKjUdA=", - "owner": "cargo2nix", - "repo": "cargo2nix", - "rev": "c6f33051f412352f293e738cc8da6fd4c457080f", - "type": "github" - }, - "original": { - "owner": "cargo2nix", - "ref": "release-0.11.0", - "repo": "cargo2nix", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "id": "flake-utils", - "type": "indirect" - } - }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "inputs": { - "systems": "systems_5" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { - "inputs": { - "systems": "systems_7" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "haumea": { - "inputs": { - "nixpkgs": [ - "nixhelm", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1685133229, - "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", - "owner": "nix-community", - "repo": "haumea", - "rev": "34dd58385092a23018748b50f9b23de6266dffc2", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "v0.2.2", - "repo": "haumea", - "type": "github" - } - }, - "kubenix": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "nixidy", - "nixpkgs" - ], - "systems": "systems_6", - "treefmt": "treefmt" - }, - "locked": { - "lastModified": 1718110643, - "narHash": "sha256-KrEOCx/bpN++sySOEL5EO5AhYsqRZZk+CXacueUeSl4=", - "owner": "hall", - "repo": "kubenix", - "rev": "a04066c45526c6d8410ba998134f692ff991b4f3", - "type": "github" - }, - "original": { - "owner": "hall", - "repo": "kubenix", - "type": "github" - } - }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "nixhelm", - "poetry2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1703863825, - "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-github-actions", - "type": "github" - } - }, - "nix-kube-generators": { - "locked": { - "lastModified": 1708155396, - "narHash": "sha256-A/BIeJjiRS7sBYP6tFJa/WHDPHe7DGTCkSEKXttYeAQ=", - "owner": "farcaller", - "repo": "nix-kube-generators", - "rev": "14dbd5e5b40615937900f71d9a9851b59b4d9a88", - "type": "github" - }, - "original": { - "owner": "farcaller", - "repo": "nix-kube-generators", - "type": "github" - } - }, - "nix-kube-generators_2": { - "locked": { - "lastModified": 1708155396, - "narHash": "sha256-A/BIeJjiRS7sBYP6tFJa/WHDPHe7DGTCkSEKXttYeAQ=", - "owner": "farcaller", - "repo": "nix-kube-generators", - "rev": "14dbd5e5b40615937900f71d9a9851b59b4d9a88", - "type": "github" - }, - "original": { - "owner": "farcaller", - "repo": "nix-kube-generators", - "type": "github" - } - }, - "nix-kube-generators_3": { - "locked": { - "lastModified": 1708155396, - "narHash": "sha256-A/BIeJjiRS7sBYP6tFJa/WHDPHe7DGTCkSEKXttYeAQ=", - "owner": "farcaller", - "repo": "nix-kube-generators", - "rev": "14dbd5e5b40615937900f71d9a9851b59b4d9a88", - "type": "github" - }, - "original": { - "owner": "farcaller", - "repo": "nix-kube-generators", - "type": "github" - } - }, - "nixhelm": { - "inputs": { - "flake-utils": "flake-utils_2", - "haumea": "haumea", - "nix-kube-generators": "nix-kube-generators_2", - "nixpkgs": [ - "nixpkgs" - ], - "poetry2nix": "poetry2nix" - }, - "locked": { - "lastModified": 1728868745, - "narHash": "sha256-ZuaxkAtUL1visOmVMxgHk3j+H8/bMmm82tJfE1s35VY=", - "owner": "farcaller", - "repo": "nixhelm", - "rev": "f901d2ba3ce1bd0086d50efdcce3cc76bce04d80", - "type": "github" - }, - "original": { - "owner": "farcaller", - "repo": "nixhelm", - "type": "github" - } - }, - "nixidy": { - "inputs": { - "flake-utils": "flake-utils_4", - "kubenix": "kubenix", - "nix-kube-generators": "nix-kube-generators_3", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1728815994, - "narHash": "sha256-uF6HAoDMAX0cZbKH27k/0UpIteQMhyLkP1rYKUfj5ys=", - "owner": "arnarg", - "repo": "nixidy", - "rev": "6e20193c95a0aaca444289d7c69f4eb329d25234", - "type": "github" - }, - "original": { - "owner": "arnarg", - "ref": "HEAD", - "repo": "nixidy", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1702151865, - "narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "666fc80e7b2afb570462423cb0e1cf1a3a34fedd", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1697382362, - "narHash": "sha256-PvFjWFmSYOF6TjNZ/WjOeqa+sgaWm+83Fz37vEuATHA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ad9a253a0d34f313707f9c25fb8c95c65b1c8882", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "poetry2nix": { - "inputs": { - "flake-utils": "flake-utils_3", - "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "nixhelm", - "nixpkgs" - ], - "systems": "systems_4", - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1718285706, - "narHash": "sha256-DScsBM+kZvxOva7QegfdtleebMXh30XPxDQr/1IGKYo=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "a5be1bbbe0af0266147a88e0ec43b18c722f2bb9", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1728778939, - "narHash": "sha256-WybK5E3hpGxtCYtBwpRj1E9JoiVxe+8kX83snTNaFHE=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "ff68f91754be6f3427e4986d7949e6273659be1d", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nix-kube-generators": "nix-kube-generators", - "nixhelm": "nixhelm", - "nixidy": "nixidy", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks": "pre-commit-hooks", - "yaml2nix": "yaml2nix" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "yaml2nix", - "cargo2nix", - "flake-utils" - ], - "nixpkgs": [ - "yaml2nix", - "cargo2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1697336027, - "narHash": "sha256-ctmmw7j4liyfSh63v9rdFZeIoNYCkCvgqvtEOB7KhX8=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "e494404d36a41247987eeb1bfc2f1ca903e97764", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "id": "systems", - "type": "indirect" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "id": "systems", - "type": "indirect" - } - }, - "systems_7": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "treefmt": { - "inputs": { - "nixpkgs": [ - "nixidy", - "kubenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1688026376, - "narHash": "sha256-qJmkr9BWDpqblk4E9/rCsAEl39y2n4Ycw6KRopvpUcY=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "df3f32b0cc253dfc7009b7317e8f0e7ccd70b1cf", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nixhelm", - "poetry2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1717850719, - "narHash": "sha256-npYqVg+Wk4oxnWrnVG7416fpfrlRhp/lQ6wQ4DHI8YE=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "4fc1c45a5f50169f9f29f6a98a438fb910b834ed", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, - "yaml2nix": { - "inputs": { - "cargo2nix": "cargo2nix", - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1726132715, - "narHash": "sha256-DkHWWpvBco2yodyOk40LjTNcoaJ1bFKf0JY9OwWgy5M=", - "owner": "euank", - "repo": "yaml2nix", - "rev": "3a6df359da40ee49cb9ed597c2400342b76f2083", - "type": "github" - }, - "original": { - "owner": "euank", - "repo": "yaml2nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index ba16ecfb..00000000 --- a/flake.nix +++ /dev/null @@ -1,148 +0,0 @@ -{ - description = "My ArgoCD configuration with nixidy."; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - - nixidy = { - url = "github:juselius/nixidy?ref=HEAD"; - # url = "github:juselius/nixidy?ref=special-args"; - # url = "/home/jonas/src/OceanBox/nixidy"; - # inputs.nixpkgs.follows = "nixpkgs"; - }; - - nixhelm = { - url = "github:farcaller/nixhelm"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - pre-commit-hooks = { - url = "github:cachix/pre-commit-hooks.nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-kube-generators.url = "github:farcaller/nix-kube-generators"; - - yaml2nix = { - url = "github:euank/yaml2nix"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "flake-utils"; - }; - }; - - outputs = - { - self, - nixpkgs, - flake-utils, - nixidy, - nixhelm, - yaml2nix, - pre-commit-hooks, - nix-kube-generators, - }: - (flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = import nixpkgs { inherit system; }; - kube = nix-kube-generators.lib { inherit pkgs; }; - lib = { - apps = import ./modules/lib.nix { inherit pkgs kube;}; - }; - in - { - nixidyEnvs = nixidy.lib.mkEnvs { - inherit pkgs; - extraSpecialArgs = { inherit lib; }; - charts = nixhelm.chartsDerivations.${system}; - modules = [ - ./modules - ./apps - ./policies - ]; - envs = { - prod.modules = [ ./envs/prod.nix ]; - staging.modules = [ ./envs/staging.nix ]; - }; - }; - - checks = { - pre-commit-check = pre-commit-hooks.lib.${system}.run { - src = ./.; - hooks = { - nixfmt-rfc-style.enable = false; - deadnix.enable = false; - statix.enable = false; - }; - }; - }; - - packages = { - nixidy = nixidy.packages.${system}.default; - generators = { - cilium = nixidy.packages.${system}.generators.fromCRD { - name = "cilium"; - src = pkgs.fetchFromGitHub { - owner = "cilium"; - repo = "cilium"; - rev = "v1.16.0"; - hash = "sha256-LJrNGHF52hdKCuVwjvGifqsH+8hxkf/A3LZNpCHeR7E="; - }; - crds = [ - "pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml" - "pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwidenetworkpolicies.yaml" - ]; - }; - - kyverno = nixidy.packages.${system}.generators.fromCRD { - name = "kyverno"; - src = pkgs.fetchFromGitHub { - owner = "kyverno"; - repo = "kyverno"; - rev = "v1.12.6"; - hash = "sha256-FwVB1okxhWTzWlZljGEEH9KuSsJl9GmwnX7bn4iDx/M="; - }; - crds = [ - "config/crds/kyverno/kyverno.io_cleanuppolicies.yaml" - "config/crds/kyverno/kyverno.io_clustercleanuppolicies.yaml" - "config/crds/kyverno/kyverno.io_clusterpolicies.yaml" - "config/crds/kyverno/kyverno.io_globalcontextentries.yaml" - "config/crds/kyverno/kyverno.io_policies.yaml" - "config/crds/kyverno/kyverno.io_policyexceptions.yaml" - "config/crds/kyverno/kyverno.io_updaterequests.yaml" - ]; - }; - }; - }; - - apps = { - gen-crd = { - type = "app"; - program = - (pkgs.writeShellScript "generate-modules" '' - set -eo pipefail - echo "generate cilium" - cat ${self.packages.${system}.generators.cilium} > modules/cilium-crd.nix - echo "generate kyverno" - cat ${self.packages.${system}.generators.kyverno} > modules/kyverno-crd.nix - '').outPath; - }; - }; - - devShells.default = pkgs.mkShellNoCC { - inherit (self.checks.${system}.pre-commit-check) shellHook; - nativeBuildInputs = with pkgs; [ - self.checks.${system}.pre-commit-check.enabledPackages - nixidy.packages.${system}.default - yaml2nix.packages.${system}.default - nixd - nixfmt-rfc-style - just - fzf - ]; - NIXD_FLAGS = "--inlay-hints"; - }; - } - )); -} diff --git a/generate.nix b/generate.nix deleted file mode 100644 index 63b657b6..00000000 --- a/generate.nix +++ /dev/null @@ -1,44 +0,0 @@ -let - sources = import ./nix; - system = builtins.currentSystem; - pkgs = import sources.nixpkgs { - inherit system; - config = { }; - overlays = [ ]; - }; - nixpkgs = sources.nixpkgs; - nixidy = import sources.nixidy { inherit nixpkgs; }; -in -{ - cilium = nixidy.generators.fromCRD { - name = "cilium"; - src = pkgs.fetchFromGitHub { - owner = "cilium"; - repo = "cilium"; - rev = "v1.16.0"; - hash = "sha256-LJrNGHF52hdKCuVwjvGifqsH+8hxkf/A3LZNpCHeR7E="; - }; - crds = [ - "pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml" - "pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwidenetworkpolicies.yaml" - ]; - }; - kyverno = nixidy.generators.fromCRD { - name = "kyverno"; - src = pkgs.fetchFromGitHub { - owner = "kyverno"; - repo = "kyverno"; - rev = "v1.12.6"; - hash = "sha256-FwVB1okxhWTzWlZljGEEH9KuSsJl9GmwnX7bn4iDx/M="; - }; - crds = [ - "config/crds/kyverno/kyverno.io_cleanuppolicies.yaml" - "config/crds/kyverno/kyverno.io_clustercleanuppolicies.yaml" - "config/crds/kyverno/kyverno.io_clusterpolicies.yaml" - "config/crds/kyverno/kyverno.io_globalcontextentries.yaml" - "config/crds/kyverno/kyverno.io_policies.yaml" - "config/crds/kyverno/kyverno.io_policyexceptions.yaml" - "config/crds/kyverno/kyverno.io_updaterequests.yaml" - ]; - }; -} diff --git a/helmfile.d/atlantis.yaml.gotmpl b/helmfile.d/atlantis.yaml.gotmpl index 120abbb1..7e50acf0 100644 --- a/helmfile.d/atlantis.yaml.gotmpl +++ b/helmfile.d/atlantis.yaml.gotmpl @@ -35,23 +35,3 @@ releases: - '{{`{{ .Environment.Name }}`}}' - ../values/atlantis/manifests - _atlantis-manifests -- name: atlantis-app - namespace: argocd - chart: _atlantis-app - condition: atlantis.enabled - missingFileHandler: Info - values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml - - ../values/atlantis/values.yaml.gotmpl - - ../values/atlantis/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl - hooks: - - events: [ prepare, cleanup ] - showlogs: true - command: ../bin/helmify - args: - - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' - - '{{`{{ .Release.Chart }}`}}' - - '{{`{{ .Environment.Name }}`}}' - - ../values/atlantis/app.yaml - - _atlantis-app - diff --git a/helmfile.d/kyverno.yaml.gotmpl b/helmfile.d/kyverno.yaml.gotmpl new file mode 100644 index 00000000..283233b3 --- /dev/null +++ b/helmfile.d/kyverno.yaml.gotmpl @@ -0,0 +1,46 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: +- name: kyverno + url: 'https://kyverno.github.io/kyverno/' + +commonLabels: + tier: system + +apiVersions: +- monitoring.coreos.com/v1 + +releases: +- name: kyverno + namespace: kyverno + chart: kyverno/kyverno + version: 3.2.5 + condition: kyverno.enabled + values: + - ../values/kyverno/values/kyverno.yaml.gotmpl + - ../values/kyverno/values/kyverno-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/postgres-operator/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: kyverno-manifests + namespace: kyverno + chart: _kyverno-manifests + condition: kyverno.enabled + values: + - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/kyverno/values.yaml.gotmpl + - ../values/kyverno/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + missingFileHandler: Info + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/kyverno/manifests + - _kyverno-manifests + diff --git a/helmfile.d/nix/argo.gotmpl.nix b/helmfile.d/nix/argo.gotmpl.nix new file mode 100644 index 00000000..3a6a485b --- /dev/null +++ b/helmfile.d/nix/argo.gotmpl.nix @@ -0,0 +1,92 @@ +{ var, ... }: +{ + bases = [ + "../envs/environments.yaml.gotmpl" + ]; + repositories = [ + { + name = "argo"; + url = "https://argoproj.github.io/argo-helm"; + } + ]; + commonLabels = { + tier = "system"; + }; + releases = [ + { + name = "argocd"; + namespace = "argocd"; + chart = "argo/argo-cd"; + version = "7.5.2"; + condition = "argo.enabled"; + values = [ + "../values/argo/values/argocd.yaml.gotmpl" + "../values/argo/values/argocd-${var.environment.name}.yaml.gotmpl" + ]; + postRenderer = "../bin/kustomizer"; + postRendererArgs = [ + "../values/argo/kustomize/${var.environment.name}" + ]; + missingFileHandler = "Info"; + } + { + name = "argocd-apps"; + namespace = "argocd"; + chart = "argo/argocd-apps"; + version = "0.0.1"; + condition = "argo.apps.enabled"; + values = [ + "../values/argo/values/apps.yaml.gotmpl" + ]; + missingFileHandler = "Info"; + } + { + name = "argo-rollouts"; + namespace = "argocd"; + chart = "argo/argo-rollouts"; + version = "2.35.2"; + condition = "argo.rollouts.enabled"; + values = [ + "../values/argo/values/rollouts.yaml.gotmpl" + ]; + missingFileHandler = "Info"; + } + { + name = "argo-workflows"; + namespace = "argocd"; + chart = "argo/argo-workflows"; + version = "0.45.0"; + condition = "argo.workflows.enabled"; + missingFileHandler = "Info"; + } + { + name = "argo-manifests"; + namespace = "argocd"; + chart = "_argo"; + condition = "argo.enabled"; + values = [ + # "../values/values-${var.CLUSTER_NAME}.yaml" + "../values/argo/values.yaml.gotmpl" + # "../values/argo/values-${var.CLUSTER_NAME}.yaml.gotmpl" + ]; + missingFileHandler = "Info"; + hooks = [ + { + events = [ + "prepare" + "cleanup" + ]; + showlogs = true; + command = "../bin/helmify"; + args = [ + # "${if (var.event.name == "prepare") then "build" else "clean"}" + # "${var.release.chart}" + "${var.environment.name}" + "../values/argo/manifests" + "_argo" + ]; + } + ]; + } + ]; +} diff --git a/helmfile.d/nix/helmfile.gotmpl.nix b/helmfile.d/nix/helmfile.gotmpl.nix new file mode 100644 index 00000000..d557db1b --- /dev/null +++ b/helmfile.d/nix/helmfile.gotmpl.nix @@ -0,0 +1,94 @@ +{ var, escape_var, ... }: +[ + { + bases = [ + "../envs/environments.yaml.gotmpl" + ]; + repositories = [ + { + name = "argo"; + url = "https://argoproj.github.io/argo-helm"; + } + ]; + commonLabels = { + tier = "system"; + }; + releases = [ + { + name = "argocd"; + namespace = "argocd"; + chart = "argo/argo-cd"; + version = "7.5.2"; + condition = "argo.enabled"; + values = [ + "../values/argo/values/argocd.yaml.gotmpl" + "../values/argo/values/argocd-${var.environment.name}.yaml.gotmpl" + ]; + postRenderer = "../bin/kustomizer"; + postRendererArgs = [ + "../values/argo/kustomize/${var.environment.name}" + ]; + missingFileHandler = "Info"; + } + { + name = "argocd-apps"; + namespace = "argocd"; + chart = "argo/argocd-apps"; + version = "0.0.1"; + condition = "argo.apps.enabled"; + values = [ + "../values/argo/values/apps.yaml.gotmpl" + ]; + missingFileHandler = "Info"; + } + { + name = "argo-rollouts"; + namespace = "argocd"; + chart = "argo/argo-rollouts"; + version = "2.35.2"; + condition = "argo.rollouts.enabled"; + values = [ + "../values/argo/values/rollouts.yaml.gotmpl" + ]; + missingFileHandler = "Info"; + } + { + name = "argo-workflows"; + namespace = "argocd"; + chart = "argo/argo-workflows"; + version = "0.45.0"; + condition = "argo.workflows.enabled"; + missingFileHandler = "Info"; + } + { + name = "argo-manifests"; + namespace = "argocd"; + chart = "_argo"; + condition = "argo.enabled"; + values = [ + (escape_var "../values/values-{{requiredEnv \"CLUSTER_NAME\"}}.yaml") + "../values/argo/values.yaml.gotmpl" + (escape_var "../values/argo/values-{{requiredEnv \"CLUSTER_NAME\"}}.yaml.gotmpl") + ]; + missingFileHandler = "Info"; + hooks = [ + { + events = [ + "prepare" + "cleanup" + ]; + showlogs = true; + command = "../bin/helmify"; + args = [ + (escape_var "{{ if eq .Event.Name \"prepare\" }}build{{ else }}clean{{ end }}") + (escape_var "{{ .Release.Chart | toJson }}") + (escape_var "{{ .Environment.Name | toJson }}") + "../values/argo/manifests" + "_argo" + ]; + } + ]; + } + ]; + } +] diff --git a/helmfile.d/postgres-operator.yaml.gotmpl b/helmfile.d/postgres-operator.yaml.gotmpl new file mode 100644 index 00000000..73a4b512 --- /dev/null +++ b/helmfile.d/postgres-operator.yaml.gotmpl @@ -0,0 +1,45 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: +- name: cloudnative-pg + url: 'https://cloudnative-pg.github.io/charts' + +commonLabels: + tier: system + +apiVersions: +- monitoring.coreos.com/v1 + +releases: +- name: postgres-operator + namespace: cnpg + chart: cloudnative-pg/cloudnative-pg + version: 0.18.2 + condition: postgres_operator.enabled + values: + - ../values/postgres-operator/values/postgres-operator.yaml.gotmpl + - ../values/postgres-operator/values/postgres-operator-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/postgres-operator/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: postgres-operator-manifests + namespace: cnpg + chart: _postgres-operator-manifests + condition: postgres_operator.enabled + values: + - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/postgres-operator/values.yaml.gotmpl + - ../values/postgres-operator/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + missingFileHandler: Info + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/postgres-operator/manifests + - _postgres-operator-manifests diff --git a/helmfile.d/prometheus.yaml.gotmpl b/helmfile.d/prometheus.yaml.gotmpl new file mode 100644 index 00000000..7fee4570 --- /dev/null +++ b/helmfile.d/prometheus.yaml.gotmpl @@ -0,0 +1,42 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: +- name: prometheus + url: 'https://prometheus-community.github.io/helm-charts' + +commonLabels: + tier: system + +apiVersions: +- monitoring.coreos.com/v1 + +releases: +- name: prometheus + namespace: prometheus + chart: prometheus/kube-prometheus-stack + version: 62.7.0 + condition: prometheus.enabled + values: + - ../values/prometheus/values/prometheus.yaml.gotmpl + - ../values/prometheus/values/prometheus-{{ .Environment.Name }}.yaml.gotmpl + missingFileHandler: Info +- name: prometheus-manifests + namespace: prometheus + chart: _prometheus-manifests + condition: prometheus.enabled + values: + - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/prometheus/values.yaml.gotmpl + - ../values/prometheus/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/prometheus/prometheus-manifests + - _prometheus-manifests + diff --git a/helmfile.d/velero.yaml.gotmpl b/helmfile.d/velero.yaml.gotmpl new file mode 100644 index 00000000..e683a6fb --- /dev/null +++ b/helmfile.d/velero.yaml.gotmpl @@ -0,0 +1,42 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: +- name: velero + url: 'https://vmware-tanzu.github.io/helm-charts' + +commonLabels: + tier: system + +releases: +- name: velero + namespace: velero + chart: velero/velero + version: 0.18.2 + condition: velero.enabled + values: + - ../values/velero/values/velero.yaml.gotmpl + - ../values/velero/values/velero-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/velero/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: velero-manifests + namespace: velero + chart: _velero-manifests + condition: velero.enabled + values: + - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/velero/values.yaml.gotmpl + - ../values/velero/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + missingFileHandler: Info + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/velero/manifests + - _velero-manifests diff --git a/justfile b/justfile index 10d9d46e..04d755e5 100644 --- a/justfile +++ b/justfile @@ -1,17 +1,12 @@ -default := "prod" - +[private] default: - just --choose + just --list -u -info target=default: - nix run .#nixidy -- info .#{{target}} - -build target=default: - nix run .#nixidy -- build .#{{target}} - -switch target=default: - nix run .#nixidy -- switch .#{{target}} - -generate: - nix build .#generators.cilium - nix build .#generators.kyverno +# NOTE: Render a specifc helm chart +r HELMFILE ENV: + # helmfile --environment={{ENV}} lint --args --quiet --skip-deps --skip-refresh -f helmfile.d/{{HELMFILE}}.yaml.gotmpl + helmfile --environment={{ENV}} lint --args --quiet -f helmfile.d/{{HELMFILE}}.yaml.gotmpl +# +# NOTE: Render charts for one environment +# render ENV="staging": + diff --git a/nix/default.nix b/nix/default.nix deleted file mode 100644 index 5e7d086e..00000000 --- a/nix/default.nix +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by npins. Do not modify; will be overwritten regularly -let - data = builtins.fromJSON (builtins.readFile ./sources.json); - version = data.version; - - mkSource = - spec: - assert spec ? type; - let - path = - if spec.type == "Git" then - mkGitSource spec - else if spec.type == "GitRelease" then - mkGitSource spec - else if spec.type == "PyPi" then - mkPyPiSource spec - else if spec.type == "Channel" then - mkChannelSource spec - else - builtins.throw "Unknown source type ${spec.type}"; - in - spec // { outPath = path; }; - - mkGitSource = - { - repository, - revision, - url ? null, - hash, - branch ? null, - ... - }: - assert repository ? type; - # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository - # In the latter case, there we will always be an url to the tarball - if url != null then - (builtins.fetchTarball { - inherit url; - sha256 = hash; # FIXME: check nix version & use SRI hashes - }) - else - assert repository.type == "Git"; - let - urlToName = - url: rev: - let - matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url; - - short = builtins.substring 0 7 rev; - - appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; - in - "${if matched == null then "source" else builtins.head matched}${appendShort}"; - name = urlToName repository.url revision; - in - builtins.fetchGit { - url = repository.url; - rev = revision; - inherit name; - # hash = hash; - }; - - mkPyPiSource = - { url, hash, ... }: - builtins.fetchurl { - inherit url; - sha256 = hash; - }; - - mkChannelSource = - { url, hash, ... }: - builtins.fetchTarball { - inherit url; - sha256 = hash; - }; -in -if version == 3 then - builtins.mapAttrs (_: mkSource) data.pins -else - throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index de5928b7..00000000 --- a/nix/sources.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "pins": { - "nix-kube-gen": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "farcaller", - "repo": "nix-kube-generators" - }, - "branch": "master", - "revision": "2be4f3cb99e179d9f94e6c8723862421437f8efb", - "url": "https://github.com/farcaller/nix-kube-generators/archive/2be4f3cb99e179d9f94e6c8723862421437f8efb.tar.gz", - "hash": "0pgpr0szig7plmj7i4hjfkpcm4vgy0ingqr115wqjzbx5yjc6c7j" - }, - "nixhelm": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "farcaller", - "repo": "nixhelm" - }, - "branch": "master", - "revision": "cafa44fc8c2ad34baf6e5f1bdea3eb3a587a1f6d", - "url": "https://github.com/farcaller/nixhelm/archive/cafa44fc8c2ad34baf6e5f1bdea3eb3a587a1f6d.tar.gz", - "hash": "1waplza2c0wgq23v41ladfgqdq2wrbw889c973cm439940zj4mj1" - }, - "nixidy": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "arnarg", - "repo": "nixidy" - }, - "branch": "main", - "revision": "d28f45aea4d7b93928f1ea94f22a03a3f6dc25f6", - "url": "https://github.com/arnarg/nixidy/archive/d28f45aea4d7b93928f1ea94f22a03a3f6dc25f6.tar.gz", - "hash": "0ijxdh2432wvwyff1f5yfrjn93lzayrswi1bkasjpwaps9v6ld4r" - }, - "nixpkgs": { - "type": "Channel", - "name": "nixpkgs-unstable", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre699031.2d2a9ddbe3f2/nixexprs.tar.xz", - "hash": "1vx044c8gdg1c8zmabzbi9xrgjgaz2bfqbl47xsgh517f580bycx" - } - }, - "version": 3 -} diff --git a/npins/default.nix b/npins/default.nix new file mode 100644 index 00000000..65924762 --- /dev/null +++ b/npins/default.nix @@ -0,0 +1,146 @@ +/* + This file is provided under the MIT licence: + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +# Generated by npins. Do not modify; will be overwritten regularly +let + data = builtins.fromJSON (builtins.readFile ./sources.json); + version = data.version; + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = + first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatMapStrings = f: list: concatStrings (map f list); + concatStrings = builtins.concatStringsSep ""; + + # If the environment variable NPINS_OVERRIDE_${name} is set, then use + # the path directly as opposed to the fetched source. + # (Taken from Niv for compatibility) + mayOverride = + name: path: + let + envVarName = "NPINS_OVERRIDE_${saneName}"; + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; + ersatz = builtins.getEnv envVarName; + in + if ersatz == "" then + path + else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" ( + if builtins.substring 0 1 ersatz == "/" then + /. + ersatz + else + /. + builtins.getEnv "PWD" + "/${ersatz}" + ); + + mkSource = + name: spec: + assert spec ? type; + let + path = + if spec.type == "Git" then + mkGitSource spec + else if spec.type == "GitRelease" then + mkGitSource spec + else if spec.type == "PyPi" then + mkPyPiSource spec + else if spec.type == "Channel" then + mkChannelSource spec + else if spec.type == "Tarball" then + mkTarballSource spec + else + builtins.throw "Unknown source type ${spec.type}"; + in + spec // { outPath = mayOverride name path; }; + + mkGitSource = + { + repository, + revision, + url ? null, + submodules, + hash, + branch ? null, + ... + }: + assert repository ? type; + # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository + # In the latter case, there we will always be an url to the tarball + if url != null && !submodules then + builtins.fetchTarball { + inherit url; + sha256 = hash; # FIXME: check nix version & use SRI hashes + } + else + let + url = + if repository.type == "Git" then + repository.url + else if repository.type == "GitHub" then + "https://github.com/${repository.owner}/${repository.repo}.git" + else if repository.type == "GitLab" then + "${repository.server}/${repository.repo_path}.git" + else + throw "Unrecognized repository type ${repository.type}"; + urlToName = + url: rev: + let + matched = builtins.match "^.*/([^/]*)(\\.git)?$" url; + + short = builtins.substring 0 7 rev; + + appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; + in + "${if matched == null then "source" else builtins.head matched}${appendShort}"; + name = urlToName url revision; + in + builtins.fetchGit { + rev = revision; + inherit name; + # hash = hash; + inherit url submodules; + }; + + mkPyPiSource = + { url, hash, ... }: + builtins.fetchurl { + inherit url; + sha256 = hash; + }; + + mkChannelSource = + { url, hash, ... }: + builtins.fetchTarball { + inherit url; + sha256 = hash; + }; + + mkTarballSource = + { + url, + locked_url ? url, + hash, + ... + }: + builtins.fetchTarball { + url = locked_url; + sha256 = hash; + }; +in +if version == 5 then + builtins.mapAttrs mkSource data.pins +else + throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/npins/sources.json b/npins/sources.json new file mode 100644 index 00000000..6df53cc7 --- /dev/null +++ b/npins/sources.json @@ -0,0 +1,37 @@ +{ + "pins": { + "gomod2nix": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "gomod2nix" + }, + "branch": "master", + "submodules": false, + "revision": "2cbd7fdd6eeab65c494cc426e18f4e4d2a5e35c0", + "url": "https://github.com/nix-community/gomod2nix/archive/2cbd7fdd6eeab65c494cc426e18f4e4d2a5e35c0.tar.gz", + "hash": "18hl5fz6aqg12ypkjramvlv43p413iwzy5zbvwl9m3kp5l4id2fi" + }, + "helmfile-nix": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "remarkable", + "repo": "helmfile-nix" + }, + "branch": "main", + "submodules": false, + "revision": "03b3de30d44b6e90e9425bad10476dadd75bcba9", + "url": "https://github.com/remarkable/helmfile-nix/archive/03b3de30d44b6e90e9425bad10476dadd75bcba9.tar.gz", + "hash": "12bdar6cb459vw9ldk73npvydbcjgb4ic8w416yf4i4alky3d9ib" + }, + "nixpkgs": { + "type": "Channel", + "name": "nixpkgs-unstable", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.05pre800239.b1bebd0fe266/nixexprs.tar.xz", + "hash": "0vnfj9d7kzk673i7s1vnkbx513a4gh5mfcd8fag2c7wi6hz471n6" + } + }, + "version": 5 +} diff --git a/shell.nix b/shell.nix index fb3d055c..bb02e2ac 100644 --- a/shell.nix +++ b/shell.nix @@ -1,25 +1,34 @@ let - sources = import ./nix; + sources = import ./npins; system = builtins.currentSystem; pkgs = import sources.nixpkgs { inherit system; config = { }; - overlays = [ ]; + overlays = [ (import "${sources.gomod2nix}/overlay.nix") ]; }; - nixpkgs = sources.nixpkgs; - nixidy = import sources.nixidy { inherit nixpkgs; }; + helmfile-nix = import sources.helmfile-nix { inherit pkgs; }; + helmWrap = + with pkgs; + wrapHelm kubernetes-helm { + plugins = with kubernetes-helmPlugins; [ + helm-diff + helm-git + ]; + }; + helmfileWrap = pkgs.helmfile-wrapped.override { inherit (helmWrap) pluginsDir; }; in -{ - shell = pkgs.mkShellNoCC { - name = "clstr"; - nativeBuildInputs = with pkgs; [ - helmfile - nixidy.nixidy - npins - nixfmt-rfc-style - just - fzf - ]; - NPINS_DIRECTORY = "nix"; - }; +pkgs.mkShellNoCC { + name = "clstr"; + + packages = with pkgs; [ + npins + nix-converter + + # helm + helmWrap + helmfileWrap + helmfile-nix + ]; + + CLUSTER_NAME = "oceanbox"; } diff --git a/statix.toml b/statix.toml deleted file mode 100644 index fdbac046..00000000 --- a/statix.toml +++ /dev/null @@ -1,7 +0,0 @@ -disabled = [ - # I think enforcing this can often produce - # code that is harder to read. - "manual_inherit_from" - # Does not improve readability - "repeated_keys" -] \ No newline at end of file diff --git a/values/atlantis/app.yaml b/values/atlantis/manifests/atlantis.yaml similarity index 100% rename from values/atlantis/app.yaml rename to values/atlantis/manifests/atlantis.yaml diff --git a/values/kyverno/kustomize/base/kustomization.yaml b/values/kyverno/kustomize/base/kustomization.yaml new file mode 100644 index 00000000..57f354b1 --- /dev/null +++ b/values/kyverno/kustomize/base/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - _manifest.yaml diff --git a/values/kyverno/kustomize/default/kustomization.yaml b/values/kyverno/kustomize/default/kustomization.yaml new file mode 100644 index 00000000..22967828 --- /dev/null +++ b/values/kyverno/kustomize/default/kustomization.yaml @@ -0,0 +1,4 @@ +generatorOptions: + disableNameSuffixHash: true +resources: + - ../base diff --git a/values/kyverno/manifests/kyverno.yaml b/values/kyverno/manifests/kyverno.yaml new file mode 100644 index 00000000..b255f435 --- /dev/null +++ b/values/kyverno/manifests/kyverno.yaml @@ -0,0 +1,39 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: kyverno + namespace: argocd +spec: + destination: + namespace: kyverno + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/kyverno + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + {{- if .Values.kyverno.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} + ignoreDifferences: + - group: batch + kind: CronJob + jqPathExpressions: + - '.spec.jobTemplate.spec.template.spec.containers[]?.resources' +{{- end }} diff --git a/values/kyverno/values.yaml.gotmpl b/values/kyverno/values.yaml.gotmpl new file mode 100644 index 00000000..7f97294d --- /dev/null +++ b/values/kyverno/values.yaml.gotmpl @@ -0,0 +1,11 @@ +kyverno: + enabled: true + autosync: false + metrics: false + resources: + cleanupController: + memory: "128Mi" + reportsController: + memory: "128Mi" + backgroundController: + memory: "128Mi" diff --git a/values/kyverno/values/kyverno.yaml.gotmpl b/values/kyverno/values/kyverno.yaml.gotmpl new file mode 100644 index 00000000..98a4f5ef --- /dev/null +++ b/values/kyverno/values/kyverno.yaml.gotmpl @@ -0,0 +1,41 @@ +replicaCount: 3 +{{ if .Values.kyverno.metrics }} +admissionController: + serviceMonitor: + enabled: true + metricsService: + create: true +backgroundController: + serviceMonitor: + enabled: true + metricsService: + create: true +cleanupController: + serviceMonitor: + enabled: true + metricsService: + create: true +reportsController: + serviceMonitor: + enabled: true + metricsService: + create: true +{{ end }} +cleanupController: + resources: + limits: + memory: {{ .Values.kyverno.resources.cleanupController.memory }} + requests: + memory: {{ .Values.kyverno.resources.cleanupController.memory }} +reportsController: + resources: + limits: + memory: {{ .Values.kyverno.resources.reportsController.memory }} + requests: + memory: {{ .Values.kyverno.resources.reportsController.memory }} +backgroundController: + resources: + limits: + memory: {{ .Values.kyverno.resources.backgroundController.memory }} + requests: + memory: {{ .Values.kyverno.resources.backgroundController.memory }} diff --git a/values/postgres-operator/kustomize/base/kustomization.yaml b/values/postgres-operator/kustomize/base/kustomization.yaml new file mode 100644 index 00000000..57f354b1 --- /dev/null +++ b/values/postgres-operator/kustomize/base/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - _manifest.yaml diff --git a/values/postgres-operator/kustomize/default/kustomization.yaml b/values/postgres-operator/kustomize/default/kustomization.yaml new file mode 100644 index 00000000..22967828 --- /dev/null +++ b/values/postgres-operator/kustomize/default/kustomization.yaml @@ -0,0 +1,4 @@ +generatorOptions: + disableNameSuffixHash: true +resources: + - ../base diff --git a/values/postgres-operator/manifests/postgres-operator.yaml b/values/postgres-operator/manifests/postgres-operator.yaml new file mode 100644 index 00000000..05b57fb7 --- /dev/null +++ b/values/postgres-operator/manifests/postgres-operator.yaml @@ -0,0 +1,34 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: postgres-operator + namespace: argocd +spec: + destination: + namespace: cnpg + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/postgres-operator + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + {{- if .Values.postgres_operator.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +{{- end }} diff --git a/values/postgres-operator/values.yaml.gotmpl b/values/postgres-operator/values.yaml.gotmpl new file mode 100644 index 00000000..8f1400a6 --- /dev/null +++ b/values/postgres-operator/values.yaml.gotmpl @@ -0,0 +1,3 @@ +postgres_operator: + enabled: true + autosync: false \ No newline at end of file diff --git a/values/prometheus/manifests/prometheus.yaml b/values/prometheus/manifests/prometheus.yaml new file mode 100644 index 00000000..00f95320 --- /dev/null +++ b/values/prometheus/manifests/prometheus.yaml @@ -0,0 +1,74 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: prometheus + namespace: argocd +spec: + destination: + namespace: prometheus + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/cilium + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + syncOptions: + - ServerSideApply=true + {{- if .Values.prometheus.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} + ignoreDifferences: + - group: apps + kind: Deployment + jqPathExpressions: + - '.spec.template.spec.containers[]?.resources' + - group: monitoring.coreos.com + kind: ServiceMonitor + jqPathExpressions: + - '.spec.endpoints[]?.relabelings' + - group: admissionregistration.k8s.io + kind: MutatingWebhookConfiguration + jqPathExpressions: + - '.webhooks[]?.clientConfig.caBundle' + - group: admissionregistration.k8s.io + kind: ValidatingWebhookConfiguration + jqPathExpressions: + - '.webhooks[]?.clientConfig.caBundle' +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: prometheus-crd + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-1" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: prometheus + server: 'https://kubernetes.default.svc' + source: + repoURL: 'https://prometheus-community.github.io/helm-charts' + targetRevision: '14.0.0' + chart: prometheus-operator-crds + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + automated: {} + syncOptions: + - ServerSideApply=true + - CreateNamespace=true + - ApplyOutOfSyncOnly=true +{{- end }} diff --git a/values/prometheus/values-oceanbox.yaml.gotmpl b/values/prometheus/values-oceanbox.yaml.gotmpl new file mode 100644 index 00000000..6ae6980a --- /dev/null +++ b/values/prometheus/values-oceanbox.yaml.gotmpl @@ -0,0 +1,15 @@ +cilium: + enabled: true + nodePort: + enable: true + l2announcement: + enable: true + loadbalancerPool: + enabled: true + cidr: + - 10.255.241.11/32 + - 10.255.241.12/32 + - 10.255.241.13/32 + - 10.255.241.14/32 + - 10.255.241.15/32 + diff --git a/values/prometheus/values.yaml.gotmpl b/values/prometheus/values.yaml.gotmpl new file mode 100644 index 00000000..6163164c --- /dev/null +++ b/values/prometheus/values.yaml.gotmpl @@ -0,0 +1,32 @@ +cilium: + enabled: false + autosync: true + spire: + enabled: false + envoy: + enabled: false + hubble: + ui: true + enabled: false + encryption: + enabled: true + type: wireguard + kubeProxyReplacement: true + l2announcement: + enabled: false + nodePort: + enabled: false + gatewayAPI: + enabled: false + ingressController: + enabled: false + defaultClass: false + loadbalancerMode: shared + policyAuditMode: false + upgradeCompatability: 1.15 + k8sServiceHost: localhost + k8sServicePort: 7445 + loadbalancerPool: + enabled: false + cidr: [] + diff --git a/values/prometheus/values/prometheus.yaml.gotmpl b/values/prometheus/values/prometheus.yaml.gotmpl new file mode 100644 index 00000000..61d3d62f --- /dev/null +++ b/values/prometheus/values/prometheus.yaml.gotmpl @@ -0,0 +1,106 @@ +authentication: + mutual: + spire: + enabled: {{ .Values.cilium.spire.enabled }} +cgroup: + autoMount: + enabled: false + hostRoot: /sys/fs/cgroup +dashboards: + enabled: true + namespace: prometheus +enableXTSocketFallback: false +encryption: + enabled: {{ .Values.cilium.encryption.enabled }} + type: {{ .Values.cilium.encryption.type}} +envoy: + enabled: {{ .Values.cilium.envoy.enabled }} + prometheus: + serviceMonitor: + enabled: {{ .Values.cilium.envoy.enabled }} +extraConfig: + enable-envoy-config: "true" +hubble: + enabled: true + tls: + auto: + method: cronJob + metrics: + dashboards: + enabled: true + namespace: prometheus + enabled: + - dns:query;ignoreAAAA + - drop + - tcp + - flow + - icmp + - policy:sourceContext=app|workload-name|pod|reserved-identity;destinationContext=app|workload-name|pod|dns|reserved-identity;labelsContext=source_namespace,destination_namespace + - httpV2:exemplars=false;labelsContext=source_ip,source_namespace,source_workload,destination_ip,destination_namespace,destination_workload,traffic_direction + port: 12304 + serviceMonitor: + enabled: true + redact: + enabled: true + relay: + enabled: true + prometheus: + enabled: true + serviceMonitor: + enabled: true + ui: + enabled: {{ .Values.cilium.hubble.ui }} +ipam: + mode: kubernetes +kubeProxyReplacement: {{ .Values.cilium.kubeProxyReplacement }} +l2announcements: + enabled: {{ .Values.cilium.l2announcement.enabled }} +k8sServiceHost: {{ .Values.cilium.k8sServiceHost }} +k8sServicePort: {{ .Values.cilium.k8sServicePort }} +nodePort: + enabled: {{ .Values.cilium.nodePort.enabled }} +gatewayAPI: + enabled: {{ .Values.cilium.gatewayAPI.enabled }} +ingressController: + enabled: {{ .Values.cilium.ingressController.enabled }} + default: {{ .Values.cilium.ingressController.defaultClass }} + loadbalancerMode: {{ .Values.cilium.ingressController.loadbalancerMode }} +operator: + dashboards: + enabled: true + namespace: prometheus + prometheus: + enabled: true + port: 12301 + serviceMointor: + enabled: true + port: 12302 + rollOutPods: true +policyAuditMode: {{ .Values.cilium.policyAuditMode }} +prometheus: + enabled: true + port: 12300 + serviceMonitor: + enabled: true +rollOutCiliumPods: true +securityContext: + capabilities: + ciliumAgent: + - CHOWN + - KILL + - NET_ADMIN + - NET_RAW + - IPC_LOCK + - SYS_ADMIN + - SYS_RESOURCE + - DAC_OVERRIDE + - FOWNER + - SETGID + - SETUID + cleanCiliumState: + - NET_ADMIN + - SYS_ADMIN + - SYS_RESOURCE +{{- with .Values.cilium.upgradeCompatability}} +upgradeCompatability: {{ . }} +{{- end }} diff --git a/values/velero/kustomize/base/kustomization.yaml b/values/velero/kustomize/base/kustomization.yaml new file mode 100644 index 00000000..57f354b1 --- /dev/null +++ b/values/velero/kustomize/base/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - _manifest.yaml diff --git a/values/velero/kustomize/default/kustomization.yaml b/values/velero/kustomize/default/kustomization.yaml new file mode 100644 index 00000000..22967828 --- /dev/null +++ b/values/velero/kustomize/default/kustomization.yaml @@ -0,0 +1,4 @@ +generatorOptions: + disableNameSuffixHash: true +resources: + - ../base diff --git a/values/velero/manifests/velero.yaml b/values/velero/manifests/velero.yaml new file mode 100644 index 00000000..2e455085 --- /dev/null +++ b/values/velero/manifests/velero.yaml @@ -0,0 +1,34 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: velero + namespace: argocd +spec: + destination: + namespace: velero + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/velero + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + {{- if .Values.velero.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +{{- end }} diff --git a/values/velero/values.yaml.gotmpl b/values/velero/values.yaml.gotmpl new file mode 100644 index 00000000..966cdf7d --- /dev/null +++ b/values/velero/values.yaml.gotmpl @@ -0,0 +1,28 @@ +velero: + enabled: true + autosync: true + kubeletRootDir: "/var/lib/kubernetes/pods" + bucket: velero-backup + bsl: default + # Opt-in or opt-out pvc backup + # https://velero.io/docs/main/file-system-backup/#to-back-up + backupAllVolumes: true + credentials: + secretName: "s3-credentials" + s3: + region: us-east-1 + url: "https://nutanix-obj-s3.kube-system" + insecureSkipTLSVerify: true + resources: + velero: + request: + cpu: 500m + memory: 1Gi + limit: + memory: 2Gi + nodeAgent: + request: + cpu: 500m + memory: 1Gi + limit: + memory: 2Gi diff --git a/values/velero/values/velero.yaml.gotmpl b/values/velero/values/velero.yaml.gotmpl new file mode 100644 index 00000000..a1ffec82 --- /dev/null +++ b/values/velero/values/velero.yaml.gotmpl @@ -0,0 +1,74 @@ +initContainers: +- name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.9.0 + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /target + name: plugins +credentials: + useSecret: true + existingSecret: {{ .Values.velero.credentials.secretName }} +deployNodeAgent: true +nodeAgent: + podVolumePath: {{ .Values.velero.kubeletRootDir }} + resources: + requests: + cpu: {{ .Values.velero.resources.nodeAgent.request.cpu | default "500m" }} + memory: {{ .Values.velero.resources.nodeAgent.request.memory | default "1Gi" }} + limits: + memory: {{ .Values.velero.resources.nodeAgent.limit.memory | default "2Gi" }} +snapshotsEnabled: false +resources: + requests: + cpu: {{ .Values.velero.resources.velero.request.cpu | default "500m" }} + memory: {{ .Values.velero.resources.velero.request.memory | default "1Gi" }} + limits: + memory: {{ .Values.velero.resources.velero.limit.memory | default "1Gi" }} +configuration: + uploaderType: kopia + # Backup all volumes by default + defaultVolumesToFsBackup: {{ .Values.velero.backupAllVolumes }} + ## https://velero.io/docs/v1.6/api-types/backupstoragelocation/ + backupStorageLocation: + - name: {{ .Values.velero.bsl }} + bucket: {{ .Values.velero.bucket }} + provider: aws + default: true + ## prefix is the directory under which all Velero data should be stored within the bucket. Optional. + prefix: {{ .Values.cluster_config.cluster }}/velero + accessMode: ReadWrite + config: + ## ONLY us-east-1 region is supported by nutanix + region: {{ .Values.velero.s3.region }} + s3ForcePathStyle: "true" + s3Url: {{ .Values.velero.s3.url }} + {{- if .Values.velero.s3.insecureSkipTLSVerify }} + insecureSkipTLSVerify: true + {{- end }} +metrics: + serviceMonitor: + enabled: true + additionalLabels: + k8s-app: "velero" + release: "prometheus" + prometheusRule: + enabled: true + # namespace: "" + # Rules to be deployed + spec: + - alert: VeleroBackupPartialFailures + annotations: + message: Velero backup {{` {{ $labels.schedule }} `}} has {{` {{$value | humanizePercentage}} `}} partialy failed backups. + expr: |- + velero_backup_partial_failure_total{schedule!=""} / velero_backup_attempt_total{schedule!=""} > 0.25 + for: 15m + labels: + severity: critical + - alert: VeleroBackupFailures + annotations: + message: Velero backup {{` {{$labels.schedule}} `}} has {{` {{$value | humanizePercentage}} `}} failed backups. + expr: |- + velero_backup_failure_total{schedule!=""} / velero_backup_attempt_total{schedule!=""} > 0.25 + for: 15m + labels: + severity: critical -- 2.52.0 From a0a0f8586d595342af7301719bb707587e03d8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Mon, 2 Jun 2025 22:25:06 +0200 Subject: [PATCH 2/4] wip: helmfileify --- bin/generate.sh | 29 +---- helmfile.d/argo.yaml.gotmpl | 2 +- helmfile.d/cert-manager.yaml.gotmpl | 37 +++++++ helmfile.d/cilium.yaml.gotmpl | 1 + helmfile.d/dapr.yaml.gotmpl | 42 +++++++ helmfile.d/geoserver.yaml.gotmpl | 37 +++++++ helmfile.d/headscale.yaml.gotmpl | 37 +++++++ helmfile.d/ingress-nginx.yaml.gotmpl | 42 +++++++ helmfile.d/keycloak.yaml.gotmpl | 42 +++++++ helmfile.d/kyverno.yaml.gotmpl | 2 +- helmfile.d/loki.yaml.gotmpl | 42 +++++++ helmfile.d/metricsserver.yaml.gotmpl | 37 +++++++ helmfile.d/openfga.yaml.gotmpl | 41 +++++++ helmfile.d/otel-collector.yaml.gotmpl | 37 +++++++ helmfile.d/plausible.yaml.gotmpl | 37 +++++++ helmfile.d/postgres-operator.yaml.gotmpl | 2 +- helmfile.d/prometheus.yaml.gotmpl | 3 +- helmfile.d/rabbitmq.yaml.gotmpl | 42 +++++++ helmfile.d/redis.yaml.gotmpl | 42 +++++++ helmfile.d/tempo.yaml.gotmpl | 43 ++++++++ helmfile.d/velero.yaml.gotmpl | 2 +- helmfile.d/wordpress.yaml.gotmpl | 37 +++++++ helmfile.d/x509-exporter.yaml.gotmpl | 37 +++++++ justfile | 13 ++- values/dapr/manifests/dapr.yaml | 38 +++++++ values/dapr/values.yaml.gotmpl | 2 + values/dapr/values/dapr.yaml.gotmpl | 3 + .../manifests/ingress-nginx.yaml | 31 ++++++ values/ingress-nginx/values.yaml.gotmpl | 9 ++ .../values/ingress-nginx.yaml.gotmpl | 98 +++++++++++++++++ .../keycloak/{prod => manifests}/ingress.yaml | 0 values/keycloak/manifests/keycloak.yaml | 40 +++++++ values/keycloak/values.yaml.gotmpl | 2 + values/keycloak/{ => values}/values-prod.yaml | 0 values/keycloak/{ => values}/values.yaml | 0 values/loki/manifests/loki.yaml | 38 +++++++ values/loki/values.yaml.gotmpl | 16 +++ values/loki/values/loki.yaml.gotmpl | 103 ++++++++++++++++++ .../openfga/kustomize/base/kustomization.yaml | 4 + .../{ => manifests}/migration-job.yaml | 0 values/openfga/manifests/openfga.yaml | 40 +++++++ .../{ => manifests}/postgres-secret.yaml | 0 values/openfga/values.yaml.gotmpl | 5 + .../openfga-prod.yaml.gotmpl} | 35 +++--- .../openfga-staging.yaml.gotmpl} | 35 +++--- values/openfga/values/openfga.yaml.gotmpl | 17 +++ .../{ => kustomize}/prod/nodeport.yaml | 0 .../{ => kustomize}/staging/nodeport.yaml | 0 values/rabbitmq/manifests/rabbitmq.yaml | 40 +++++++ values/rabbitmq/values.yaml.gotmpl | 2 + .../rabbitmq-prod.yaml.gotmpl} | 17 ++- .../rabbitmq-staging.yaml.gotmpl} | 16 +-- values/rabbitmq/values/rabbitmq.yaml.gotmpl | 8 ++ .../redis/kustomize/base/kustomization.yaml | 4 + .../redis/kustomize/prod/kustomization.yaml | 5 + .../redis/{ => kustomize}/prod/nodeport.yaml | 0 .../kustomize/staging/kustomization.yaml | 6 + .../{ => kustomize}/staging/nodeport.yaml | 2 +- values/redis/manifests/redis.yaml | 45 ++++++++ values/redis/values.yaml.gotmpl | 5 + .../redis-prod.yaml.gotmpl} | 33 +++--- .../redis-staging.yaml.gotmpl} | 33 +++--- values/redis/values/redis.yaml.gotmpl | 17 +++ .../tempo/kustomize/base/kustomization.yaml | 4 + .../kustomize/default/kustomization.yaml | 4 + values/tempo/manifests/tempo.yaml | 38 +++++++ values/tempo/values.yaml.gotmpl | 12 ++ values/tempo/values/tempo.yaml.gotmpl | 53 +++++++++ .../kustomize/base/kustomization.yaml | 4 + .../kustomize/default/kustomization.yaml | 4 + .../manifests/x509-exporter.yaml | 38 +++++++ values/x509-exporter/values.yaml.gotmpl | 4 + .../values/x509-exporter.yaml.gotmpl | 16 +++ 73 files changed, 1491 insertions(+), 121 deletions(-) create mode 100644 helmfile.d/cert-manager.yaml.gotmpl create mode 100644 helmfile.d/dapr.yaml.gotmpl create mode 100644 helmfile.d/geoserver.yaml.gotmpl create mode 100644 helmfile.d/headscale.yaml.gotmpl create mode 100644 helmfile.d/ingress-nginx.yaml.gotmpl create mode 100644 helmfile.d/keycloak.yaml.gotmpl create mode 100644 helmfile.d/loki.yaml.gotmpl create mode 100644 helmfile.d/metricsserver.yaml.gotmpl create mode 100644 helmfile.d/openfga.yaml.gotmpl create mode 100644 helmfile.d/otel-collector.yaml.gotmpl create mode 100644 helmfile.d/plausible.yaml.gotmpl create mode 100644 helmfile.d/rabbitmq.yaml.gotmpl create mode 100644 helmfile.d/redis.yaml.gotmpl create mode 100644 helmfile.d/tempo.yaml.gotmpl create mode 100644 helmfile.d/wordpress.yaml.gotmpl create mode 100644 helmfile.d/x509-exporter.yaml.gotmpl create mode 100644 values/dapr/manifests/dapr.yaml create mode 100644 values/dapr/values.yaml.gotmpl create mode 100644 values/dapr/values/dapr.yaml.gotmpl create mode 100644 values/ingress-nginx/manifests/ingress-nginx.yaml create mode 100644 values/ingress-nginx/values.yaml.gotmpl create mode 100644 values/ingress-nginx/values/ingress-nginx.yaml.gotmpl rename values/keycloak/{prod => manifests}/ingress.yaml (100%) create mode 100644 values/keycloak/manifests/keycloak.yaml create mode 100644 values/keycloak/values.yaml.gotmpl rename values/keycloak/{ => values}/values-prod.yaml (100%) rename values/keycloak/{ => values}/values.yaml (100%) create mode 100644 values/loki/manifests/loki.yaml create mode 100644 values/loki/values.yaml.gotmpl create mode 100644 values/loki/values/loki.yaml.gotmpl create mode 100644 values/openfga/kustomize/base/kustomization.yaml rename values/openfga/{ => manifests}/migration-job.yaml (100%) create mode 100644 values/openfga/manifests/openfga.yaml rename values/openfga/{ => manifests}/postgres-secret.yaml (100%) create mode 100644 values/openfga/values.yaml.gotmpl rename values/openfga/{values-prod.yaml => values/openfga-prod.yaml.gotmpl} (75%) rename values/openfga/{values-staging.yaml => values/openfga-staging.yaml.gotmpl} (83%) create mode 100644 values/openfga/values/openfga.yaml.gotmpl rename values/rabbitmq/{ => kustomize}/prod/nodeport.yaml (100%) rename values/rabbitmq/{ => kustomize}/staging/nodeport.yaml (100%) create mode 100644 values/rabbitmq/manifests/rabbitmq.yaml create mode 100644 values/rabbitmq/values.yaml.gotmpl rename values/rabbitmq/{values-prod.yaml => values/rabbitmq-prod.yaml.gotmpl} (78%) rename values/rabbitmq/{values-staging.yaml => values/rabbitmq-staging.yaml.gotmpl} (82%) create mode 100644 values/rabbitmq/values/rabbitmq.yaml.gotmpl create mode 100644 values/redis/kustomize/base/kustomization.yaml create mode 100644 values/redis/kustomize/prod/kustomization.yaml rename values/redis/{ => kustomize}/prod/nodeport.yaml (100%) create mode 100644 values/redis/kustomize/staging/kustomization.yaml rename values/redis/{ => kustomize}/staging/nodeport.yaml (90%) create mode 100644 values/redis/manifests/redis.yaml create mode 100644 values/redis/values.yaml.gotmpl rename values/redis/{values-prod.yaml => values/redis-prod.yaml.gotmpl} (55%) rename values/redis/{values-staging.yaml => values/redis-staging.yaml.gotmpl} (55%) create mode 100644 values/redis/values/redis.yaml.gotmpl create mode 100644 values/tempo/kustomize/base/kustomization.yaml create mode 100644 values/tempo/kustomize/default/kustomization.yaml create mode 100644 values/tempo/manifests/tempo.yaml create mode 100644 values/tempo/values.yaml.gotmpl create mode 100644 values/tempo/values/tempo.yaml.gotmpl create mode 100644 values/x509-exporter/kustomize/base/kustomization.yaml create mode 100644 values/x509-exporter/kustomize/default/kustomization.yaml create mode 100644 values/x509-exporter/manifests/x509-exporter.yaml create mode 100644 values/x509-exporter/values.yaml.gotmpl create mode 100644 values/x509-exporter/values/x509-exporter.yaml.gotmpl diff --git a/bin/generate.sh b/bin/generate.sh index f5849f8f..2f48fd7c 100755 --- a/bin/generate.sh +++ b/bin/generate.sh @@ -2,10 +2,10 @@ helmfile () { -tier=$2 name=$1 +tier=$2 -cat << EOF +cat < Date: Wed, 4 Jun 2025 13:18:18 +0200 Subject: [PATCH 3/4] feat: Migrate sys applications to helmfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move most of helmfiles into temp to test only velero. File structure: ```bash / ├── helmfile.d/ # Helmfiles, *.yaml.gotmpl ├── charts/ # Our own charts, e.g `Atlantis` ├── values # Values for helmfiles │ ├── │ │ ├── values.yaml.gotmpl # Values to be templated in `values/` │ │ ├── kustomize # Kustomizations per environment │ │ ├── manifests # Raw manifests │ │ │ ├── .yaml # Argo App for bootstrap │ │ │ ├── dashboards # Grafana dashboards │ │ │ │ └── -metrics.yaml │ │ │ └── policies # Cilium and Kyverno policies │ │ │ ├── CiliumNetworkPolicy-allow-api-server.yaml │ │ │ └── KyvernoPolicy-regred-secret.yaml │ │ └── values # Values for each environment │ │ ├── -staging.yaml.gotmpl # Values for staging environment │ │ ├── -prod.yaml.gotmpl # Values for prod environment │ │ └── .yaml.gotmpl # Standard values for all environments │ │ │ ├── values.yaml # Standard values for all cluster │ ├── values-oceanbox.yaml # Values overrides for oceanbox │ ├── values-ekman.yaml # Values overrides for ekman ``` --- argocd/helmfile-cmp/argo-repo-server.yaml | 476 ++ argocd/helmfile-cmp/generate.sh | 7 +- argocd/helmfile-cmp/plugin.yaml | 4 +- bin/helmify | 5 +- envs/environments.yaml.gotmpl | 12 +- ...elero.yaml.gotmpl => helmfile.yaml.gotmpl} | 8 +- justfile | 4 +- shell.nix | 5 +- {helmfile.d => temp}/argo.yaml.gotmpl | 0 {helmfile.d => temp}/atlantis.yaml.gotmpl | 0 {helmfile.d => temp}/cert-manager.yaml.gotmpl | 15 +- {helmfile.d => temp}/cilium.yaml.gotmpl | 0 {helmfile.d => temp}/dapr.yaml.gotmpl | 0 {helmfile.d => temp}/geoserver.yaml.gotmpl | 0 {helmfile.d => temp}/headscale.yaml.gotmpl | 0 .../ingress-nginx.yaml.gotmpl | 0 {helmfile.d => temp}/keycloak.yaml.gotmpl | 0 {helmfile.d => temp}/kyverno.yaml.gotmpl | 2 +- {helmfile.d => temp}/loki.yaml.gotmpl | 0 .../metricsserver.yaml.gotmpl | 16 +- temp/nfs-provisioner.yaml.gotmpl | 43 + {helmfile.d => temp}/nix/argo.gotmpl.nix | 0 {helmfile.d => temp}/nix/helmfile.gotmpl.nix | 0 {helmfile.d => temp}/openfga.yaml.gotmpl | 0 .../otel-collector.yaml.gotmpl | 0 {helmfile.d => temp}/plausible.yaml.gotmpl | 0 .../postgres-operator.yaml.gotmpl | 0 {helmfile.d => temp}/prometheus.yaml.gotmpl | 0 {helmfile.d => temp}/rabbitmq.yaml.gotmpl | 0 {helmfile.d => temp}/redis.yaml.gotmpl | 0 {helmfile.d => temp}/tempo.yaml.gotmpl | 0 {helmfile.d => temp}/wordpress.yaml.gotmpl | 0 .../x509-exporter.yaml.gotmpl | 14 +- .../cert-manager/manifests/cert-manager.yaml | 38 + ...licy-allow-api-server-to-cert-manager.yaml | 0 .../CiliumNetworkPolicy-allow-api-server.yaml | 0 ...etworkPolicy-allow-prometheus-metrics.yaml | 0 ...liumNetworkPolicy-allow-world-traffic.yaml | 0 .../manifests/pre-cert-manager.yaml | 225 + values/cert-manager/values.yaml.gotmpl | 3 + .../values/cert-manager.yaml.gotmpl | 5 + .../manifests}/dashboards/ingress-nginx.yaml | 0 .../manifests/ingress-nginx.yaml | 3 + ...iliumNetworkPolicy-allow-host-traffic.yaml | 14 + ...iumNetworkPolicy-allow-hubble-traffic.yaml | 14 + ...etworkPolicy-allow-prometheus-metrics.yaml | 17 + .../CiliumNetworkPolicy-allow-s3-traffic.yaml | 19 + ...rkPolicy-allow-world-to-ingress-nginx.yaml | 19 + .../kyverno/kustomize/base/kustomization.yaml | 4 - .../kustomize/default/kustomization.yaml | 4 - .../manifests/kyverno-cluster-admin.yaml | 17 + .../CiliumNetworkPolicy-allow-api-server.yaml | 15 + ...etworkPolicy-allow-prometheus-metrics.yaml | 17 + ...rkPolicy-allow-remote-node-to-kyverno.yaml | 12 + .../manifests/policies/sync-gitlab.yaml | 31 + .../manifests/policies/sync-regcred.yaml | 33 + .../manifests/policies/sync-s3-secret.yaml | 33 + .../whitelist-internal-ingresses.yaml | 73 + .../manifests/metricsserver.yaml | 36 + values/metricsserver/values.yaml.gotmpl | 4 + .../values/metricsserver.yaml.gotmpl | 9 + .../manifests/nfs-provisioner.yaml | 38 + values/nfs-provisioner/values.yaml.gotmpl | 6 + .../values/nfs-provisioner.yaml.gotmpl | 16 + .../kustomize/base/kustomization.yaml | 4 - .../kustomize/default/kustomization.yaml | 4 - .../manifests/dashboards/cnpg-postgres.yaml | 3908 +++++++++++++++++ .../CiliumNetworkPolicy-allow-api-server.yaml | 16 + ...workPolicy-allow-remote-node-webhooks.yaml | 15 + .../CiliumNetworkPolicy-allow-alerting.yaml | 13 + ...workPolicy-allow-alertmanager-ingress.yaml | 14 + ...CiliumNetworkPolicy-allow-dns-metrics.yaml | 15 + ...iliumNetworkPolicy-allow-etcd-metrics.yaml | 15 + ...umNetworkPolicy-allow-grafana-ingress.yaml | 14 + ...etworkPolicy-allow-grafana-oidc-login.yaml | 16 + ...umNetworkPolicy-allow-grafana-plugins.yaml | 15 + ...kPolicy-allow-grafana-secure-gravatar.yaml | 14 + ...iliumNetworkPolicy-allow-host-traffic.yaml | 14 + ...liumNetworkPolicy-allow-nginx-ingress.yaml | 14 + ...umNetworkPolicy-allow-opencost-scrape.yaml | 19 + ...y-allow-remote-node-to-metrics-server.yaml | 13 + ...rkPolicy-allow-remote-node-to-webhook.yaml | 13 + ...umNetworkPolicy-allow-robusta-ingress.yaml | 14 + ...liumNetworkPolicy-allow-stats-grafana.yaml | 13 + ...heus-add-folder-to-default-dashboards.yaml | 32 + values/prometheus/manifests/prometheus.yaml | 5 +- values/prometheus/values.yaml.gotmpl | 61 +- values/values-oceanbox.yaml | 1 + .../velero/kustomize/base/kustomization.yaml | 4 - .../kustomize/default/kustomization.yaml | 4 - .../velero/manifests/dashboards/velero.yaml | 2214 ++++++++++ .../CiliumNetworkPolicy-allow-api-server.yaml | 16 + ...iumNetworkPolicy-allow-job-api-server.yaml | 16 + ...etworkPolicy-allow-prometheus-metrics.yaml | 17 + values/velero/manifests/schedule.yaml | 31 + values/velero/manifests/velero.yaml | 9 +- values/velero/values.yaml.gotmpl | 6 +- values/velero/values/velero.yaml.gotmpl | 6 +- .../kustomize/base/kustomization.yaml | 4 - .../kustomize/default/kustomization.yaml | 4 - .../dashboards/x509-exporter-dashbaoard.yaml | 2011 +++++++++ .../manifests/x509-certificates.yaml | 48 + 102 files changed, 9862 insertions(+), 106 deletions(-) create mode 100644 argocd/helmfile-cmp/argo-repo-server.yaml rename helmfile.d/{velero.yaml.gotmpl => helmfile.yaml.gotmpl} (82%) rename {helmfile.d => temp}/argo.yaml.gotmpl (100%) rename {helmfile.d => temp}/atlantis.yaml.gotmpl (100%) rename {helmfile.d => temp}/cert-manager.yaml.gotmpl (79%) rename {helmfile.d => temp}/cilium.yaml.gotmpl (100%) rename {helmfile.d => temp}/dapr.yaml.gotmpl (100%) rename {helmfile.d => temp}/geoserver.yaml.gotmpl (100%) rename {helmfile.d => temp}/headscale.yaml.gotmpl (100%) rename {helmfile.d => temp}/ingress-nginx.yaml.gotmpl (100%) rename {helmfile.d => temp}/keycloak.yaml.gotmpl (100%) rename {helmfile.d => temp}/kyverno.yaml.gotmpl (98%) rename {helmfile.d => temp}/loki.yaml.gotmpl (100%) rename {helmfile.d => temp}/metricsserver.yaml.gotmpl (78%) create mode 100644 temp/nfs-provisioner.yaml.gotmpl rename {helmfile.d => temp}/nix/argo.gotmpl.nix (100%) rename {helmfile.d => temp}/nix/helmfile.gotmpl.nix (100%) rename {helmfile.d => temp}/openfga.yaml.gotmpl (100%) rename {helmfile.d => temp}/otel-collector.yaml.gotmpl (100%) rename {helmfile.d => temp}/plausible.yaml.gotmpl (100%) rename {helmfile.d => temp}/postgres-operator.yaml.gotmpl (100%) rename {helmfile.d => temp}/prometheus.yaml.gotmpl (100%) rename {helmfile.d => temp}/rabbitmq.yaml.gotmpl (100%) rename {helmfile.d => temp}/redis.yaml.gotmpl (100%) rename {helmfile.d => temp}/tempo.yaml.gotmpl (100%) rename {helmfile.d => temp}/wordpress.yaml.gotmpl (100%) rename {helmfile.d => temp}/x509-exporter.yaml.gotmpl (80%) create mode 100644 values/cert-manager/manifests/cert-manager.yaml rename {apps/charts/sys-cilium-policies/templates/cert-manager => values/cert-manager/manifests/policies}/CiliumNetworkPolicy-allow-api-server-to-cert-manager.yaml (100%) rename {apps/charts/sys-cilium-policies/templates/cert-manager => values/cert-manager/manifests/policies}/CiliumNetworkPolicy-allow-api-server.yaml (100%) rename {apps/charts/sys-cilium-policies/templates/cert-manager => values/cert-manager/manifests/policies}/CiliumNetworkPolicy-allow-prometheus-metrics.yaml (100%) rename {apps/charts/sys-cilium-policies/templates/cert-manager => values/cert-manager/manifests/policies}/CiliumNetworkPolicy-allow-world-traffic.yaml (100%) create mode 100644 values/cert-manager/manifests/pre-cert-manager.yaml create mode 100644 values/cert-manager/values.yaml.gotmpl create mode 100644 values/cert-manager/values/cert-manager.yaml.gotmpl rename {apps/templates/resources => values/ingress-nginx/manifests}/dashboards/ingress-nginx.yaml (100%) create mode 100644 values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml create mode 100644 values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-hubble-traffic.yaml create mode 100644 values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml create mode 100644 values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-s3-traffic.yaml create mode 100644 values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-world-to-ingress-nginx.yaml delete mode 100644 values/kyverno/kustomize/base/kustomization.yaml delete mode 100644 values/kyverno/kustomize/default/kustomization.yaml create mode 100644 values/kyverno/manifests/kyverno-cluster-admin.yaml create mode 100644 values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml create mode 100644 values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml create mode 100644 values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-kyverno.yaml create mode 100644 values/kyverno/manifests/policies/sync-gitlab.yaml create mode 100644 values/kyverno/manifests/policies/sync-regcred.yaml create mode 100644 values/kyverno/manifests/policies/sync-s3-secret.yaml create mode 100644 values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml create mode 100644 values/metricsserver/manifests/metricsserver.yaml create mode 100644 values/metricsserver/values.yaml.gotmpl create mode 100644 values/metricsserver/values/metricsserver.yaml.gotmpl create mode 100644 values/nfs-provisioner/manifests/nfs-provisioner.yaml create mode 100644 values/nfs-provisioner/values.yaml.gotmpl create mode 100644 values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl delete mode 100644 values/postgres-operator/kustomize/base/kustomization.yaml delete mode 100644 values/postgres-operator/kustomize/default/kustomization.yaml create mode 100644 values/postgres-operator/manifests/dashboards/cnpg-postgres.yaml create mode 100644 values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml create mode 100644 values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-remote-node-webhooks.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alerting.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alertmanager-ingress.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-dns-metrics.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-etcd-metrics.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-ingress.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-oidc-login.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-plugins.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-secure-gravatar.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-nginx-ingress.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-opencost-scrape.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-metrics-server.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-webhook.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-robusta-ingress.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-stats-grafana.yaml create mode 100644 values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml delete mode 100644 values/velero/kustomize/base/kustomization.yaml delete mode 100644 values/velero/kustomize/default/kustomization.yaml create mode 100644 values/velero/manifests/dashboards/velero.yaml create mode 100644 values/velero/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml create mode 100644 values/velero/manifests/policies/CiliumNetworkPolicy-allow-job-api-server.yaml create mode 100644 values/velero/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml create mode 100644 values/velero/manifests/schedule.yaml delete mode 100644 values/x509-exporter/kustomize/base/kustomization.yaml delete mode 100644 values/x509-exporter/kustomize/default/kustomization.yaml create mode 100644 values/x509-exporter/manifests/dashboards/x509-exporter-dashbaoard.yaml create mode 100644 values/x509-exporter/manifests/x509-certificates.yaml diff --git a/argocd/helmfile-cmp/argo-repo-server.yaml b/argocd/helmfile-cmp/argo-repo-server.yaml new file mode 100644 index 00000000..fb061f0e --- /dev/null +++ b/argocd/helmfile-cmp/argo-repo-server.yaml @@ -0,0 +1,476 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + argocd.argoproj.io/tracking-id: argocd:apps/Deployment:argocd/argocd-repo-server + deployment.kubernetes.io/revision: "27" + labels: + app.kubernetes.io/component: repo-server + app.kubernetes.io/instance: argocd + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: argocd-repo-server + app.kubernetes.io/part-of: argocd + app.kubernetes.io/version: v2.12.3 + helm.sh/chart: argo-cd-7.5.2 + name: argocd-repo-server + namespace: argocd +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app.kubernetes.io/instance: argocd + app.kubernetes.io/name: argocd-repo-server + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + checksum/cm: 67d6152e0e3482f9a74a6b570fd32bbec4e7856bffe49f577a2a0d3aeaed6f48 + checksum/cmd-params: 69ed50e8936f4d6429dc331f782ad0a7d22eb12c318d6800403040352214b781 + creationTimestamp: null + labels: + app.kubernetes.io/component: repo-server + app.kubernetes.io/instance: argocd + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: argocd-repo-server + app.kubernetes.io/part-of: argocd + app.kubernetes.io/version: v2.12.3 + helm.sh/chart: argo-cd-7.5.2 + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: argocd-repo-server + topologyKey: kubernetes.io/hostname + weight: 100 + automountServiceAccountToken: true + containers: + - args: + - /usr/local/bin/argocd-repo-server + - --port=8081 + - --metrics-port=8084 + env: + - name: ARGOCD_REPO_SERVER_NAME + value: argocd-repo-server + - name: ARGOCD_RECONCILIATION_TIMEOUT + valueFrom: + configMapKeyRef: + key: timeout.reconciliation + name: argocd-cm + optional: true + - name: ARGOCD_REPO_SERVER_LOGFORMAT + valueFrom: + configMapKeyRef: + key: reposerver.log.format + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_LOGLEVEL + valueFrom: + configMapKeyRef: + key: reposerver.log.level + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_PARALLELISM_LIMIT + valueFrom: + configMapKeyRef: + key: reposerver.parallelism.limit + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_LISTEN_ADDRESS + valueFrom: + configMapKeyRef: + key: reposerver.listen.address + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_LISTEN_METRICS_ADDRESS + valueFrom: + configMapKeyRef: + key: reposerver.metrics.listen.address + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_DISABLE_TLS + valueFrom: + configMapKeyRef: + key: reposerver.disable.tls + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_TLS_MIN_VERSION + valueFrom: + configMapKeyRef: + key: reposerver.tls.minversion + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_TLS_MAX_VERSION + valueFrom: + configMapKeyRef: + key: reposerver.tls.maxversion + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_TLS_CIPHERS + valueFrom: + configMapKeyRef: + key: reposerver.tls.ciphers + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_CACHE_EXPIRATION + valueFrom: + configMapKeyRef: + key: reposerver.repo.cache.expiration + name: argocd-cmd-params-cm + optional: true + - name: REDIS_SERVER + valueFrom: + configMapKeyRef: + key: redis.server + name: argocd-cmd-params-cm + optional: true + - name: REDIS_COMPRESSION + valueFrom: + configMapKeyRef: + key: redis.compression + name: argocd-cmd-params-cm + optional: true + - name: REDISDB + valueFrom: + configMapKeyRef: + key: redis.db + name: argocd-cmd-params-cm + optional: true + - name: REDIS_USERNAME + valueFrom: + secretKeyRef: + key: redis-username + name: argocd-redis + optional: true + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + key: auth + name: argocd-redis + - name: REDIS_SENTINEL_USERNAME + valueFrom: + secretKeyRef: + key: redis-sentinel-username + name: argocd-redis + optional: true + - name: REDIS_SENTINEL_PASSWORD + valueFrom: + secretKeyRef: + key: redis-sentinel-password + name: argocd-redis + optional: true + - name: ARGOCD_DEFAULT_CACHE_EXPIRATION + valueFrom: + configMapKeyRef: + key: reposerver.default.cache.expiration + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_OTLP_ADDRESS + valueFrom: + configMapKeyRef: + key: otlp.address + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_OTLP_INSECURE + valueFrom: + configMapKeyRef: + key: otlp.insecure + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_OTLP_HEADERS + valueFrom: + configMapKeyRef: + key: otlp.headers + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_MAX_COMBINED_DIRECTORY_MANIFESTS_SIZE + valueFrom: + configMapKeyRef: + key: reposerver.max.combined.directory.manifests.size + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_PLUGIN_TAR_EXCLUSIONS + valueFrom: + configMapKeyRef: + key: reposerver.plugin.tar.exclusions + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_ALLOW_OUT_OF_BOUNDS_SYMLINKS + valueFrom: + configMapKeyRef: + key: reposerver.allow.oob.symlinks + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_STREAMED_MANIFEST_MAX_TAR_SIZE + valueFrom: + configMapKeyRef: + key: reposerver.streamed.manifest.max.tar.size + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_STREAMED_MANIFEST_MAX_EXTRACTED_SIZE + valueFrom: + configMapKeyRef: + key: reposerver.streamed.manifest.max.extracted.size + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE + valueFrom: + configMapKeyRef: + key: reposerver.helm.manifest.max.extracted.size + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE + valueFrom: + configMapKeyRef: + key: reposerver.disable.helm.manifest.max.extracted.size + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_GIT_MODULES_ENABLED + valueFrom: + configMapKeyRef: + key: reposerver.enable.git.submodule + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_GIT_LS_REMOTE_PARALLELISM_LIMIT + valueFrom: + configMapKeyRef: + key: reposerver.git.lsremote.parallelism.limit + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_GIT_REQUEST_TIMEOUT + valueFrom: + configMapKeyRef: + key: reposerver.git.request.timeout + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT + valueFrom: + configMapKeyRef: + key: reposerver.revision.cache.lock.timeout + name: argocd-cmd-params-cm + optional: true + - name: ARGOCD_REPO_SERVER_INCLUDE_HIDDEN_DIRECTORIES + valueFrom: + configMapKeyRef: + key: reposerver.include.hidden.directories + name: argocd-cmd-params-cm + optional: true + - name: HELM_CACHE_HOME + value: /helm-working-dir + - name: HELM_CONFIG_HOME + value: /helm-working-dir + - name: HELM_DATA_HOME + value: /helm-working-dir + image: quay.io/argoproj/argocd:v2.12.3 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz?full=true + port: metrics + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + name: repo-server + ports: + - containerPort: 8081 + name: repo-server + protocol: TCP + - containerPort: 8084 + name: metrics + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: metrics + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /app/config/ssh + name: ssh-known-hosts + - mountPath: /app/config/tls + name: tls-certs + - mountPath: /app/config/gpg/source + name: gpg-keys + - mountPath: /app/config/gpg/keys + name: gpg-keyring + - mountPath: /app/config/reposerver/tls + name: argocd-repo-server-tls + - mountPath: /helm-working-dir + name: helm-working-dir + - mountPath: /home/argocd/cmp-server/plugins + name: plugins + - mountPath: /tmp + name: tmp + - command: + - /var/run/argocd/argocd-cmp-server + image: registry.gitlab.com/oceanbox/manifests/kustomize-helm-with-rewrite:latest + imagePullPolicy: Always + name: kustomize-helm-with-rewrite + securityContext: + runAsNonRoot: true + runAsUser: 999 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/argocd + name: var-files + - mountPath: /home/argocd/cmp-server/plugins + name: plugins + - mountPath: /tmp + name: cmp-tmp + - mountPath: /helm-working-dir + name: helm-working-dir + - command: + - /var/run/argocd/argocd-cmp-server + image: registry.gitlab.com/oceanbox/manifests/helm-kustomize-cmp:latest + imagePullPolicy: Always + name: helm-kustomize-cmp + securityContext: + runAsNonRoot: true + runAsUser: 999 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/argocd + name: var-files + - mountPath: /home/argocd/cmp-server/plugins + name: plugins + - mountPath: /tmp + name: cmp-tmp + - mountPath: /helm-working-dir + name: helm-working-dir + - command: + - /var/run/argocd/argocd-cmp-server + image: registry.gitlab.com/oceanbox/manifests/helmfile-cmp:latest + imagePullPolicy: Always + name: helmfile-cmp + securityContext: + runAsNonRoot: true + runAsUser: 999 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/argocd + name: var-files + - mountPath: /home/argocd/cmp-server/plugins + name: plugins + - mountPath: /tmp + name: cmp-tmp + - mountPath: /helm-working-dir + name: helm-working-dir + dnsPolicy: ClusterFirst + imagePullSecrets: + - name: gitlab-pull-secret + initContainers: + - command: + - /bin/cp + - -n + - /usr/local/bin/argocd + - /var/run/argocd/argocd-cmp-server + image: quay.io/argoproj/argocd:v2.12.3 + imagePullPolicy: IfNotPresent + name: copyutil + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/argocd + name: var-files + - command: + - /bin/sh + - /plugin/init-helm-repos.sh + env: + - name: OCEANBOX_HELM_ACCESS_TOKEN + valueFrom: + secretKeyRef: + key: token + name: oceanbox-helm + optional: false + image: registry.gitlab.com/oceanbox/manifests/kustomize-helm-with-rewrite:latest + imagePullPolicy: Always + name: init-helm-repos + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 999 + seccompProfile: + type: RuntimeDefault + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /helm-working-dir + name: helm-working-dir + restartPolicy: Always + schedulerName: default-scheduler + serviceAccount: argocd-repo-server + serviceAccountName: argocd-repo-server + terminationGracePeriodSeconds: 30 + volumes: + - name: cmp-tmp + - name: helm-working-dir + - name: plugins + - name: var-files + - name: tmp + - configMap: + defaultMode: 420 + name: argocd-ssh-known-hosts-cm + name: ssh-known-hosts + - configMap: + defaultMode: 420 + name: argocd-tls-certs-cm + name: tls-certs + - configMap: + defaultMode: 420 + name: argocd-gpg-keys-cm + name: gpg-keys + - name: gpg-keyring + - name: argocd-repo-server-tls + secret: + defaultMode: 420 + items: + - key: tls.crt + path: tls.crt + - key: tls.key + path: tls.key + - key: ca.crt + path: ca.crt + optional: true + secretName: argocd-repo-server-tls diff --git a/argocd/helmfile-cmp/generate.sh b/argocd/helmfile-cmp/generate.sh index b4869ba5..ff18bef9 100644 --- a/argocd/helmfile-cmp/generate.sh +++ b/argocd/helmfile-cmp/generate.sh @@ -1,5 +1,8 @@ #!/bin/sh +# NOTE: Ensure errors are part of exitcode +# set -o pipefail + export HOME=/plugin export HELM_CACHE_HOME=/tmp/helm/cache @@ -11,5 +14,5 @@ export HELMFILE_TEMPDIR=/tmp/helmfile/tmp env > /tmp/$ARGOCD_APP_NAME.env -helmfile -n "$ARGOCD_APP_NAMESPACE" $ARGS template --include-crds -q - +# helmfile -n "$ARGOCD_APP_NAMESPACE" $ARGS template --include-crds -q +helmfile -n "$ARGOCD_APP_NAMESPACE" $ARGS template --include-crds --debug diff --git a/argocd/helmfile-cmp/plugin.yaml b/argocd/helmfile-cmp/plugin.yaml index 7ecee01b..49299ff0 100644 --- a/argocd/helmfile-cmp/plugin.yaml +++ b/argocd/helmfile-cmp/plugin.yaml @@ -1,12 +1,10 @@ apiVersion: argoproj.io/v1alpha1 kind: ConfigManagementPlugin metadata: - name: helmfile + name: helmfile-cmp spec: generate: command: [ /bin/sh ] args: - /plugin/generate.sh - discover: - fileName: helmfile.yaml lockRepo: false diff --git a/bin/helmify b/bin/helmify index 55d7ca2b..545e88ff 100755 --- a/bin/helmify +++ b/bin/helmify @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -o pipefail + cmd=$1 chart=$2 env=$3 @@ -8,13 +10,14 @@ outdir=${5:-_manifests} build() { mkdir -p $outdir/templates + echo "Creating $outdir/templates" echo "generating $outdir/Chart.yaml" 1>&2 cat < $outdir/Chart.yaml apiVersion: v1 appVersion: "1.0" -description: A Helm chart for Kubernetes +# description: A Helm chart for Kubernetes name: $chart version: 0.1.0 EOF diff --git a/envs/environments.yaml.gotmpl b/envs/environments.yaml.gotmpl index 26ac52ff..d95ffed7 100644 --- a/envs/environments.yaml.gotmpl +++ b/envs/environments.yaml.gotmpl @@ -2,22 +2,22 @@ environments: default: values: - ../values/values.yaml - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/*/values.yaml.gotmpl - - ../values/*/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/*/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl missingFileHandler: Info prod: values: - ../values.yaml - - ../values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/*/values.yaml.gotmpl - - ../values/*/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/*/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl missingFileHandler: Info staging: values: - ../values.yaml - - ../values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/*/values.yaml.gotmpl - - ../values/*/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/*/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl missingFileHandler: Info diff --git a/helmfile.d/velero.yaml.gotmpl b/helmfile.d/helmfile.yaml.gotmpl similarity index 82% rename from helmfile.d/velero.yaml.gotmpl rename to helmfile.d/helmfile.yaml.gotmpl index 1e393669..35d2f69c 100644 --- a/helmfile.d/velero.yaml.gotmpl +++ b/helmfile.d/helmfile.yaml.gotmpl @@ -12,7 +12,7 @@ releases: - name: velero namespace: velero chart: velero/velero - version: 0.18.2 + version: 6.0.0 condition: velero.enabled values: - ../values/velero/values/velero.yaml.gotmpl @@ -27,13 +27,13 @@ releases: condition: velero.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/velero/values.yaml.gotmpl - - ../values/velero/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/velero/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true - command: ../bin/helmify + command: "../bin/helmify" args: - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' - '{{`{{ .Release.Chart }}`}}' diff --git a/justfile b/justfile index a3574ba1..386ad3ad 100644 --- a/justfile +++ b/justfile @@ -9,5 +9,5 @@ l HELMFILE ENV="default": # NOTE: Render a specifc helm chart r HELMFILE ENV="default": - helmfile --environment={{ENV}} template -q -f helmfile.d/{{HELMFILE}}.yaml.gotmpl --output-dir-template="../_manifests/{{HELMFILE}}/{{ENV}}/{{{{.Release.Name }}" - + helmfile --environment={{ENV}} template -q -f helmfile.d/{{HELMFILE}}.yaml.gotmpl --output-dir-template="../_manifests/{{HELMFILE}}/{{ENV}}" + # helmfile --environment={{ENV}} template -q -f helmfile.d/{{HELMFILE}}.yaml.gotmpl #--output-dir-template="../_manifests/{{HELMFILE}}/{{ENV}}/{{{{.Release.Name }}" diff --git a/shell.nix b/shell.nix index bb02e2ac..f364b352 100644 --- a/shell.nix +++ b/shell.nix @@ -28,7 +28,10 @@ pkgs.mkShellNoCC { helmWrap helmfileWrap helmfile-nix + + kubectl-cnpg + kubectl-neat ]; - CLUSTER_NAME = "oceanbox"; + ARGOCD_ENV_CLUSTER_NAME = "oceanbox"; } diff --git a/helmfile.d/argo.yaml.gotmpl b/temp/argo.yaml.gotmpl similarity index 100% rename from helmfile.d/argo.yaml.gotmpl rename to temp/argo.yaml.gotmpl diff --git a/helmfile.d/atlantis.yaml.gotmpl b/temp/atlantis.yaml.gotmpl similarity index 100% rename from helmfile.d/atlantis.yaml.gotmpl rename to temp/atlantis.yaml.gotmpl diff --git a/helmfile.d/cert-manager.yaml.gotmpl b/temp/cert-manager.yaml.gotmpl similarity index 79% rename from helmfile.d/cert-manager.yaml.gotmpl rename to temp/cert-manager.yaml.gotmpl index a55ed873..cdfd03a6 100644 --- a/helmfile.d/cert-manager.yaml.gotmpl +++ b/temp/cert-manager.yaml.gotmpl @@ -1,14 +1,19 @@ bases: - ../envs/environments.yaml.gotmpl +repositories: + - name: cert-manager + url: 'https://charts.jetstack.io' + commonLabels: tier: sys releases: - name: cert-manager - namespace: {{ .Environment.Name }}-cert-manager - chart: ../charts/cert-manager - condition: cert-manager.enabled + namespace: cert-manager + chart: cert-manager/cert-manager + version: 1.12.13 + condition: cert_manager.enabled values: - ../values/cert-manager/values/cert-manager.yaml.gotmpl - ../values/cert-manager/values/cert-manager-{{ .Environment.Name }}.yaml.gotmpl @@ -17,9 +22,9 @@ releases: - ../values/cert-manager/kustomize/{{ .Environment.Name }} missingFileHandler: Info - name: cert-manager-manifests - namespace: {{ .Environment.Name }}-cert-manager + namespace: cert-manager chart: _cert-manager-manifests - condition: cert-manager.enabled + condition: cert_manager.enabled missingFileHandler: Info values: - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml diff --git a/helmfile.d/cilium.yaml.gotmpl b/temp/cilium.yaml.gotmpl similarity index 100% rename from helmfile.d/cilium.yaml.gotmpl rename to temp/cilium.yaml.gotmpl diff --git a/helmfile.d/dapr.yaml.gotmpl b/temp/dapr.yaml.gotmpl similarity index 100% rename from helmfile.d/dapr.yaml.gotmpl rename to temp/dapr.yaml.gotmpl diff --git a/helmfile.d/geoserver.yaml.gotmpl b/temp/geoserver.yaml.gotmpl similarity index 100% rename from helmfile.d/geoserver.yaml.gotmpl rename to temp/geoserver.yaml.gotmpl diff --git a/helmfile.d/headscale.yaml.gotmpl b/temp/headscale.yaml.gotmpl similarity index 100% rename from helmfile.d/headscale.yaml.gotmpl rename to temp/headscale.yaml.gotmpl diff --git a/helmfile.d/ingress-nginx.yaml.gotmpl b/temp/ingress-nginx.yaml.gotmpl similarity index 100% rename from helmfile.d/ingress-nginx.yaml.gotmpl rename to temp/ingress-nginx.yaml.gotmpl diff --git a/helmfile.d/keycloak.yaml.gotmpl b/temp/keycloak.yaml.gotmpl similarity index 100% rename from helmfile.d/keycloak.yaml.gotmpl rename to temp/keycloak.yaml.gotmpl diff --git a/helmfile.d/kyverno.yaml.gotmpl b/temp/kyverno.yaml.gotmpl similarity index 98% rename from helmfile.d/kyverno.yaml.gotmpl rename to temp/kyverno.yaml.gotmpl index 4eb734f8..01ac3d5d 100644 --- a/helmfile.d/kyverno.yaml.gotmpl +++ b/temp/kyverno.yaml.gotmpl @@ -6,7 +6,7 @@ repositories: url: 'https://kyverno.github.io/kyverno/' commonLabels: - tier: system + tier: sys apiVersions: - monitoring.coreos.com/v1 diff --git a/helmfile.d/loki.yaml.gotmpl b/temp/loki.yaml.gotmpl similarity index 100% rename from helmfile.d/loki.yaml.gotmpl rename to temp/loki.yaml.gotmpl diff --git a/helmfile.d/metricsserver.yaml.gotmpl b/temp/metricsserver.yaml.gotmpl similarity index 78% rename from helmfile.d/metricsserver.yaml.gotmpl rename to temp/metricsserver.yaml.gotmpl index e583be45..3c7b2c23 100644 --- a/helmfile.d/metricsserver.yaml.gotmpl +++ b/temp/metricsserver.yaml.gotmpl @@ -1,14 +1,20 @@ bases: - ../envs/environments.yaml.gotmpl +repositories: + - name: metricsserver + url: 'https://kubernetes-sigs.github.io/metrics-server/' + + commonLabels: tier: sys releases: - name: metricsserver - namespace: {{ .Environment.Name }}-metricsserver - chart: ../charts/metricsserver - condition: metricsserver.enabled + namespace: kube-system + chart: metricsserver/metricsserver + version: 3.8.2 + condition: metrics_server.enabled values: - ../values/metricsserver/values/metricsserver.yaml.gotmpl - ../values/metricsserver/values/metricsserver-{{ .Environment.Name }}.yaml.gotmpl @@ -17,9 +23,9 @@ releases: - ../values/metricsserver/kustomize/{{ .Environment.Name }} missingFileHandler: Info - name: metricsserver-manifests - namespace: {{ .Environment.Name }}-metricsserver + namespace: kube-system chart: _metricsserver-manifests - condition: metricsserver.enabled + condition: metrics_server.enabled missingFileHandler: Info values: - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml diff --git a/temp/nfs-provisioner.yaml.gotmpl b/temp/nfs-provisioner.yaml.gotmpl new file mode 100644 index 00000000..4d4484f2 --- /dev/null +++ b/temp/nfs-provisioner.yaml.gotmpl @@ -0,0 +1,43 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: + - name: nfs-provisioner + url: 'https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/' + + +commonLabels: + tier: sys + +releases: +- name: nfs-provisioner + namespace: kube-system + chart: nfs-provisioner/nfs-subdir-external-provisioner + version: 4.0.13 + condition: nfs_provisioner.enabled + values: + - ../values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl + - ../values/nfs-provisioner/values/nfs-provisioner-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/nfs-provisioner/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: nfs-provisioner-manifests + namespace: kube-system + chart: _nfs-provisioner-manifests + condition: nfs_provisioner.enabled + missingFileHandler: Info + values: + - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/nfs-provisioner/values.yaml.gotmpl + - ../values/nfs-provisioner/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/nfs-provisioner/manifests + - _nfs-provisioner-manifests diff --git a/helmfile.d/nix/argo.gotmpl.nix b/temp/nix/argo.gotmpl.nix similarity index 100% rename from helmfile.d/nix/argo.gotmpl.nix rename to temp/nix/argo.gotmpl.nix diff --git a/helmfile.d/nix/helmfile.gotmpl.nix b/temp/nix/helmfile.gotmpl.nix similarity index 100% rename from helmfile.d/nix/helmfile.gotmpl.nix rename to temp/nix/helmfile.gotmpl.nix diff --git a/helmfile.d/openfga.yaml.gotmpl b/temp/openfga.yaml.gotmpl similarity index 100% rename from helmfile.d/openfga.yaml.gotmpl rename to temp/openfga.yaml.gotmpl diff --git a/helmfile.d/otel-collector.yaml.gotmpl b/temp/otel-collector.yaml.gotmpl similarity index 100% rename from helmfile.d/otel-collector.yaml.gotmpl rename to temp/otel-collector.yaml.gotmpl diff --git a/helmfile.d/plausible.yaml.gotmpl b/temp/plausible.yaml.gotmpl similarity index 100% rename from helmfile.d/plausible.yaml.gotmpl rename to temp/plausible.yaml.gotmpl diff --git a/helmfile.d/postgres-operator.yaml.gotmpl b/temp/postgres-operator.yaml.gotmpl similarity index 100% rename from helmfile.d/postgres-operator.yaml.gotmpl rename to temp/postgres-operator.yaml.gotmpl diff --git a/helmfile.d/prometheus.yaml.gotmpl b/temp/prometheus.yaml.gotmpl similarity index 100% rename from helmfile.d/prometheus.yaml.gotmpl rename to temp/prometheus.yaml.gotmpl diff --git a/helmfile.d/rabbitmq.yaml.gotmpl b/temp/rabbitmq.yaml.gotmpl similarity index 100% rename from helmfile.d/rabbitmq.yaml.gotmpl rename to temp/rabbitmq.yaml.gotmpl diff --git a/helmfile.d/redis.yaml.gotmpl b/temp/redis.yaml.gotmpl similarity index 100% rename from helmfile.d/redis.yaml.gotmpl rename to temp/redis.yaml.gotmpl diff --git a/helmfile.d/tempo.yaml.gotmpl b/temp/tempo.yaml.gotmpl similarity index 100% rename from helmfile.d/tempo.yaml.gotmpl rename to temp/tempo.yaml.gotmpl diff --git a/helmfile.d/wordpress.yaml.gotmpl b/temp/wordpress.yaml.gotmpl similarity index 100% rename from helmfile.d/wordpress.yaml.gotmpl rename to temp/wordpress.yaml.gotmpl diff --git a/helmfile.d/x509-exporter.yaml.gotmpl b/temp/x509-exporter.yaml.gotmpl similarity index 80% rename from helmfile.d/x509-exporter.yaml.gotmpl rename to temp/x509-exporter.yaml.gotmpl index f24ed025..de6ebb88 100644 --- a/helmfile.d/x509-exporter.yaml.gotmpl +++ b/temp/x509-exporter.yaml.gotmpl @@ -1,14 +1,18 @@ bases: - ../envs/environments.yaml.gotmpl +repositories: + - name: x509-exporter + url: 'https://charts.enix.io' + commonLabels: tier: sys releases: - name: x509-exporter - namespace: {{ .Environment.Name }}-x509-exporter - chart: ../charts/x509-exporter - condition: x509-exporter.enabled + namespace: x509-exporter + chart: x509-exporter/x509-certificate-exporter + condition: x509_exporter.enabled values: - ../values/x509-exporter/values/x509-exporter.yaml.gotmpl - ../values/x509-exporter/values/x509-exporter-{{ .Environment.Name }}.yaml.gotmpl @@ -17,9 +21,9 @@ releases: - ../values/x509-exporter/kustomize/{{ .Environment.Name }} missingFileHandler: Info - name: x509-exporter-manifests - namespace: {{ .Environment.Name }}-x509-exporter + namespace: x509-exporter chart: _x509-exporter-manifests - condition: x509-exporter.enabled + condition: x509_exporter.enabled missingFileHandler: Info values: - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml diff --git a/values/cert-manager/manifests/cert-manager.yaml b/values/cert-manager/manifests/cert-manager.yaml new file mode 100644 index 00000000..b75be7be --- /dev/null +++ b/values/cert-manager/manifests/cert-manager.yaml @@ -0,0 +1,38 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cert-manager + namespace: argocd + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: cert-manager + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/cert-manager + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + {{- if .Values.cert_manager.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +{{- end }} diff --git a/apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-api-server-to-cert-manager.yaml b/values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-api-server-to-cert-manager.yaml similarity index 100% rename from apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-api-server-to-cert-manager.yaml rename to values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-api-server-to-cert-manager.yaml diff --git a/apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-api-server.yaml b/values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml similarity index 100% rename from apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-api-server.yaml rename to values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml diff --git a/apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-prometheus-metrics.yaml b/values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml similarity index 100% rename from apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-prometheus-metrics.yaml rename to values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml diff --git a/apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-world-traffic.yaml b/values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-world-traffic.yaml similarity index 100% rename from apps/charts/sys-cilium-policies/templates/cert-manager/CiliumNetworkPolicy-allow-world-traffic.yaml rename to values/cert-manager/manifests/policies/CiliumNetworkPolicy-allow-world-traffic.yaml diff --git a/values/cert-manager/manifests/pre-cert-manager.yaml b/values/cert-manager/manifests/pre-cert-manager.yaml new file mode 100644 index 00000000..8d6a498a --- /dev/null +++ b/values/cert-manager/manifests/pre-cert-manager.yaml @@ -0,0 +1,225 @@ +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + name: letsencrypt-production +spec: + acme: + # The ACME server URL + server: https://acme-v02.api.letsencrypt.org/directory + # Email address used for ACME registration + email: {{ .Values.cluster_config.acme_email }} + # Name of a secret used to store the ACME account private key + privateKeySecretRef: + name: letsencrypt-production + solvers: + - http01: + ingress: + class: nginx +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + name: letsencrypt-staging +spec: + acme: + # The ACME server URL + server: https://acme-staging-v02.api.letsencrypt.org/directory + # Email address used for ACME registration + email: {{ .Values.cluster_config.acme_email }} + # Name of a secret used to store the ACME account private key + privateKeySecretRef: + name: letsencrypt-staging + solvers: + - http01: + ingress: + class: nginx +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + name: ca-issuer +spec: + ca: + secretName: cluster-ca +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + name: selfsigning-issuer +spec: + selfSigned: {} +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: front-proxy-client +subjects: + - kind: User + name: front-proxy-client + apiGroup: rbac.authorization.k8s.io +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: front-proxy-client +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: front-proxy-client +rules: +- apiGroups: + - "webhook.cert-manager.io" + resources: + - mutations + - validations + verbs: [ "*" ] +- apiGroups: + - metrics.k8s.io + resources: + - pods + - nodes + verbs: + - get + - list + - watch +--- + +{{ if .Values.cluster_config.initca }} + +# Pod to update certificates from master nodes +# only runs on control plane nodes (etcd) +# Mounts cert files rotatet by nixos service.mgr and uses it to update cert-manager secret +# Always create certs on initial creation, +# Otherwise, cert creation would not happen until cronJob runs +apiVersion: batch/v1 +kind: Job +metadata: + name: cert-create + namespace: cert-manager +spec: + backoffLimit: 1 + template: + metadata: + labels: + block-egress: "true" + annotations: + linkerd.io/inject: disabled + spec: + restartPolicy: Never + serviceAccountName: cert-secret-updater + securityContext: + runAsUser: 12000 + runAsGroup: 13000 + fsGroup: 10000 + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io + operator: In + values: + - control-plane + tolerations: + - key: unschedulable + value: "true" + effect: NoSchedule + containers: + - image: bitnami/kubectl:1.24 + name: kubectl + resources: {} + securityContext: + allowPrivilegeEscalation: false + command: + - "/bin/sh" + - -c + - /tmp/renew-certs/renew-certs.sh + volumeMounts: + - name: ca-pem + mountPath: /tmp/ca.pem + - name: ca-key-pem + mountPath: /tmp/ca-key.pem + - name: certs-script + mountPath: /tmp/renew-certs + volumes: + - name: ca-pem + hostPath: + path: {{.Values.cluster_config.initca}}/ca.pem + type: File + - name: ca-key-pem + hostPath: + path: {{.Values.cluster_config.initca}}/ca-key.pem + type: File + - name: certs-script + configMap: + name: renew-certs-script + defaultMode: 0755 +--- +apiVersion: v1 +data: + renew-certs.sh: | + #! /bin/bash + kubectl create secret tls -n cert-manager cluster-ca --cert=/tmp/ca.pem --key=/tmp/ca-key.pem --dry-run=client -o yaml > /tmp/new-secret.yaml + kubectl apply -f /tmp/new-secret.yaml +kind: ConfigMap +metadata: + name: renew-certs-script + namespace: cert-manager +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cert-secret-updater + namespace: cert-manager +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: cert-secret-updater-role + namespace: cert-manager +rules: +- apiGroups: + - "" + resourceNames: + - cluster-ca + resources: + - secrets + verbs: + - '*' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cert-secret-updater-rbinding + namespace: cert-manager +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: cert-secret-updater-role +subjects: +- kind: ServiceAccount + name: cert-secret-updater + namespace: cert-manager +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: default-deny-egress + namespace: cert-manager +spec: + podSelector: + matchLabels: + block-egress: "true" + policyTypes: + - Egress +--- +{{ end }} diff --git a/values/cert-manager/values.yaml.gotmpl b/values/cert-manager/values.yaml.gotmpl new file mode 100644 index 00000000..0df31c10 --- /dev/null +++ b/values/cert-manager/values.yaml.gotmpl @@ -0,0 +1,3 @@ +cert_manager: + enabled: true + autosync: true diff --git a/values/cert-manager/values/cert-manager.yaml.gotmpl b/values/cert-manager/values/cert-manager.yaml.gotmpl new file mode 100644 index 00000000..21ed315e --- /dev/null +++ b/values/cert-manager/values/cert-manager.yaml.gotmpl @@ -0,0 +1,5 @@ +installCRDs: true +enableCertificateOwnerRef: true +startupapicheck: + podAnnotations: + linkerd.io/inject: disabled diff --git a/apps/templates/resources/dashboards/ingress-nginx.yaml b/values/ingress-nginx/manifests/dashboards/ingress-nginx.yaml similarity index 100% rename from apps/templates/resources/dashboards/ingress-nginx.yaml rename to values/ingress-nginx/manifests/dashboards/ingress-nginx.yaml diff --git a/values/ingress-nginx/manifests/ingress-nginx.yaml b/values/ingress-nginx/manifests/ingress-nginx.yaml index 964437cb..7a12b854 100644 --- a/values/ingress-nginx/manifests/ingress-nginx.yaml +++ b/values/ingress-nginx/manifests/ingress-nginx.yaml @@ -21,6 +21,9 @@ spec: value: {{ .Values.clusterConfig.cluster }} project: sys syncPolicy: + managedNamespaceMetadata: + labels: + component: sys syncOptions: - ServerSideApply=true {{- if .Values.nginx.autosync }} diff --git a/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml new file mode 100644 index 00000000..4ffbbd8c --- /dev/null +++ b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-host-traffic + namespace: ingress-nginx +spec: + egress: + - toEntities: + - kube-apiserver + - host + endpointSelector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx diff --git a/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-hubble-traffic.yaml b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-hubble-traffic.yaml new file mode 100644 index 00000000..fa9ee953 --- /dev/null +++ b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-hubble-traffic.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-hubble-traffic + namespace: ingress-nginx +spec: + egress: + - toFQDNs: + - matchPattern: hubble.*.*.* + - matchPattern: hubble.*.*.*.* + endpointSelector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx diff --git a/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml new file mode 100644 index 00000000..98bbc402 --- /dev/null +++ b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml @@ -0,0 +1,17 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-prometheus-metrics + namespace: ingress-nginx +spec: + endpointSelector: + matchLabels: + app.kubernetes.io/instance: ingress-nginx + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: prometheus + - toPorts: + - ports: + - port: "9913" + protocol: TCP diff --git a/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-s3-traffic.yaml b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-s3-traffic.yaml new file mode 100644 index 00000000..b3bcc3d3 --- /dev/null +++ b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-s3-traffic.yaml @@ -0,0 +1,19 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-s3-traffic + namespace: ingress-nginx +spec: + egress: + - toCIDR: + - 10.139.2.10/32 + - toCIDR: + - 10.139.2.11/32 + - toCIDR: + - 10.139.2.20/32 + - toCIDR: + - 10.139.2.21/32 + endpointSelector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx diff --git a/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-world-to-ingress-nginx.yaml b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-world-to-ingress-nginx.yaml new file mode 100644 index 00000000..4ecbe4fa --- /dev/null +++ b/values/ingress-nginx/manifests/policies/CiliumNetworkPolicy-allow-world-to-ingress-nginx.yaml @@ -0,0 +1,19 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-world-to-ingress-nginx + namespace: ingress-nginx +spec: + endpointSelector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: ingress-nginx + ingress: + - fromEntities: + - world + - toPorts: + - ports: + - port: "80" + protocol: TCP + - port: "443" + protocol: TCP diff --git a/values/kyverno/kustomize/base/kustomization.yaml b/values/kyverno/kustomize/base/kustomization.yaml deleted file mode 100644 index 57f354b1..00000000 --- a/values/kyverno/kustomize/base/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - _manifest.yaml diff --git a/values/kyverno/kustomize/default/kustomization.yaml b/values/kyverno/kustomize/default/kustomization.yaml deleted file mode 100644 index 22967828..00000000 --- a/values/kyverno/kustomize/default/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -generatorOptions: - disableNameSuffixHash: true -resources: - - ../base diff --git a/values/kyverno/manifests/kyverno-cluster-admin.yaml b/values/kyverno/manifests/kyverno-cluster-admin.yaml new file mode 100644 index 00000000..5154ee58 --- /dev/null +++ b/values/kyverno/manifests/kyverno-cluster-admin.yaml @@ -0,0 +1,17 @@ +{{- if .Values.kyverno.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kyverno:generate-admin +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin +subjects: +- kind: ServiceAccount + name: kyverno + namespace: kyverno +- kind: ServiceAccount + name: kyverno-background-controller + namespace: kyverno +{{- end }} diff --git a/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml b/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml new file mode 100644 index 00000000..d52ee5c9 --- /dev/null +++ b/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml @@ -0,0 +1,15 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-api-server + namespace: kyverno +spec: + egress: + - toEntities: + - kube-apiserver + - toPorts: + - ports: + - port: "6443" + protocol: TCP + endpointSelector: + matchLabels: {} diff --git a/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml b/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml new file mode 100644 index 00000000..f547d4a5 --- /dev/null +++ b/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml @@ -0,0 +1,17 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-prometheus-metrics + namespace: kyverno +spec: + endpointSelector: + matchLabels: + app.kubernetes.io/instance: kyverno + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: prometheus + - toPorts: + - ports: + - port: "8000" + protocol: TCP diff --git a/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-kyverno.yaml b/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-kyverno.yaml new file mode 100644 index 00000000..5087fa86 --- /dev/null +++ b/values/kyverno/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-kyverno.yaml @@ -0,0 +1,12 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-remote-node-to-kyverno + namespace: kyverno +spec: + endpointSelector: + matchLabels: + app.kubernetes.io/instance: kyverno + ingress: + - fromEntities: + - remote-node diff --git a/values/kyverno/manifests/policies/sync-gitlab.yaml b/values/kyverno/manifests/policies/sync-gitlab.yaml new file mode 100644 index 00000000..35f7304f --- /dev/null +++ b/values/kyverno/manifests/policies/sync-gitlab.yaml @@ -0,0 +1,31 @@ +apiVersion: kyverno.io/v1 +kind: ClusterPolicy +metadata: + name: sync-gitlab-secret + annotations: + policies.kyverno.io/title: Sync Secrets + policies.kyverno.io/category: Sample + policies.kyverno.io/subject: Secret + policies.kyverno.io/description: >- + Secrets like registry credentials often need to exist in multiple + Namespaces so Pods there have access. Manually duplicating those Secrets + is time consuming and error prone. This policy will copy a + Secret called `regcred` which exists in the `default` Namespace to + new Namespaces when they are created. It will also push updates to + the copied Secrets should the source Secret be changed. +spec: + rules: + - name: sync-image-pull-secret + match: + resources: + kinds: + - Namespace + generate: + apiVersion: v1 + kind: Secret + name: regcred + namespace: "{{`{{request.object.metadata.name}}`}}" + synchronize: true + clone: + namespace: default + name: gitlab-pull-secret diff --git a/values/kyverno/manifests/policies/sync-regcred.yaml b/values/kyverno/manifests/policies/sync-regcred.yaml new file mode 100644 index 00000000..2ee8df33 --- /dev/null +++ b/values/kyverno/manifests/policies/sync-regcred.yaml @@ -0,0 +1,33 @@ +{{- if .Values.kyverno.enabled }} +apiVersion: kyverno.io/v1 +kind: ClusterPolicy +metadata: + name: sync-regcred-secret + annotations: + policies.kyverno.io/title: Sync Secrets + policies.kyverno.io/category: Sample + policies.kyverno.io/subject: Secret + policies.kyverno.io/description: >- + Secrets like registry credentials often need to exist in multiple + Namespaces so Pods there have access. Manually duplicating those Secrets + is time consuming and error prone. This policy will copy a + Secret called `regcred` which exists in the `default` Namespace to + new Namespaces when they are created. It will also push updates to + the copied Secrets should the source Secret be changed. +spec: + rules: + - name: sync-image-pull-secret + match: + resources: + kinds: + - Namespace + generate: + apiVersion: v1 + kind: Secret + name: regcred + namespace: "{{`{{request.object.metadata.name}}`}}" + synchronize: true + clone: + namespace: default + name: regcred +{{- end }} diff --git a/values/kyverno/manifests/policies/sync-s3-secret.yaml b/values/kyverno/manifests/policies/sync-s3-secret.yaml new file mode 100644 index 00000000..b1f1ea03 --- /dev/null +++ b/values/kyverno/manifests/policies/sync-s3-secret.yaml @@ -0,0 +1,33 @@ +{{- if .Values.kyverno.enabled }} +apiVersion: kyverno.io/v1 +kind: ClusterPolicy +metadata: + annotations: + policies.kyverno.io/description: 'This policy will sync the s3 secret in kube-system namespace across namespaces' + policies.kyverno.io/subject: Secret + policies.kyverno.io/title: Sync s3 Secrets + name: sync-s3-credentials +spec: + generateExistingOnPolicyUpdate: true + background: true + rules: + - generate: + apiVersion: v1 + clone: + name: s3-credentials + namespace: kube-system + kind: Secret + name: s3-credentials + namespace: '{{`{{request.object.metadata.name}}`}}' + synchronize: true + match: + resources: + kinds: + - Namespace + names: + - "velero" + - "loki" + - "tempo" + name: sync-s3-secret + validationFailureAction: audit +{{- end }} diff --git a/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml b/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml new file mode 100644 index 00000000..289f30de --- /dev/null +++ b/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml @@ -0,0 +1,73 @@ +{{- if .Values.kyverno.enabled }} +apiVersion: kyverno.io/v1 +kind: ClusterPolicy +metadata: + name: whitelist-internal-ingresses + annotations: + policies.kyverno.io/title: Concatenate Ingresss + policies.kyverno.io/category: Other + policies.kyverno.io/severity: medium + policies.kyverno.io/subject: Ingress + policies.kyverno.io/description: >- + Ingresses with the label "internal=true" should be whitelisted. + If no whitelist exists, add the default values, otherwise append + whitelist to the already existing ones +spec: + mutateExistingOnPolicyUpdate: false + #precondition: has whitelist annotation or + rules: + - name: ensure-nginx-whitelist-exists + match: + resources: + kinds: + - Ingress + selector: + matchLabels: + internal: "true" + mutate: + patchStrategicMerge: + metadata: + annotations: + +(nginx.ingress.kubernetes.io/whitelist-source-range): "" + - name: append-existing-whitelist + match: + resources: + kinds: + - Ingress + selector: + matchLabels: + internal: "true" + preconditions: + any: + - key: "{{`{{request.object.metadata.annotations.\"nginx.ingress.kubernetes.io/whitelist-source-range\"}}`}}" + operator: NotEquals + value: "" + mutate: + patchStrategicMerge: + metadata: + annotations: + {{- with .Values.cluster_config.ingress_whitelist_ips }} + nginx.ingress.kubernetes.io/whitelist-source-range: "{{`{{ @ }}`}},{{ join "," . }}" + {{- end }} + - name: add-nginx-whitelist + match: + resources: + kinds: + - Ingress + selector: + matchLabels: + internal: "true" + preconditions: + any: + - key: "{{`{{request.object.metadata.annotations.\"nginx.ingress.kubernetes.io/whitelist-source-range\"}}`}}" + operator: Equals + value: "" + mutate: + patchStrategicMerge: + metadata: + annotations: + {{- with .Values.cluster_config.ingress_whitelist_ips }} + nginx.ingress.kubernetes.io/whitelist-source-range: "{{ join "," . }}" + {{- end }} +{{- end }} + diff --git a/values/metricsserver/manifests/metricsserver.yaml b/values/metricsserver/manifests/metricsserver.yaml new file mode 100644 index 00000000..0a72c1df --- /dev/null +++ b/values/metricsserver/manifests/metricsserver.yaml @@ -0,0 +1,36 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: metricsserver + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: kube-system + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/metricsserver + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + {{- if .Values.metrics_server.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +{{- end }} diff --git a/values/metricsserver/values.yaml.gotmpl b/values/metricsserver/values.yaml.gotmpl new file mode 100644 index 00000000..e71a5877 --- /dev/null +++ b/values/metricsserver/values.yaml.gotmpl @@ -0,0 +1,4 @@ +metricsserver: + enabled: true + autosync: true + ignoreTLS: false \ No newline at end of file diff --git a/values/metricsserver/values/metricsserver.yaml.gotmpl b/values/metricsserver/values/metricsserver.yaml.gotmpl new file mode 100644 index 00000000..deaaa3e4 --- /dev/null +++ b/values/metricsserver/values/metricsserver.yaml.gotmpl @@ -0,0 +1,9 @@ +containerPort: 10250 +resources: + requests: + cpu: 100m + memory: 200Mi +{{- if .Values.metrics_server.ignoreTLS }} +args: + - "--kubelet-insecure-tls" +{{- end }} \ No newline at end of file diff --git a/values/nfs-provisioner/manifests/nfs-provisioner.yaml b/values/nfs-provisioner/manifests/nfs-provisioner.yaml new file mode 100644 index 00000000..63fa319a --- /dev/null +++ b/values/nfs-provisioner/manifests/nfs-provisioner.yaml @@ -0,0 +1,38 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: nfs-provisioner + namespace: argocd + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: kube-system + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfiles/nfs-provisioner + plugin: + name: helmfile + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # - ServerSideApply=true + {{- if .Values.nfs_provisioner.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +{{- end }} diff --git a/values/nfs-provisioner/values.yaml.gotmpl b/values/nfs-provisioner/values.yaml.gotmpl new file mode 100644 index 00000000..17ed8833 --- /dev/null +++ b/values/nfs-provisioner/values.yaml.gotmpl @@ -0,0 +1,6 @@ +nfs_provisioner: + enabled: true + autosync: true + archiveOnDelete: true + defaultClass: true + extraMountOpts: [] diff --git a/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl b/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl new file mode 100644 index 00000000..2f3e33fe --- /dev/null +++ b/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl @@ -0,0 +1,16 @@ +nfs: + server: {{ .Values.cluster_config.fileserver }} + path: /{{ default (.Values.clusterConfig.cluster) .Values.nfs_provisioner.path }} + mountOptions: + - nfsvers=4.2 + {{- range .Values.nfs_provisioner.extraMountOpts }} + - {{ . }} + {{- end }} +storageClass: + defaultClass: {{ .Values.nfs_provisioner.defaultClass}} + name: managed-nfs-storage + archiveOnDelete: {{ .Values.nfs_provisioner.archiveOnDelete }} +tolerations: + - key: unschedulable + operator: Exists + effect: NoSchedule \ No newline at end of file diff --git a/values/postgres-operator/kustomize/base/kustomization.yaml b/values/postgres-operator/kustomize/base/kustomization.yaml deleted file mode 100644 index 57f354b1..00000000 --- a/values/postgres-operator/kustomize/base/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - _manifest.yaml diff --git a/values/postgres-operator/kustomize/default/kustomization.yaml b/values/postgres-operator/kustomize/default/kustomization.yaml deleted file mode 100644 index 22967828..00000000 --- a/values/postgres-operator/kustomize/default/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -generatorOptions: - disableNameSuffixHash: true -resources: - - ../base diff --git a/values/postgres-operator/manifests/dashboards/cnpg-postgres.yaml b/values/postgres-operator/manifests/dashboards/cnpg-postgres.yaml new file mode 100644 index 00000000..0b2b5007 --- /dev/null +++ b/values/postgres-operator/manifests/dashboards/cnpg-postgres.yaml @@ -0,0 +1,3908 @@ +{{- if .Values.postgres_operator.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: cnpg-dashboard + namespace: prometheus + labels: + grafana_dashboard: "1" + app.kubernetes.io/instance: prometheus-community + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: grafana + app.kubernetes.io/version: 9.1.7 + helm.sh/chart: grafana-6.40.4 +data: + cnp.json: |- + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": null, + "graphTooltip": 0, + "iteration": 1637064390546, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 12, + "panels": [], + "title": "Server Health", + "type": "row" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 0, + "y": 1 + }, + "id": 191, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Instance", + "transparent": true, + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 2, + "x": 3, + "y": 1 + }, + "id": 192, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Status", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 4, + "x": 5, + "y": 1 + }, + "id": 193, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Clustering / replicas", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 5, + "x": 9, + "y": 1 + }, + "id": 195, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Connections", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 14, + "y": 1 + }, + "id": 196, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Max Connections", + "type": "text" + }, + { + "datasource": "${DataSource}", + "description": "", + "gridPos": { + "h": 1, + "w": 3, + "x": 17, + "y": 1 + }, + "id": 197, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Wraparound", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 2, + "x": 20, + "y": 1 + }, + "id": 313, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Started", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 2, + "x": 22, + "y": 1 + }, + "id": 198, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Server Version", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 3, + "w": 3, + "x": 0, + "y": 2 + }, + "id": 61, + "options": { + "content": "\n \n

$instances

\n
", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "text" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "index": 0, + "text": "Down" + }, + "1": { + "index": 1, + "text": "Up" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 3, + "y": 2 + }, + "id": 33, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "red", + "index": 1, + "text": "No" + }, + "1": { + "color": "green", + "index": 0, + "text": "Yes" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 5, + "y": 2 + }, + "id": 60, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "1 - cnpg_pg_replication_in_recovery{namespace=~\"$namespace\",pod=~\"$instances\"} + cnpg_pg_replication_is_wal_receiver_up{namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "transformations": [], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 7, + "y": 2 + }, + "id": 229, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_replication_streaming_replicas{namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "transformations": [], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 9, + "y": 2 + }, + "id": 58, + "options": { + "legend": { + "calcs": [ + "last", + "mean" + ], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "sum by (pod) (cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"})", + "instant": false, + "interval": "", + "legendFormat": "-", + "refId": "A" + } + ], + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "max": 100, + "noValue": "<1%", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 75 + }, + { + "color": "red", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 14, + "y": 2 + }, + "id": 32, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "100 * sum by (pod) (cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"}) / sum by (pod) (cnpg_pg_settings_setting{name=\"max_connections\",namespace=~\"$namespace\",pod=~\"$instances\"})", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "gauge" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 2147483647, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 200000000 + }, + { + "color": "red", + "value": 1000000000 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 17, + "y": 2 + }, + "id": 8, + "options": { + "displayMode": "lcd", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "text": {} + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "max by (pod) (cnpg_pg_database_xid_age{namespace=~\"$namespace\",pod=~\"$instances\"})", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "bargauge" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-blue", + "value": null + } + ] + }, + "unit": "dateTimeFromNow" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 20, + "y": 2 + }, + "id": 314, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": false, + "expr": "cnpg_pg_postmaster_start_time{namespace=~\"$namespace\",pod=~\"$instances\"}*1000", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "transformations": [], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-blue", + "value": null + } + ] + }, + "unit": "string" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 22, + "y": 2 + }, + "id": 42, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": false, + "expr": "cnpg_collector_postgres_version{namespace=~\"$namespace\",pod=~\"$instances\"}", + "format": "time_series", + "hide": false, + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "transformations": [], + "type": "stat" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 41, + "panels": [ + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 0, + "y": 6 + }, + "id": 187, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Instance", + "transparent": true, + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 3, + "y": 6 + }, + "id": 183, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Max Connections", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 6, + "y": 6 + }, + "id": 184, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Shared Buffers", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 9, + "y": 6 + }, + "id": 185, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Effective Cache Size", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 12, + "y": 6 + }, + "id": 186, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Work Mem", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 15, + "y": 6 + }, + "id": 188, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Maintenance Work Mem", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 18, + "y": 6 + }, + "id": 189, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Random Page Cost", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 3, + "x": 21, + "y": 6 + }, + "id": 190, + "options": { + "content": "", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Sequential Page Cost", + "type": "text" + }, + { + "datasource": "${DataSource}", + "gridPos": { + "h": 3, + "w": 3, + "x": 0, + "y": 7 + }, + "id": 86, + "options": { + "content": "\n \n

$instances

\n
", + "mode": "html" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "kube_pod_container_status_ready{container=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "text" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 3, + "y": 7 + }, + "id": 30, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{name=\"max_connections\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 7 + }, + "id": 24, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "max by (pod) (cnpg_pg_settings_setting{name=\"shared_buffers\",namespace=~\"$namespace\",pod=~\"$instances\"}) * max by (pod) (cnpg_pg_settings_setting{name=\"block_size\",namespace=~\"$namespace\",pod=~\"$instances\"})", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 7 + }, + "id": 57, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{name=\"effective_cache_size\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 7 + }, + "id": 26, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{name=\"work_mem\",namespace=~\"$namespace\",pod=~\"$instances\"} * 1024", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 7 + }, + "id": 47, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{name=\"maintenance_work_mem\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 7 + }, + "id": 48, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{name=\"random_page_cost\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 21, + "y": 7 + }, + "id": 56, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.2.1", + "repeat": "instances", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{name=\"seq_page_cost\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "type": "stat" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-purple", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 150, + "options": { + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "parameter" + } + ] + }, + "pluginVersion": "8.2.1", + "repeatDirection": "v", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_settings_setting{namespace=~\"$namespace\",pod=~\"$instances\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Configurations", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "container": true, + "endpoint": true, + "instance": true, + "job": true, + "name": false, + "namespace": true, + "pod": false + }, + "indexByName": { + "Time": 0, + "Value": 9, + "__name__": 1, + "container": 2, + "endpoint": 3, + "instance": 4, + "job": 5, + "name": 7, + "namespace": 8, + "pod": 6 + }, + "renameByName": { + "__name__": "", + "name": "parameter" + } + } + } + ], + "type": "table" + } + ], + "title": "Configuration", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 10, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DataSource}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 273, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.2.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "exemplar": true, + "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{pod=~\"$instances\", namespace=~\"$namespace\"}) by (pod)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{`{{pod}}`}}", + "legendLink": null, + "refId": "A", + "step": 10 + }, + { + "exemplar": true, + "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{pod=~\"$instances\", namespace=~\"$namespace\"})", + "hide": false, + "interval": "", + "legendFormat": "total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU Usage", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:189", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "$$hashKey": "object:190", + "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": "${DataSource}", + "fill": 2, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 7 + }, + "hiddenSeries": false, + "id": 275, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.2.1", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "quota - requests", + "color": "#F2495C", + "dashes": true, + "fill": 0, + "hiddenSeries": true, + "hideTooltip": true, + "legend": true, + "linewidth": 2, + "stack": false + }, + { + "alias": "quota - limits", + "color": "#FF9830", + "dashes": true, + "fill": 0, + "hiddenSeries": true, + "hideTooltip": true, + "legend": true, + "linewidth": 2, + "stack": false + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{pod=~\"$instances\", namespace=\"$namespace\", container!=\"\", image!=\"\"}) by (pod)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{`{{pod}}`}}", + "legendLink": null, + "refId": "A", + "step": 10 + }, + { + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{pod=~\"$instances\", namespace=\"$namespace\", container!=\"\", image!=\"\"})", + "hide": false, + "interval": "", + "legendFormat": "total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Memory Usage (w/o cache)", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:246", + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "$$hashKey": "object:247", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 39, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "sum(cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"}) by (pod)", + "hide": false, + "interval": "", + "legendFormat": "total ({{`{{pod}}`}})", + "refId": "B" + }, + { + "exemplar": true, + "expr": "sum(cnpg_backends_total{namespace=~\"$namespace\",pod=~\"$instances\"}) by (state, pod)", + "interval": "", + "legendFormat": "{{`{{state}}`}} ({{`{{pod}}`}})", + "refId": "A" + } + ], + "title": "Session States", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "sum(rate(cnpg_pg_stat_database_xact_commit{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])) by (pod)", + "interval": "", + "legendFormat": "committed ({{`{{pod}}`}})", + "refId": "A" + }, + { + "exemplar": true, + "expr": "sum(rate(cnpg_pg_stat_database_xact_rollback{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])) by (pod)", + "hide": false, + "interval": "", + "legendFormat": "rolled back ({{`{{pod}}`}})", + "refId": "B" + } + ], + "title": "Transactions [5m]", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 22 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "max by (pod) (cnpg_backends_max_tx_duration_seconds{namespace=~\"$namespace\",pod=~\"$instances\"})", + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Longest Transaction", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 55, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_deadlocks{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "count ({{`{{pod}}`}})", + "refId": "B" + } + ], + "title": "Deadlocks [5m]", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 54, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_backends_waiting_total{namespace=~\"$namespace\",pod=~\"$instances\"}", + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Blocked Queries", + "type": "timeseries" + } + ], + "title": "Operational Stats", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 35, + "panels": [ + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 35 + }, + "id": 44, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_tup_deleted{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "interval": "", + "legendFormat": "deleted ({{`{{pod}}`}})", + "refId": "A" + }, + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_tup_inserted{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "interval": "", + "legendFormat": "inserted ({{`{{pod}}`}})", + "refId": "B" + }, + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_tup_fetched{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "interval": "", + "legendFormat": "fetched ({{`{{pod}}`}})", + "refId": "C" + }, + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_tup_returned{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "interval": "", + "legendFormat": "returned ({{`{{pod}}`}})", + "refId": "D" + }, + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_tup_updated{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "interval": "", + "legendFormat": "updated ({{`{{pod}}`}})", + "refId": "E" + } + ], + "title": "Tuple I/O [5m]", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 35 + }, + "id": 46, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_blks_hit{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "interval": "", + "legendFormat": "hit ({{`{{pod}}`}})", + "refId": "A" + }, + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_blks_read{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "interval": "", + "legendFormat": "read ({{`{{pod}}`}})", + "refId": "B" + } + ], + "title": "Block I/O [5m]", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 22, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "pluginVersion": "8.0.5", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_database_size_bytes{datname!~\"template.*\",datname!=\"postgres\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "interval": "", + "legendFormat": " {{`{{pod}}`}}: {{`{{datname}}`}}", + "refId": "A" + } + ], + "title": "Database Size", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_database_temp_bytes{datname=\"\",namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "instant": false, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Temp Bytes [5m]", + "type": "timeseries" + } + ], + "title": "Storage & I/O", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 37, + "panels": [ + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 53 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_collector_pg_wal_archive_status{value=\"ready\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "interval": "", + "legendFormat": "ready ({{`{{pod}}`}})", + "refId": "A" + }, + { + "exemplar": true, + "expr": "cnpg_collector_pg_wal_archive_status{value=\"done\",namespace=~\"$namespace\",pod=~\"$instances\"}", + "hide": false, + "interval": "", + "legendFormat": "done ({{`{{pod}}`}})", + "refId": "B" + } + ], + "title": "WAL Segment Archive Status", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 53 + }, + "id": 52, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_archiver_archived_count{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "interval": "", + "legendFormat": "archived ({{`{{pod}}`}})", + "refId": "A" + }, + { + "exemplar": true, + "expr": "rate(cnpg_pg_stat_archiver_failed_count{namespace=~\"$namespace\",pod=~\"$instances\"}[5m])", + "hide": false, + "interval": "", + "legendFormat": "failed ({{`{{pod}}`}})", + "refId": "B" + } + ], + "title": "Archiver Status [5m]", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 53 + }, + "id": 53, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_stat_archiver_seconds_since_last_archival{namespace=~\"$namespace\",pod=~\"$instances\"}", + "interval": "", + "legendFormat": "age ({{`{{pod}}`}})", + "refId": "A" + } + ], + "title": "Last Archive Age", + "type": "timeseries" + } + ], + "title": "Write Ahead Log", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 18, + "panels": [ + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "line" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 600 + }, + { + "color": "dark-red", + "value": 3600 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 6 + }, + "id": 16, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_replication_lag{namespace=~\"$namespace\",pod=~\"$instances\"}", + "instant": false, + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Replication Lag", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 6 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_stat_replication_write_lag_seconds{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}", + "instant": false, + "interval": "", + "legendFormat": "{{`{{pod}}`}} -> {{`{{application_name}}`}}", + "refId": "A" + } + ], + "title": "Write Lag", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 6 + }, + "id": 59, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_stat_replication_flush_lag_seconds{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}", + "instant": false, + "interval": "", + "legendFormat": "{{`{{pod}}`}} -> {{`{{application_name}}`}}", + "refId": "A" + } + ], + "title": "Flush Lag", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 6 + }, + "id": 20, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_stat_replication_replay_lag_seconds{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}", + "interval": "", + "legendFormat": "{{`{{pod}}`}} -> {{`{{application_name}}`}}", + "refId": "A" + } + ], + "title": "Replay Lag", + "type": "timeseries" + } + ], + "title": "Replication", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 231, + "panels": [ + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateOranges", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "timeseries", + "datasource": "${DataSource}", + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 63 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 233, + "legend": { + "show": false + }, + "reverseYBuckets": false, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_collector_collection_duration_seconds{namespace=~\"$namespace\",pod=~\"$instances\"}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Collection Duration", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + }, + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 63 + }, + "id": 235, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_collector_last_collection_error{namespace=~\"$namespace\",pod=~\"$instances\"}", + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Errors", + "type": "timeseries" + } + ], + "title": "Collector Stats", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 17 + }, + "id": 239, + "panels": [ + { + "datasource": "${DataSource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dateTimeAsIso" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 72 + }, + "id": 237, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "cnpg_collector_first_recoverability_point{namespace=~\"$namespace\",pod=~\"$instances\"}*1000 > 0", + "format": "time_series", + "interval": "", + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "First Recoverability Point", + "type": "timeseries" + } + ], + "title": "Backups", + "type": "row" + }, + { + "collapsed": true, + "datasource": "${DataSource}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 293, + "panels": [ + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 8, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 0, + "y": 79 + }, + "id": 295, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "pluginVersion": "8.2.1", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_stat_bgwriter_checkpoints_req{namespace=~\"$namespace\",pod=~\"$instances\"}", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "req/{{`{{pod}}`}}", + "refId": "B" + }, + { + "exemplar": true, + "expr": "cnpg_pg_stat_bgwriter_checkpoints_timed{namespace=~\"$namespace\",pod=~\"$instances\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "timed/{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Requested/Timed", + "type": "timeseries" + }, + { + "datasource": "${DataSource}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 8, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 5, + "y": 79 + }, + "id": 296, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "pluginVersion": "8.2.1", + "targets": [ + { + "exemplar": true, + "expr": "cnpg_pg_stat_bgwriter_checkpoint_write_time{namespace=~\"$namespace\",pod=~\"$instances\"}", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "write/{{`{{pod}}`}}", + "refId": "B" + }, + { + "exemplar": true, + "expr": "cnpg_pg_stat_bgwriter_checkpoint_sync_time{namespace=~\"$namespace\",pod=~\"$instances\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "sync/{{`{{pod}}`}}", + "refId": "A" + } + ], + "title": "Write/Sync time", + "type": "timeseries" + } + ], + "title": "Checkpoints", + "type": "row" + } + ], + "refresh": "30s", + "schemaVersion": 31, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "DataSource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "default", + "value": "default" + }, + "datasource": "${DataSource}", + "definition": "cnpg_collector_up", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "namespace", + "options": [], + "query": { + "query": "cnpg_collector_up", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/namespace=\"(?[^\"]+)/g", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "cnp-sandbox", + "value": "cnp-sandbox" + }, + "datasource": "${DataSource}", + "definition": "cnpg_collector_up{namespace=~\"$namespace\"}", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "query": "cnpg_collector_up{namespace=~\"$namespace\"}", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/cluster=\"(?[^\"]+)/g", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": "${DataSource}", + "definition": "cnpg_collector_up{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "instances", + "options": [], + "query": { + "query": "cnpg_collector_up{namespace=~\"$namespace\",pod=~\"$cluster-.*\"}", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/pod=\"(?[^\"]+)/g", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "nowDelay": "" + }, + "timezone": "", + "title": "CloudNativePG", + "uid": "z7FCA4Nnk", + "version": 2 + } +{{- end }} diff --git a/values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml b/values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml new file mode 100644 index 00000000..d32ac553 --- /dev/null +++ b/values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml @@ -0,0 +1,16 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-api-server + namespace: cnpg +spec: + egress: + - toEntities: + - kube-apiserver + toPorts: + - ports: + - port: "6443" + protocol: TCP + endpointSelector: + matchLabels: + app.kubernetes.io/instance: postgres-operator diff --git a/values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-remote-node-webhooks.yaml b/values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-remote-node-webhooks.yaml new file mode 100644 index 00000000..6c04cc22 --- /dev/null +++ b/values/postgres-operator/manifests/policies/CiliumNetworkPolicy-allow-remote-node-webhooks.yaml @@ -0,0 +1,15 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-remote-node-webhooks + namespace: cnpg +spec: + endpointSelector: + matchLabels: {} + ingress: + - fromEntities: + - kube-apiserver + - toPorts: + - ports: + - port: "9443" + protocol: TCP diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alerting.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alerting.yaml new file mode 100644 index 00000000..e092cb26 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alerting.yaml @@ -0,0 +1,13 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-alerting + namespace: prometheus +spec: + description: Allow alerting + egress: + - toEntities: + - world + endpointSelector: + matchLabels: + app.kubernetes.io/instance: prom-alertmanager diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alertmanager-ingress.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alertmanager-ingress.yaml new file mode 100644 index 00000000..b6f96e64 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-alertmanager-ingress.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-alertmanager-ingress + namespace: prometheus +spec: + description: Allow Nginx ingress + endpointSelector: + matchLabels: + app.kubernetes.io/name: alertmanager + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: ingress-nginx diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-dns-metrics.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-dns-metrics.yaml new file mode 100644 index 00000000..0ee91e6e --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-dns-metrics.yaml @@ -0,0 +1,15 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-dns-metrics + namespace: prometheus +spec: + description: Allow DNS metrics + egress: + - toPorts: + - ports: + - port: "9153" + protocol: TCP + endpointSelector: + matchLabels: + app.kubernetes.io/name: prometheus diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-etcd-metrics.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-etcd-metrics.yaml new file mode 100644 index 00000000..90ac789e --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-etcd-metrics.yaml @@ -0,0 +1,15 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-etcd-metrics + namespace: prometheus +spec: + description: Allow ETCD metrics + egress: + - toPorts: + - ports: + - port: "2379" + protocol: TCP + endpointSelector: + matchLabels: + app.kubernetes.io/name: prometheus diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-ingress.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-ingress.yaml new file mode 100644 index 00000000..fca3baf2 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-ingress.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-grafana-ingress + namespace: prometheus +spec: + description: Allow Grafana ingress + endpointSelector: + matchLabels: + app.kubernetes.io/name: grafana + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: ingress-nginx diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-oidc-login.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-oidc-login.yaml new file mode 100644 index 00000000..ed2084fe --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-oidc-login.yaml @@ -0,0 +1,16 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-grafana-oidc-login + namespace: prometheus +spec: + description: Allow Grafana OIDC login + egress: + - toFQDNs: + - matchName: login.microsoftonline.com + - matchPattern: '*.microsoftonline.com' + - matchName: api.github.com + - matchName: github.com + endpointSelector: + matchLabels: + app.kubernetes.io/name: grafana diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-plugins.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-plugins.yaml new file mode 100644 index 00000000..60721c6a --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-plugins.yaml @@ -0,0 +1,15 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-grafana-plugins + namespace: prometheus +spec: + description: Allow Grafana Plugins + egress: + - toFQDNs: + - matchName: grafana.com + - matchName: storage.googleapis.com + - matchName: raw.githubusercontent.com + endpointSelector: + matchLabels: + app.kubernetes.io/name: grafana diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-secure-gravatar.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-secure-gravatar.yaml new file mode 100644 index 00000000..453c2330 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-grafana-secure-gravatar.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-grafana-secure-gravatar + namespace: prometheus +spec: + description: Allow Grafana Secure Gravatar + egress: + - toFQDNs: + - matchName: secure.grafana.com + - matchName: secure.gravatar.com + endpointSelector: + matchLabels: + app.kubernetes.io/name: grafana diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml new file mode 100644 index 00000000..bb3a591a --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-host-traffic.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-host-traffic + namespace: prometheus +spec: + description: Allow Host Traffic + egress: + - toEntities: + - remote-node + - host + - kube-apiserver + endpointSelector: + matchLabels: {} diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-nginx-ingress.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-nginx-ingress.yaml new file mode 100644 index 00000000..ac650e55 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-nginx-ingress.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-nginx-ingress + namespace: prometheus +spec: + description: Allow Nginx ingress + endpointSelector: + matchLabels: + app.kubernetes.io/name: prometheus + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: ingress-nginx diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-opencost-scrape.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-opencost-scrape.yaml new file mode 100644 index 00000000..4b7bd679 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-opencost-scrape.yaml @@ -0,0 +1,19 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-opencost-scrape + namespace: prometheus +spec: + description: Allow OpenCost scrape + endpointSelector: + matchLabels: + app.kubernetes.io/name: prometheus + ingress: + - fromEndpoints: + - matchLabels: + app.kubernetes.io/name: opencost + io.kubernetes.pod.namespace: opencost + - toPorts: + - ports: + - port: "9090" + protocol: TCP diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-metrics-server.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-metrics-server.yaml new file mode 100644 index 00000000..0603da13 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-metrics-server.yaml @@ -0,0 +1,13 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-remote-node-to-metrics-server + namespace: prometheus +spec: + description: Allow Remote Metrics Server + endpointSelector: + matchLabels: + app.kubernetes.io/instance: metrics-server + ingress: + - fromEntities: + - remote-node diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-webhook.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-webhook.yaml new file mode 100644 index 00000000..eeabfcbd --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-remote-node-to-webhook.yaml @@ -0,0 +1,13 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-remote-node-to-webhook + namespace: prometheus +spec: + description: Allow Remote Web Hook + endpointSelector: + matchLabels: + app: kube-prometheus-stack-operator + ingress: + - fromEntities: + - remote-node diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-robusta-ingress.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-robusta-ingress.yaml new file mode 100644 index 00000000..c1856c3f --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-robusta-ingress.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-robusta-ingress + namespace: prometheus +spec: + description: Allow Robusta ingress + endpointSelector: + matchLabels: + app.kubernetes.io/name: prom-prometheus + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: robusta diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-stats-grafana.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-stats-grafana.yaml new file mode 100644 index 00000000..5d1ed102 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-stats-grafana.yaml @@ -0,0 +1,13 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-stats-grafana + namespace: prometheus +spec: + description: Allow stats + egress: + - toFQDNs: + - matchName: stats.grafana.org + endpointSelector: + matchLabels: + app.kubernetes.io/name: grafana diff --git a/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml b/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml new file mode 100644 index 00000000..0bb56a35 --- /dev/null +++ b/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml @@ -0,0 +1,32 @@ +{{- if and (.Values.kyverno.enabled) (.Values.prometheus.enabled) }} +apiVersion: kyverno.io/v1 +kind: Policy +metadata: + name: prometheus-stack-default-dashboard-folder + namespace: prometheus +spec: + admission: true + background: true + mutateExistingOnPolicyUpdate: true + rules: + - match: + any: + - resources: + kinds: + - ConfigMap + selector: + matchLabels: + app.kubernetes.io/part-of: kube-prometheus-stack + mutate: + patchStrategicMerge: + metadata: + annotations: + grafana_folder: Prometheus-stack + targets: + - apiVersion: v1 + kind: ConfigMap + name: "{{`{{ request.object.metadata.name }}`}}" + name: generate-dashboard-folder-annotation + skipBackgroundRequests: true + validationFailureAction: Audit +{{- end }} diff --git a/values/prometheus/manifests/prometheus.yaml b/values/prometheus/manifests/prometheus.yaml index 00f95320..93f610ee 100644 --- a/values/prometheus/manifests/prometheus.yaml +++ b/values/prometheus/manifests/prometheus.yaml @@ -11,7 +11,7 @@ spec: sources: - repoURL: {{ .Values.clusterConfig.manifests }} targetRevision: HEAD - path: helmfiles/cilium + path: helmfiles/prometheus plugin: name: helmfile env: @@ -19,6 +19,9 @@ spec: value: {{ .Values.clusterConfig.cluster }} project: sys syncPolicy: + managedNamespaceMetadata: + labels: + component: sys syncOptions: - ServerSideApply=true {{- if .Values.prometheus.autosync }} diff --git a/values/prometheus/values.yaml.gotmpl b/values/prometheus/values.yaml.gotmpl index 6163164c..9cfc35ba 100644 --- a/values/prometheus/values.yaml.gotmpl +++ b/values/prometheus/values.yaml.gotmpl @@ -1,32 +1,35 @@ -cilium: - enabled: false +prometheus: + enabled: true autosync: true - spire: + # Helm chart version, and app version is different. CRD version MUST be equals to chart's APP version + crd_version: 14.0.0 + certRenewCronEnabled: true + snitchUrl: "" + oncallUrl: "" + pagerdutyRoutingKey: "" + fullname: "" + # https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L47 + defaultRules: {} + additionalScrapeConfigs: [] + additionalDataSources: [] + enableFeatures: [] + storage: + size: 50Gi + grafana: + defaultDashboardsEnabled: true + persistence: false + disable_login_form: true + plugins: [] + coredns: + targetPort: "" + etcd: + targetPort: "" + scheduler: + targetPort: "" + kubelet: enabled: false - envoy: + https: false + thanos: enabled: false - hubble: - ui: true - enabled: false - encryption: - enabled: true - type: wireguard - kubeProxyReplacement: true - l2announcement: - enabled: false - nodePort: - enabled: false - gatewayAPI: - enabled: false - ingressController: - enabled: false - defaultClass: false - loadbalancerMode: shared - policyAuditMode: false - upgradeCompatability: 1.15 - k8sServiceHost: localhost - k8sServicePort: 7445 - loadbalancerPool: - enabled: false - cidr: [] - + datasource: + enabled: false \ No newline at end of file diff --git a/values/values-oceanbox.yaml b/values/values-oceanbox.yaml index 4e2d2d2d..7b2b8369 100644 --- a/values/values-oceanbox.yaml +++ b/values/values-oceanbox.yaml @@ -1,4 +1,5 @@ clusterConfig: + manifests: https://gitlab.com/oceanbox/manifests.git argo: enabled: true env: "prod" diff --git a/values/velero/kustomize/base/kustomization.yaml b/values/velero/kustomize/base/kustomization.yaml deleted file mode 100644 index 57f354b1..00000000 --- a/values/velero/kustomize/base/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - _manifest.yaml diff --git a/values/velero/kustomize/default/kustomization.yaml b/values/velero/kustomize/default/kustomization.yaml deleted file mode 100644 index 22967828..00000000 --- a/values/velero/kustomize/default/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -generatorOptions: - disableNameSuffixHash: true -resources: - - ../base diff --git a/values/velero/manifests/dashboards/velero.yaml b/values/velero/manifests/dashboards/velero.yaml new file mode 100644 index 00000000..6874bdec --- /dev/null +++ b/values/velero/manifests/dashboards/velero.yaml @@ -0,0 +1,2214 @@ +{{- if .Values.velero.enabled }} +apiVersion: v1 +data: + velero.json: |- + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Velero Stats maintained by Velero team", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 16829, + "graphTooltip": 1, + "id": 34, + "iteration": 1678979743251, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 15, + "panels": [], + "title": "Backup", + "type": "row" + }, + { + "datasource": "prometheus", + "description": "The sum of one-off backup and schedule backup success total ", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 23, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "velero_backup_total", + "format": "time_series", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Backup Success Total", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 22, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(velero_backup_success_total{schedule=~\"$schedule\"}) / sum(velero_backup_attempt_total{schedule=~\"$schedule\"})", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Backup Success Rate", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 8, + "y": 1 + }, + "id": 26, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(velero_backup_deletion_success_total{schedule=~\"$schedule\"}) / sum(velero_backup_deletion_attempt_total{schedule=~\"$schedule\"})", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Backup Deletion Success Rate", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 12, + "y": 1 + }, + "id": 25, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(velero_volume_snapshot_success_total{schedule=~\"$schedule\"}) / sum(velero_volume_snapshot_attempt_total{schedule=~\"$schedule\"})\n", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Volume snapshot Success Rate", + "type": "gauge" + }, + { + "columns": [ + { + "$$hashKey": "object:462", + "text": "Current", + "value": "current" + } + ], + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "for schedule backup use only", + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 8, + "x": 16, + "y": 1 + }, + "id": 13, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "date" + }, + { + "alias": "Hours since last backup", + "align": "auto", + "colorMode": "row", + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "decimals": 2, + "pattern": "Current", + "thresholds": [ + "24", + "48" + ], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "(time() - velero_backup_last_successful_timestamp{schedule!=\"\"}) / 60 / 60", + "instant": true, + "interval": "", + "legendFormat": "{{`{{schedule}}`}}", + "refId": "A" + } + ], + "title": "Hours since last Backup", + "transform": "timeseries_aggregations", + "type": "table-old" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": true, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_backup_success_total{schedule=~\"$schedule\"}[1h])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "Backup success", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_backup_failure_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Backup failure", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_backup_partial_failure_total{schedule=~\"$schedule\"}[1h])))", + "instant": false, + "interval": "", + "legendFormat": "Backup partial failure", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_backup_deletion_success_total{schedule=~\"$schedule\"}[1h])))", + "instant": false, + "interval": "", + "legendFormat": "Backup deletion success", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_backup_deletion_failure_total{schedule=~\"$schedule\"}[1h])))", + "instant": false, + "interval": "", + "legendFormat": "Backup deletion failure", + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "sum(avg_over_time(velero_backup_items_total{schedule=~\"$schedule\"}[1h]))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Backup items total", + "refId": "F" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "sum(avg_over_time(velero_backup_items_errors{schedule=~\"$schedule\"}[1h]))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Backup items errors_total", + "refId": "G" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_backup_validation_failure_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Backup validation failure", + "refId": "H" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_volume_snapshot_success_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Backup volume snapshot success", + "refId": "I" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_volume_snapshot_failure_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Backup volume snapshot failure", + "refId": "J" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Backup per hour", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:124", + "decimals": 0, + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:125", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "cards": {}, + "color": { + "cardColor": "#1F60C4", + "colorScale": "linear", + "colorScheme": "interpolateSpectral", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "tsbuckets", + "datasource": "prometheus", + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 19 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 34, + "legend": { + "show": true + }, + "reverseYBuckets": false, + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(increase(velero_backup_duration_seconds_bucket{schedule=~\"$schedule\",le!=\"+Inf\"}[1h])) by (le)", + "format": "heatmap", + "hide": false, + "interval": "", + "legendFormat": "{{`{{le}}`}}", + "refId": "B" + } + ], + "title": "Backup time heatmap", + "tooltip": { + "show": true, + "showHistogram": true + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "yAxis": { + "format": "s", + "logBase": 1, + "show": true + }, + "yBucketBound": "auto" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 27 + }, + "hiddenSeries": false, + "id": 18, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(avg_over_time(velero_backup_tarball_size_bytes{schedule=~\"$schedule\"}[15m]))", + "interval": "", + "legendFormat": "{{`{{schedule}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Backup Size", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:561", + "decimals": 0, + "format": "decbytes", + "label": "", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:562", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 33 + }, + "id": 17, + "panels": [], + "title": "Restore", + "type": "row" + }, + { + "datasource": "prometheus", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a" + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 0, + "y": 34 + }, + "id": 27, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "velero_restore_total", + "format": "time_series", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Restore Success Total", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a" + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 4, + "y": 34 + }, + "id": 24, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(velero_restore_success_total{schedule=~\"$schedule\"}) / sum(velero_restore_attempt_total{schedule=~\"$schedule\"})", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Restore Success Rate", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 16, + "x": 8, + "y": 34 + }, + "hiddenSeries": false, + "id": 28, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": true, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_restore_success_total{schedule=~\"$schedule\"}[1h])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "Restore success", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_restore_failed_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "interval": "", + "legendFormat": "Restore failure", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_restore_validation_failed_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "interval": "", + "legendFormat": "Restore validation failure", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_restore_partial_failure_total{schedule=~\"$schedule\"}[1h])))", + "hide": false, + "interval": "", + "legendFormat": "Restore partial failure", + "refId": "D" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Restore per hour", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:124", + "decimals": 0, + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:125", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 43 + }, + "id": 30, + "panels": [], + "title": "CSI", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 44 + }, + "hiddenSeries": false, + "id": 32, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": true, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_csi_snapshot_attempt_total{schedule=~\"$schedule\", backupName=~\"$csi_backup_name\"}[1h])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "CSI Snapshot attempt", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_csi_snapshot_success_total{schedule=~\"$schedule\", backupName=~\"$csi_backup_name\"}[1h])))", + "hide": false, + "interval": "", + "legendFormat": "CSI Snapshot success", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(velero_csi_snapshot_failure_total{schedule=~\"$schedule\", backupName=~\"$csi_backup_name\"}[1h])))", + "hide": false, + "interval": "", + "legendFormat": "CSI Snapshot failure", + "refId": "C" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "CSI per hour", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:124", + "decimals": 0, + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:125", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 53 + }, + "id": 36, + "panels": [], + "title": "Restic", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a" + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 0, + "y": 54 + }, + "id": 37, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(restic_pod_volume_backup_dequeue_count{node=~\"$restic_node\"}) / sum(restic_pod_volume_backup_enqueue_count{node=~\"$restic_node\"})", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Restic Success Rate", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 20, + "x": 4, + "y": 54 + }, + "hiddenSeries": false, + "id": 38, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": true, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(restic_pod_volume_backup_enqueue_count{node=~\"$restic_node\"}[1h])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "Restic enqueue", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "round(sum(increase(restic_pod_volume_backup_dequeue_count{node=~\"$restic_node\"}[1h])))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Restic dequeue", + "refId": "B" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Restic per hour", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:124", + "decimals": 0, + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:125", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 63 + }, + "hiddenSeries": false, + "id": 39, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(avg_over_time(restic_restic_operation_latency_seconds_gauge{backupName=~\"$restic_backup_name\", node=~\"$restic_node\", operation=~\"$restic_operation\", pod_volume_backup=~\"$restic_pvb_name\"}[15m]))", + "interval": "", + "legendFormat": "Avg over time", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Restic time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:561", + "decimals": 0, + "format": "s", + "label": "", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:562", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 69 + }, + "id": 43, + "panels": [], + "title": "File System Backup(for v1.10 and later)", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a" + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 0.95 + }, + { + "color": "#299c46", + "value": 0.99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 4, + "x": 0, + "y": 70 + }, + "id": 41, + "links": [], + "maxDataPoints": 100, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(pod_volume_backup_dequeue_count{node=~\"$fsb_node\"}) / sum(pod_volume_backup_enqueue_count{node=~\"$fsb_node\"})", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "FSB Success Rate", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "decimals": 0, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 20, + "x": 4, + "y": 70 + }, + "hiddenSeries": false, + "id": 45, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": true, + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "round(sum(increase(pod_volume_backup_enqueue_count{node=~\"$fsb_node\"}[1h])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "FSB enqueue", + "refId": "A" + }, + { + "datasource": "prometheus", + "exemplar": false, + "expr": "round(sum(increase(pod_volume_backup_dequeue_count{node=~\"$fsb_node\"}[1h])))", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "FSB dequeue", + "refId": "B" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "FSB per hour", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:124", + "decimals": 0, + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:125", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 79 + }, + "hiddenSeries": false, + "id": 47, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": "prometheus", + "exemplar": false, + "expr": "sum(avg_over_time(pod_volume_operation_latency_seconds_gauge{backupName=~\"$fsb_backup_name\", node=~\"$fsb_node\", operation=~\"$fsb_operation\", pod_volume_backup=~\"$fsb_pvb_name\"}[15m]))", + "interval": "", + "legendFormat": "Avg over time", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "FSB time", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:561", + "decimals": 0, + "format": "s", + "label": "", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:562", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "refresh": false, + "schemaVersion": 36, + "style": "dark", + "tags": [ + "velero" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "k0", + "value": "k0" + }, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "definition": "label_values(velero_backup_attempt_total, schedule)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "schedule", + "options": [], + "query": { + "query": "label_values(velero_backup_attempt_total, schedule)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(velero_csi_snapshot_attempt_total, backupName)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "csi_backup_name", + "options": [], + "query": { + "query": "label_values(velero_csi_snapshot_attempt_total, backupName)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(restic_pod_volume_backup_enqueue_count, node)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "restic_node", + "options": [], + "query": { + "query": "label_values(restic_pod_volume_backup_enqueue_count, node)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(restic_restic_operation_latency_seconds_gauge, backupName)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "restic_backup_name", + "options": [], + "query": { + "query": "label_values(restic_restic_operation_latency_seconds_gauge, backupName)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(restic_restic_operation_latency_seconds_gauge, operation)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "restic_operation", + "options": [], + "query": { + "query": "label_values(restic_restic_operation_latency_seconds_gauge, operation)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(restic_restic_operation_latency_seconds_gauge, pod_volume_backup)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "restic_pvb_name", + "options": [], + "query": { + "query": "label_values(restic_restic_operation_latency_seconds_gauge, pod_volume_backup)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(pod_volume_backup_enqueue_count, node)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "fsb_node", + "options": [], + "query": { + "query": "label_values(pod_volume_backup_enqueue_count, node)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(pod_volume_operation_latency_seconds_gauge, backupName)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "fsb_backup_name", + "options": [], + "query": { + "query": "label_values(pod_volume_operation_latency_seconds_gauge, backupName)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(pod_volume_operation_latency_seconds_gauge, operation)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "fsb_operation", + "options": [], + "query": { + "query": "label_values(pod_volume_operation_latency_seconds_gauge, operation)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(pod_volume_operation_latency_seconds_gauge, pod_volume_backup)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "fsb_pvb_name", + "options": [], + "query": { + "query": "label_values(pod_volume_operation_latency_seconds_gauge, pod_volume_backup)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-2d", + "to": "now" + }, + "timepicker": { + "hidden": false, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Kubernetes/Tanzu/Velero", + "uid": "EbXSjT24k", + "version": 2, + "weekStart": "" + } +kind: ConfigMap +metadata: + name: velero-dashboard + namespace: prometheus + labels: + grafana_dashboard: "1" +{{- end }} diff --git a/values/velero/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml b/values/velero/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml new file mode 100644 index 00000000..cb01381b --- /dev/null +++ b/values/velero/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml @@ -0,0 +1,16 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-api-server + namespace: velero +spec: + egress: + - toEntities: + - kube-apiserver + toPorts: + - ports: + - port: "6443" + protocol: TCP + endpointSelector: + matchLabels: + app.kubernetes.io/instance: velero diff --git a/values/velero/manifests/policies/CiliumNetworkPolicy-allow-job-api-server.yaml b/values/velero/manifests/policies/CiliumNetworkPolicy-allow-job-api-server.yaml new file mode 100644 index 00000000..21c8e2ff --- /dev/null +++ b/values/velero/manifests/policies/CiliumNetworkPolicy-allow-job-api-server.yaml @@ -0,0 +1,16 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-job-api-server + namespace: velero +spec: + egress: + - toEntities: + - kube-apiserver + toPorts: + - ports: + - port: "6443" + protocol: TCP + endpointSelector: + matchLabels: + batch.kubernetes.io/job-name: velero-upgrade-crds diff --git a/values/velero/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml b/values/velero/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml new file mode 100644 index 00000000..1631d4bf --- /dev/null +++ b/values/velero/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml @@ -0,0 +1,17 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-prometheus-metrics + namespace: velero +spec: + endpointSelector: + matchLabels: + app.kubernetes.io/instance: velero + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: prometheus + - toPorts: + - ports: + - port: "8085" + protocol: TCP diff --git a/values/velero/manifests/schedule.yaml b/values/velero/manifests/schedule.yaml new file mode 100644 index 00000000..627b920d --- /dev/null +++ b/values/velero/manifests/schedule.yaml @@ -0,0 +1,31 @@ +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: full-backup + namespace: velero +spec: + paused: false + schedule: '@every 24h' + skipImmediately: false + template: + csiSnapshotTimeout: 10m0s + defaultVolumesToRestic: true + excludedNamespaces: + - cilium-secrets + - cilium-spire + - grafana + - jaeger + - kube-system + - loki + - rabbitmq + - prometheus + - tempo + - test + - velero + includedNamespaces: + - '*' + includedResources: + - '*' + storageLocation: default + ttl: 336h0m0s + useOwnerReferencesInBackup: false diff --git a/values/velero/manifests/velero.yaml b/values/velero/manifests/velero.yaml index 2e455085..595dc1da 100644 --- a/values/velero/manifests/velero.yaml +++ b/values/velero/manifests/velero.yaml @@ -10,13 +10,16 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/velero + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default project: sys syncPolicy: managedNamespaceMetadata: diff --git a/values/velero/values.yaml.gotmpl b/values/velero/values.yaml.gotmpl index 966cdf7d..9cd033cb 100644 --- a/values/velero/values.yaml.gotmpl +++ b/values/velero/values.yaml.gotmpl @@ -2,16 +2,16 @@ velero: enabled: true autosync: true kubeletRootDir: "/var/lib/kubernetes/pods" - bucket: velero-backup + bucket: backup bsl: default # Opt-in or opt-out pvc backup # https://velero.io/docs/main/file-system-backup/#to-back-up backupAllVolumes: true credentials: - secretName: "s3-credentials" + secretName: "velero-s3" s3: region: us-east-1 - url: "https://nutanix-obj-s3.kube-system" + url: "http://10.255.241.30:30080" insecureSkipTLSVerify: true resources: velero: diff --git a/values/velero/values/velero.yaml.gotmpl b/values/velero/values/velero.yaml.gotmpl index a1ffec82..c6d89ec2 100644 --- a/values/velero/values/velero.yaml.gotmpl +++ b/values/velero/values/velero.yaml.gotmpl @@ -28,17 +28,17 @@ configuration: uploaderType: kopia # Backup all volumes by default defaultVolumesToFsBackup: {{ .Values.velero.backupAllVolumes }} - ## https://velero.io/docs/v1.6/api-types/backupstoragelocation/ + # https://velero.io/docs/v1.6/api-types/backupstoragelocation/ backupStorageLocation: - name: {{ .Values.velero.bsl }} bucket: {{ .Values.velero.bucket }} provider: aws default: true ## prefix is the directory under which all Velero data should be stored within the bucket. Optional. - prefix: {{ .Values.cluster_config.cluster }}/velero + prefix: {{ .Values.clusterConfig.cluster }}/velero accessMode: ReadWrite config: - ## ONLY us-east-1 region is supported by nutanix + # ONLY us-east-1 region is supported by nutanix region: {{ .Values.velero.s3.region }} s3ForcePathStyle: "true" s3Url: {{ .Values.velero.s3.url }} diff --git a/values/x509-exporter/kustomize/base/kustomization.yaml b/values/x509-exporter/kustomize/base/kustomization.yaml deleted file mode 100644 index 57f354b1..00000000 --- a/values/x509-exporter/kustomize/base/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - _manifest.yaml diff --git a/values/x509-exporter/kustomize/default/kustomization.yaml b/values/x509-exporter/kustomize/default/kustomization.yaml deleted file mode 100644 index 22967828..00000000 --- a/values/x509-exporter/kustomize/default/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -generatorOptions: - disableNameSuffixHash: true -resources: - - ../base diff --git a/values/x509-exporter/manifests/dashboards/x509-exporter-dashbaoard.yaml b/values/x509-exporter/manifests/dashboards/x509-exporter-dashbaoard.yaml new file mode 100644 index 00000000..01a9bc0a --- /dev/null +++ b/values/x509-exporter/manifests/dashboards/x509-exporter-dashbaoard.yaml @@ -0,0 +1,2011 @@ +{{- if .Values.x509_exporter.enabled }} +apiVersion: v1 +data: + x509-dash.json: |- + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Unified dashboard for checking certificates expiration: Kubernetes Secrets, certificate files on nodes, or on any server.", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 13922, + "graphTooltip": 0, + "iteration": 1678705600458, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 24, + "panels": [], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "super-light-blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 0, + "y": 1 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "count(x509_cert_not_after)", + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Total Certificates", + "type": "stat" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "dark-red", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 5, + "y": 1 + }, + "id": 18, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "sum(((x509_cert_not_after - time()) / 86400) < bool 0)", + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Expired", + "type": "stat" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 8, + "y": 1 + }, + "id": 19, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "sum(0 < ((x509_cert_not_after - time()) / 86400) < bool $critical_threshold)", + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Expiring within $critical_threshold days", + "type": "stat" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "yellow", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 11, + "y": 1 + }, + "id": 20, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "sum(0 < ((x509_cert_not_after - time()) / 86400) < bool $warning_threshold)", + "instant": false, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Expiring within $warning_threshold days", + "type": "stat" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "super-light-blue" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 14, + "y": 1 + }, + "id": 17, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "count(x509_read_errors)", + "instant": false, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Exporters", + "type": "stat" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 14, + "y": 4 + }, + "id": 36, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "sum(x509_read_errors)", + "instant": false, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Exporter Errors", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 26, + "panels": [], + "title": "Expiration", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Because of a missing feature in Grafana, critical and warning thresholds from dashboard variables will not affect coloration of the Time Left column in this table.\n\nThresholds are to be set manually in the Overrides settings for this widget.\n\nPlease vote or contribute to issue : https://github.com/grafana/grafana/issues/922", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time Left" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 200 + }, + { + "id": "custom.filterable", + "value": false + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red" + }, + { + "color": "red", + "value": 0 + }, + { + "color": "yellow", + "value": 7 + }, + { + "color": "green", + "value": 28 + } + ] + } + }, + { + "id": "unit", + "value": "d" + } + ] + } + ] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 46, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "sort(((x509_cert_not_after{secret_name!=\"linkerd-identity-issuer\", issuer_O=\"\", issuer_CN!=\"webhook.linkerd.cluster.local\"} - time()) / 86400) < $list_threshold)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Kubernetes Secrets (no issuer) (time left < $list_threshold days)", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^(subject_CN|secret_namespace|secret_name|Value)$" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Value": 3, + "secret_name": 2, + "secret_namespace": 1, + "subject_CN": 0 + }, + "renameByName": { + "Value": "Time Left", + "secret_name": "Secret Name", + "secret_namespace": "Secret Namespace", + "subject_CN": "Subject CN" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Because of a missing feature in Grafana, critical and warning thresholds from dashboard variables will not affect coloration of the Time Left column in this table.\n\nThresholds are to be set manually in the Overrides settings for this widget.\n\nPlease vote or contribute to issue : https://github.com/grafana/grafana/issues/922", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time Left" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 200 + }, + { + "id": "custom.filterable", + "value": false + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "red", + "value": 0 + }, + { + "color": "#EAB839", + "value": 7 + }, + { + "color": "green", + "value": 28 + } + ] + } + }, + { + "id": "unit", + "value": "d" + } + ] + } + ] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 47, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "exemplar": false, + "expr": "sort(((x509_cert_not_after{issuer_O!=\"\"} - time()) / 86400) < $list_threshold)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Kubernetes Secrets (with issuer) (time left < $list_threshold days)", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^(subject_CN|secret_namespace|secret_name|Value)$" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Value": 3, + "secret_name": 2, + "secret_namespace": 1, + "subject_CN": 0 + }, + "renameByName": { + "Value": "Time Left", + "filepath": "File Path", + "instance": "Instance", + "subject_CN": "Subject CN" + } + } + } + ], + "type": "table" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 12, + "panels": [], + "title": "Charts", + "type": "row" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Certificate Count" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 150 + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 8, + "x": 0, + "y": 22 + }, + "id": 14, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "topk(10, sort_desc(count by (issuer_CN) (x509_cert_not_after)))", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Top Issuers", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "issuer_CN", + "Value" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Value": "Certificate Count", + "issuer_CN": "Issuer CN" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Certificate Count" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 150 + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 8, + "x": 8, + "y": 22 + }, + "id": 15, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "topk(10, sort_desc(count by (secret_namespace) (x509_cert_not_after{secret_namespace!=\"\"})))", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Top Namespaces (Kubernetes Secrets)", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "Value", + "secret_namespace" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Value": "Certificate Count", + "secret_namespace": "Namespace" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Days" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 100 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Secret Namespace" + }, + "properties": [ + { + "id": "custom.width", + "value": 258 + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 34 + }, + "id": 31, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "bottomk(10, (x509_cert_not_after{secret_name!=\"\"} - x509_cert_not_before) / 86400)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Kubernetes Secrets : Shortest Validity Period", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^(subject_CN|secret_namespace|secret_name|Value)$" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Value": 3, + "secret_name": 2, + "secret_namespace": 1, + "subject_CN": 0 + }, + "renameByName": { + "Value": "Days", + "secret_name": "Secret Name", + "secret_namespace": "Secret Namespace", + "subject_CN": "Subject CN" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Days" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 100 + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 34 + }, + "id": 28, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "topk(10, (x509_cert_not_after{secret_name!=\"\"} - x509_cert_not_before) / 86400)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Kubernetes Secrets : Longest Validity Period", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^(subject_CN|secret_namespace|secret_name|Value)$" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Value": 3, + "secret_name": 2, + "secret_namespace": 1, + "subject_CN": 0 + }, + "renameByName": { + "Value": "Days", + "secret_name": "Secret Name", + "secret_namespace": "Secret Namespace", + "subject_CN": "Subject CN" + } + } + } + ], + "type": "table" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 35, + "panels": [], + "title": "Exporters", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 47 + }, + "hiddenSeries": false, + "id": 38, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "count(x509_read_errors)", + "interval": "", + "legendFormat": "exporters", + "queryType": "randomWalk", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Reporting Exporters", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:237", + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:238", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": { + "exporters with errors": "red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 47 + }, + "hiddenSeries": false, + "id": 39, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum (x509_read_errors > bool 0)", + "interval": "", + "legendFormat": "exporters with errors", + "queryType": "randomWalk", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Exporters with Errors", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:237", + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:238", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": { + "error rate": "red", + "errors": "red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 55 + }, + "hiddenSeries": false, + "id": 41, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(x509_read_errors[15m]))", + "interval": "", + "legendFormat": "error rate", + "queryType": "randomWalk", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Error Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:237", + "format": "cps", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:238", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": { + "errors": "red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 55 + }, + "hiddenSeries": false, + "id": 40, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "8.5.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(x509_read_errors)", + "interval": "", + "legendFormat": "errors", + "queryType": "randomWalk", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Cumulative Errors", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:237", + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:238", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Rate" + }, + "properties": [ + { + "id": "custom.width", + "value": 150 + }, + { + "id": "custom.align", + "value": "center" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 63 + }, + "id": 43, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "topk(10, rate(x509_read_errors[6h]))", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Top Exporters by Error Rate", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^(instance|Value)$" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Value": "Rate", + "instance": "Instance" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Errors" + }, + "properties": [ + { + "id": "custom.width", + "value": 150 + }, + { + "id": "custom.align", + "value": "center" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 63 + }, + "id": 44, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "8.5.3", + "targets": [ + { + "expr": "topk(10, x509_read_errors)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "queryType": "randomWalk", + "refId": "A" + } + ], + "title": "Top Exporters by Cumulative Errors", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^(instance|Value)$" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Value": "Errors", + "instance": "Instance" + } + } + } + ], + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 36, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "7", + "value": "7" + }, + "hide": 0, + "includeAll": false, + "label": "Critical Threshold (days)", + "multi": false, + "name": "critical_threshold", + "options": [ + { + "selected": false, + "text": "1", + "value": "1" + }, + { + "selected": true, + "text": "7", + "value": "7" + }, + { + "selected": false, + "text": "14", + "value": "14" + }, + { + "selected": false, + "text": "15", + "value": "15" + }, + { + "selected": false, + "text": "28", + "value": "28" + }, + { + "selected": false, + "text": "30", + "value": "30" + }, + { + "selected": false, + "text": "60", + "value": "60" + }, + { + "selected": false, + "text": "90", + "value": "90" + }, + { + "selected": false, + "text": "180", + "value": "180" + }, + { + "selected": false, + "text": "365", + "value": "365" + } + ], + "query": "1,7,14,15,28,30,60,90,180,365", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "28", + "value": "28" + }, + "hide": 0, + "includeAll": false, + "label": "Warning Threshold (days)", + "multi": false, + "name": "warning_threshold", + "options": [ + { + "selected": false, + "text": "1", + "value": "1" + }, + { + "selected": false, + "text": "7", + "value": "7" + }, + { + "selected": false, + "text": "14", + "value": "14" + }, + { + "selected": false, + "text": "15", + "value": "15" + }, + { + "selected": true, + "text": "28", + "value": "28" + }, + { + "selected": false, + "text": "30", + "value": "30" + }, + { + "selected": false, + "text": "60", + "value": "60" + }, + { + "selected": false, + "text": "90", + "value": "90" + }, + { + "selected": false, + "text": "180", + "value": "180" + }, + { + "selected": false, + "text": "365", + "value": "365" + } + ], + "query": "1,7,14,15,28,30,60,90,180,365", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": true, + "text": "7300", + "value": "7300" + }, + "hide": 0, + "includeAll": false, + "label": "List expiring in less than (days)", + "multi": false, + "name": "list_threshold", + "options": [ + { + "selected": false, + "text": "1", + "value": "1" + }, + { + "selected": false, + "text": "7", + "value": "7" + }, + { + "selected": false, + "text": "15", + "value": "15" + }, + { + "selected": false, + "text": "30", + "value": "30" + }, + { + "selected": false, + "text": "60", + "value": "60" + }, + { + "selected": false, + "text": "90", + "value": "90" + }, + { + "selected": false, + "text": "180", + "value": "180" + }, + { + "selected": false, + "text": "365", + "value": "365" + }, + { + "selected": false, + "text": "730", + "value": "730" + }, + { + "selected": false, + "text": "1095", + "value": "1095" + }, + { + "selected": false, + "text": "1460", + "value": "1460" + }, + { + "selected": false, + "text": "1825", + "value": "1825" + }, + { + "selected": false, + "text": "3650", + "value": "3650" + }, + { + "selected": true, + "text": "7300", + "value": "7300" + } + ], + "query": "1,7,15,30,60,90,180,365,730,1095,1460,1825,3650,7300", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Certificates Expiration (X509 Certificate Exporter)", + "uid": "lHnsYlPGk", + "version": 2, + "weekStart": "" + } +kind: ConfigMap +metadata: + creationTimestamp: null + name: x509-exporter-dashboard + namespace: prometheus + labels: + grafana_dashboard: "1" +{{- end }} diff --git a/values/x509-exporter/manifests/x509-certificates.yaml b/values/x509-exporter/manifests/x509-certificates.yaml new file mode 100644 index 00000000..a488fd04 --- /dev/null +++ b/values/x509-exporter/manifests/x509-certificates.yaml @@ -0,0 +1,48 @@ +{{- if .Values.x509_exporter.alerts }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + labels: + # Some labels for various prometheus matching + k8s-app: x509-exporter + prometheus: k8s + role: alert-rules + name: x509-exporter-x509-certificate-exporter + namespace: x509-exporter +spec: + groups: + - name: x509-certificate-exporter.rules + rules: + - alert: X509ExporterReadErrors + annotations: + description: Over the last 15 minutes, this x509-certificate-exporter instance has experienced errors reading certificate files or querying the Kubernetes API. This could be caused by a misconfiguration if triggered when the exporter starts. + summary: Increasing read errors for x509-certificate-exporter + expr: delta(x509_read_errors[15m]) > 0 + for: 5m + labels: + severity: warning + - alert: CertificateError + annotations: + description: Certificate could not be decoded {{`{{`}}if $labels.secret_name {{`}}`}} in Kubernetes secret "{{`{{`}} $labels.secret_namespace {{`}}`}}/{{`{{`}} $labels.secret_name {{`}}`}}"{{`{{`}}else{{`}}`}}at location "{{`{{`}} $labels.filepath {{`}}`}}"{{`{{`}}end{{`}}`}} + summary: Certificate cannot be decoded + expr: x509_cert_error > 0 + for: 15m + labels: + severity: warning + - alert: CertificateRenewal + annotations: + description: Certificate for "{{`{{`}} $labels.subject_CN {{`}}`}}" should be renewed {{`{{`}}if $labels.secret_name {{`}}`}}in Kubernetes secret "{{`{{`}} $labels.secret_namespace {{`}}`}}/{{`{{`}} $labels.secret_name {{`}}`}}"{{`{{`}}else{{`}}`}}at location "{{`{{`}} $labels.filepath {{`}}`}}"{{`{{`}}end{{`}}`}} + summary: Certificate should be renewed + expr: ((x509_cert_not_after{secret_name!="linkerd-identity-issuer", issuer_O="", issuer_CN!="webhook.linkerd.cluster.local"} - time()) / 86400) < 28 + for: 15m + labels: + severity: warning + - alert: CertificateExpiration + annotations: + description: Certificate for "{{`{{`}} $labels.subject_CN {{`}}`}}" is about to expire {{`{{`}}if $labels.secret_name {{`}}`}}in Kubernetes secret "{{`{{`}} $labels.secret_namespace {{`}}`}}/{{`{{`}} $labels.secret_name {{`}}`}}"{{`{{`}}else{{`}}`}}at location "{{`{{`}} $labels.filepath {{`}}`}}"{{`{{`}}end{{`}}`}} + summary: Certificate is about to expire + expr: ((x509_cert_not_after{secret_name!="linkerd-identity-issuer", issuer_O="", issuer_CN!="webhook.linkerd.cluster.local"} - time()) / 86400) < 14 + for: 15m + labels: + severity: critical +{{- end }} -- 2.52.0 From 9249f0eb1804c89d1250369b84278edcb2214c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Thu, 5 Jun 2025 13:52:36 +0200 Subject: [PATCH 4/4] wip: Match chart to k8s state --- ...rwideNetworkPolicy-allow-acme-solvers.yaml | 0 ...iumClusterwideNetworkPolicy-allow-dns.yaml | 0 ...eNetworkPolicy-allow-mariadb-operator.yaml | 0 ...liumClusterwideNetworkPolicy-deny-all.yaml | 0 .../CiliumNetworkPolicy-allow-gravatar.yaml | 14 + .../CiliumNetworkPolicy-allow-slack.yaml | 3 +- apps/templates/argocd-apps.yaml | 1 + .../templates/resources/pre-cert-manager.yaml | 10 +- argocd/helmfile-cmp/generate.sh | 8 +- argocd/helmfile-cmp/plugin.yaml | 3 +- {temp => helmfile.d}/argo.yaml.gotmpl | 11 +- {temp => helmfile.d}/cert-manager.yaml.gotmpl | 6 +- {temp => helmfile.d}/cilium.yaml.gotmpl | 4 +- .../ingress-nginx.yaml.gotmpl | 10 +- {temp => helmfile.d}/kyverno.yaml.gotmpl | 6 +- helmfile.d/metrics-server.yaml.gotmpl | 42 + .../nfs-provisioner.yaml.gotmpl | 7 +- .../postgres-operator.yaml.gotmpl | 4 +- {temp => helmfile.d}/prometheus.yaml.gotmpl | 4 +- ...elmfile.yaml.gotmpl => velero.yaml.gotmpl} | 3 + .../x509-exporter.yaml.gotmpl | 5 +- justfile | 9 +- shell.nix | 2 + temp/metricsserver.yaml.gotmpl | 43 - values/argo/manifests/argo.yaml | 12 +- values/argo/manifests/dashboards/argocd.yaml | 4260 +++ values/argo/manifests/nodeport.yaml | 26 + ...rkPolicy-allow-applicationset-ingress.yaml | 0 ...etworkPolicy-allow-argo-notifications.yaml | 0 ...allow-argo-repo-access-applicationset.yaml | 0 ...mNetworkPolicy-allow-argo-repo-access.yaml | 0 ...tworkPolicy-allow-chartmuseum-ingress.yaml | 0 ...olicy-allow-image-updater-repo-access.yaml | 0 .../CiliumNetworkPolicy-allow-ingress.yaml | 0 .../CiliumNetworkPolicy-allow-kube-api.yaml | 0 ...liumNetworkPolicy-allow-microsoft-sso.yaml | 0 ...licy-allow-prometheus-metrics-rollout.yaml | 0 ...cy-allow-prometheus-metrics-workflows.yaml | 0 ...etworkPolicy-allow-prometheus-metrics.yaml | 0 values/argo/manifests/sys-project.yaml | 84 + values/argo/values.yaml.gotmpl | 18 +- values/argo/values/argocd.yaml.gotmpl | 59 +- .../cert-manager/manifests/cert-manager.yaml | 15 +- .../manifests/pre-cert-manager.yaml | 10 +- .../CiliumNetworkPolicy-allow-api-server.yaml | 22 - values/cilium/cilium-manifests/cilium.yaml | 11 +- ...liumClusterwideNetworkPolicy-allow-s3.yaml | 20 - values/cilium/values-oceanbox.yaml.gotmpl | 5 +- values/cilium/values.yaml.gotmpl | 3 +- values/cilium/values/cilium.yaml.gotmpl | 1 + .../manifests/ingress-nginx.yaml | 15 +- .../values/ingress-nginx.yaml.gotmpl | 4 +- values/kyverno/manifests/kyverno.yaml | 13 +- .../manifests/policies/sync-gitlab.yaml | 1 + .../manifests/policies/sync-regcred.yaml | 1 + .../manifests/policies/sync-s3-secret.yaml | 1 + .../whitelist-internal-ingresses.yaml | 7 +- values/kyverno/values.yaml.gotmpl | 2 +- .../manifests/metrics-server.yaml} | 15 +- .../values.yaml.gotmpl | 4 +- .../values/metrics-server.yaml.gotmpl} | 6 +- .../manifests/nfs-provisioner.yaml | 17 +- .../values-oceanbox.yaml.gotmpl | 8 + values/nfs-provisioner/values.yaml.gotmpl | 1 + .../values/nfs-provisioner.yaml.gotmpl | 4 +- .../manifests/postgres-operator.yaml | 13 +- .../values/postgres-operator.yaml.gotmpl | 6 + .../dotdc-grafana-dashboards-kubernetes.yaml | 21313 ++++++++++++++++ .../dashboards/persistent-volume-usage.yaml | 1592 ++ .../CiliumNetworkPolicy-allow-slack.yaml | 12 + ...heus-add-folder-to-default-dashboards.yaml | 2 +- values/prometheus/manifests/prometheus.yaml | 13 +- values/prometheus/values-oceanbox.yaml.gotmpl | 32 +- values/prometheus/values.yaml.gotmpl | 4 + .../prometheus/values/prometheus.yaml.gotmpl | 641 +- values/values-oceanbox.yaml | 4 +- values/velero/manifests/velero.yaml | 2 + values/velero/values.yaml.gotmpl | 10 +- .../CiliumNetworkPolicy-allow-api-server.yaml | 16 + ...etworkPolicy-allow-prometheus-metrics.yaml | 17 + .../manifests/x509-exporter.yaml | 11 +- .../values/x509-exporter.yaml.gotmpl | 12 +- 82 files changed, 28211 insertions(+), 329 deletions(-) rename {values/cilium/cilium-manifests/policies => apps/charts/sys-cilium-policies/templates/cilium}/CiliumClusterwideNetworkPolicy-allow-acme-solvers.yaml (100%) rename {values/cilium/cilium-manifests/policies => apps/charts/sys-cilium-policies/templates/cilium}/CiliumClusterwideNetworkPolicy-allow-dns.yaml (100%) rename {values/cilium/cilium-manifests/policies => apps/charts/sys-cilium-policies/templates/cilium}/CiliumClusterwideNetworkPolicy-allow-mariadb-operator.yaml (100%) rename {values/cilium/cilium-manifests/policies => apps/charts/sys-cilium-policies/templates/cilium}/CiliumClusterwideNetworkPolicy-deny-all.yaml (100%) create mode 100644 apps/charts/sys-cilium-policies/templates/plausible/CiliumNetworkPolicy-allow-gravatar.yaml rename {temp => helmfile.d}/argo.yaml.gotmpl (85%) rename {temp => helmfile.d}/cert-manager.yaml.gotmpl (86%) rename {temp => helmfile.d}/cilium.yaml.gotmpl (89%) rename {temp => helmfile.d}/ingress-nginx.yaml.gotmpl (80%) rename {temp => helmfile.d}/kyverno.yaml.gotmpl (86%) create mode 100644 helmfile.d/metrics-server.yaml.gotmpl rename {temp => helmfile.d}/nfs-provisioner.yaml.gotmpl (87%) rename {temp => helmfile.d}/postgres-operator.yaml.gotmpl (88%) rename {temp => helmfile.d}/prometheus.yaml.gotmpl (86%) rename helmfile.d/{helmfile.yaml.gotmpl => velero.yaml.gotmpl} (96%) rename {temp => helmfile.d}/x509-exporter.yaml.gotmpl (86%) delete mode 100644 temp/metricsserver.yaml.gotmpl create mode 100644 values/argo/manifests/dashboards/argocd.yaml create mode 100644 values/argo/manifests/nodeport.yaml rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-applicationset-ingress.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-argo-notifications.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-argo-repo-access-applicationset.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-argo-repo-access.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-chartmuseum-ingress.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-image-updater-repo-access.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-ingress.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-kube-api.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-microsoft-sso.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-prometheus-metrics-rollout.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-prometheus-metrics-workflows.yaml (100%) rename values/argo/manifests/{cilium => policies}/CiliumNetworkPolicy-allow-prometheus-metrics.yaml (100%) create mode 100644 values/argo/manifests/sys-project.yaml delete mode 100644 values/cilium/cilium-manifests/cilium-test/CiliumNetworkPolicy-allow-api-server.yaml delete mode 100644 values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-s3.yaml rename values/{metricsserver/manifests/metricsserver.yaml => metrics-server/manifests/metrics-server.yaml} (71%) rename values/{metricsserver => metrics-server}/values.yaml.gotmpl (50%) rename values/{metricsserver/values/metricsserver.yaml.gotmpl => metrics-server/values/metrics-server.yaml.gotmpl} (71%) create mode 100644 values/nfs-provisioner/values-oceanbox.yaml.gotmpl create mode 100644 values/postgres-operator/values/postgres-operator.yaml.gotmpl create mode 100644 values/prometheus/manifests/dashboards/dotdc-grafana-dashboards-kubernetes.yaml create mode 100644 values/prometheus/manifests/dashboards/persistent-volume-usage.yaml create mode 100644 values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-slack.yaml create mode 100644 values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml create mode 100644 values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml diff --git a/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-acme-solvers.yaml b/apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-allow-acme-solvers.yaml similarity index 100% rename from values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-acme-solvers.yaml rename to apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-allow-acme-solvers.yaml diff --git a/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-dns.yaml b/apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-allow-dns.yaml similarity index 100% rename from values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-dns.yaml rename to apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-allow-dns.yaml diff --git a/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-mariadb-operator.yaml b/apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-allow-mariadb-operator.yaml similarity index 100% rename from values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-mariadb-operator.yaml rename to apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-allow-mariadb-operator.yaml diff --git a/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-deny-all.yaml b/apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-deny-all.yaml similarity index 100% rename from values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-deny-all.yaml rename to apps/charts/sys-cilium-policies/templates/cilium/CiliumClusterwideNetworkPolicy-deny-all.yaml diff --git a/apps/charts/sys-cilium-policies/templates/plausible/CiliumNetworkPolicy-allow-gravatar.yaml b/apps/charts/sys-cilium-policies/templates/plausible/CiliumNetworkPolicy-allow-gravatar.yaml new file mode 100644 index 00000000..7193691a --- /dev/null +++ b/apps/charts/sys-cilium-policies/templates/plausible/CiliumNetworkPolicy-allow-gravatar.yaml @@ -0,0 +1,14 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-plausible-secure-gravatar + namespace: prometheus +spec: + description: Allow Plausible Gravatar + egress: + - toFQDNs: + - matchName: secure.gravatar.com + - matchName: gravatar.com + endpointSelector: + matchLabels: + app.kubernetes.io/name: plausible-analytics \ No newline at end of file diff --git a/apps/charts/sys-cilium-policies/templates/robusta/CiliumNetworkPolicy-allow-slack.yaml b/apps/charts/sys-cilium-policies/templates/robusta/CiliumNetworkPolicy-allow-slack.yaml index c38a398a..86f00f44 100644 --- a/apps/charts/sys-cilium-policies/templates/robusta/CiliumNetworkPolicy-allow-slack.yaml +++ b/apps/charts/sys-cilium-policies/templates/robusta/CiliumNetworkPolicy-allow-slack.yaml @@ -2,10 +2,11 @@ apiVersion: cilium.io/v2 kind: CiliumNetworkPolicy metadata: name: allow-slack - namespace: robusta + namespace: prometheus spec: egress: - toFQDNs: - matchPattern: slack.com + - matchName: hooks.slack.com endpointSelector: matchLabels: {} diff --git a/apps/templates/argocd-apps.yaml b/apps/templates/argocd-apps.yaml index 8e217ce1..7447c5fd 100644 --- a/apps/templates/argocd-apps.yaml +++ b/apps/templates/argocd-apps.yaml @@ -21,6 +21,7 @@ spec: sourceRepos: - '{{ .Values.cluster_config.manifests }}' - 'https://argoproj.github.io/argo-helm' + - 'https://gitlab.com/oceanbox/manifests.git' - 'https://kubernetes-sigs.github.io/metrics-server/' - 'https://kubernetes.github.io/ingress-nginx' - 'https://cloudnative-pg.github.io/charts' diff --git a/apps/templates/resources/pre-cert-manager.yaml b/apps/templates/resources/pre-cert-manager.yaml index 8d6a498a..a022015b 100644 --- a/apps/templates/resources/pre-cert-manager.yaml +++ b/apps/templates/resources/pre-cert-manager.yaml @@ -10,7 +10,7 @@ spec: # The ACME server URL server: https://acme-v02.api.letsencrypt.org/directory # Email address used for ACME registration - email: {{ .Values.cluster_config.acme_email }} + email: {{ .Values.clusterConfig.acme_email }} # Name of a secret used to store the ACME account private key privateKeySecretRef: name: letsencrypt-production @@ -30,7 +30,7 @@ spec: # The ACME server URL server: https://acme-staging-v02.api.letsencrypt.org/directory # Email address used for ACME registration - email: {{ .Values.cluster_config.acme_email }} + email: {{ .Values.clusterConfig.acme_email }} # Name of a secret used to store the ACME account private key privateKeySecretRef: name: letsencrypt-staging @@ -93,7 +93,7 @@ rules: - watch --- -{{ if .Values.cluster_config.initca }} +{{ if .Values.clusterConfig.initca }} # Pod to update certificates from master nodes # only runs on control plane nodes (etcd) @@ -153,11 +153,11 @@ spec: volumes: - name: ca-pem hostPath: - path: {{.Values.cluster_config.initca}}/ca.pem + path: {{.Values.clusterConfig.initca}}/ca.pem type: File - name: ca-key-pem hostPath: - path: {{.Values.cluster_config.initca}}/ca-key.pem + path: {{.Values.clusterConfig.initca}}/ca-key.pem type: File - name: certs-script configMap: diff --git a/argocd/helmfile-cmp/generate.sh b/argocd/helmfile-cmp/generate.sh index ff18bef9..0779c4c5 100644 --- a/argocd/helmfile-cmp/generate.sh +++ b/argocd/helmfile-cmp/generate.sh @@ -10,9 +10,7 @@ export HELM_CONFIG_HOME=/tmp/helm/config export HELMFILE_CACHE_HOME=/tmp/helmfile/cache export HELMFILE_TEMPDIR=/tmp/helmfile/tmp -[[ -v ARGOCD_ENV_HELMFILE_ENVIRONMENT ]] && export HELMFILE_ENVIRONMENT=$ARGOCD_ENV_HELMFILE_ENVIRONMENT +test -n ARGOCD_ENV_HELMFILE_ENVIRONMENT && export HELMFILE_ENVIRONMENT=$ARGOCD_ENV_HELMFILE_ENVIRONMENT +test -n ARGOCD_ENV_HELMFILE_FILE_PATH && export HELMFILE_FILE_PATH=$ARGOCD_ENV_HELMFILE_FILE_PATH -env > /tmp/$ARGOCD_APP_NAME.env - -# helmfile -n "$ARGOCD_APP_NAMESPACE" $ARGS template --include-crds -q -helmfile -n "$ARGOCD_APP_NAMESPACE" $ARGS template --include-crds --debug +helmfile -n "$ARGOCD_APP_NAMESPACE" $ARGS template --include-crds -q diff --git a/argocd/helmfile-cmp/plugin.yaml b/argocd/helmfile-cmp/plugin.yaml index 49299ff0..debd24b8 100644 --- a/argocd/helmfile-cmp/plugin.yaml +++ b/argocd/helmfile-cmp/plugin.yaml @@ -4,7 +4,8 @@ metadata: name: helmfile-cmp spec: generate: - command: [ /bin/sh ] + command: [ "/bin/sh" ] args: - /plugin/generate.sh lockRepo: false + preserveFileMode: true diff --git a/temp/argo.yaml.gotmpl b/helmfile.d/argo.yaml.gotmpl similarity index 85% rename from temp/argo.yaml.gotmpl rename to helmfile.d/argo.yaml.gotmpl index ef1b8d4d..db7cdb12 100644 --- a/temp/argo.yaml.gotmpl +++ b/helmfile.d/argo.yaml.gotmpl @@ -3,16 +3,19 @@ bases: repositories: - name: argo - url: https://argoproj.github.io/argo-helm + url: 'https://argoproj.github.io/argo-helm' commonLabels: tier: system +apiVersions: +- monitoring.coreos.com/v1 + releases: - name: argocd namespace: argocd chart: argo/argo-cd - version: 7.5.2 + version: 7.8.0 condition: argo.enabled values: - ../values/argo/values/argocd.yaml.gotmpl @@ -49,9 +52,9 @@ releases: condition: argo.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/argo/values.yaml.gotmpl - - ../values/argo/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/argo/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/temp/cert-manager.yaml.gotmpl b/helmfile.d/cert-manager.yaml.gotmpl similarity index 86% rename from temp/cert-manager.yaml.gotmpl rename to helmfile.d/cert-manager.yaml.gotmpl index cdfd03a6..90c328d0 100644 --- a/temp/cert-manager.yaml.gotmpl +++ b/helmfile.d/cert-manager.yaml.gotmpl @@ -6,7 +6,7 @@ repositories: url: 'https://charts.jetstack.io' commonLabels: - tier: sys + tier: system releases: - name: cert-manager @@ -27,9 +27,9 @@ releases: condition: cert_manager.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/cert-manager/values.yaml.gotmpl - - ../values/cert-manager/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/cert-manager/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/temp/cilium.yaml.gotmpl b/helmfile.d/cilium.yaml.gotmpl similarity index 89% rename from temp/cilium.yaml.gotmpl rename to helmfile.d/cilium.yaml.gotmpl index c3a0db2c..07416579 100644 --- a/temp/cilium.yaml.gotmpl +++ b/helmfile.d/cilium.yaml.gotmpl @@ -41,9 +41,9 @@ releases: condition: cilium.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/cilium/values.yaml.gotmpl - - ../values/cilium/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/cilium/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/temp/ingress-nginx.yaml.gotmpl b/helmfile.d/ingress-nginx.yaml.gotmpl similarity index 80% rename from temp/ingress-nginx.yaml.gotmpl rename to helmfile.d/ingress-nginx.yaml.gotmpl index 4c1ac839..2645bb14 100644 --- a/temp/ingress-nginx.yaml.gotmpl +++ b/helmfile.d/ingress-nginx.yaml.gotmpl @@ -2,11 +2,11 @@ bases: - ../envs/environments.yaml.gotmpl repositories: - - name: ingress-nginx - url: 'https://kubernetes.github.io/ingress-nginx' +- name: ingress-nginx + url: 'https://kubernetes.github.io/ingress-nginx' commonLabels: - tier: sys + tier: system releases: - name: ingress-nginx @@ -27,9 +27,9 @@ releases: condition: nginx.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/ingress-nginx/values.yaml.gotmpl - - ../values/ingress-nginx/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/ingress-nginx/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/temp/kyverno.yaml.gotmpl b/helmfile.d/kyverno.yaml.gotmpl similarity index 86% rename from temp/kyverno.yaml.gotmpl rename to helmfile.d/kyverno.yaml.gotmpl index 01ac3d5d..aa611c53 100644 --- a/temp/kyverno.yaml.gotmpl +++ b/helmfile.d/kyverno.yaml.gotmpl @@ -6,7 +6,7 @@ repositories: url: 'https://kyverno.github.io/kyverno/' commonLabels: - tier: sys + tier: system apiVersions: - monitoring.coreos.com/v1 @@ -30,9 +30,9 @@ releases: condition: kyverno.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/kyverno/values.yaml.gotmpl - - ../values/kyverno/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/kyverno/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/helmfile.d/metrics-server.yaml.gotmpl b/helmfile.d/metrics-server.yaml.gotmpl new file mode 100644 index 00000000..697ffedd --- /dev/null +++ b/helmfile.d/metrics-server.yaml.gotmpl @@ -0,0 +1,42 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: + - name: metrics-server + url: 'https://kubernetes-sigs.github.io/metrics-server/' + +commonLabels: + tier: system + +releases: +- name: metrics-server + namespace: kube-system + chart: metrics-server/metrics-server + version: 3.8.2 + condition: metrics_server.enabled + values: + - ../values/metrics-server/values/metrics-server.yaml.gotmpl + - ../values/metrics-server/values/metrics-server-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/metrics-server/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: metrics-server-manifests + namespace: kube-system + chart: _metrics-server-manifests + condition: metrics_server.enabled + missingFileHandler: Info + values: + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml + - ../values/metrics-server/values.yaml.gotmpl + - ../values/metrics-server/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/metrics-server/manifests + - _metrics-server-manifests diff --git a/temp/nfs-provisioner.yaml.gotmpl b/helmfile.d/nfs-provisioner.yaml.gotmpl similarity index 87% rename from temp/nfs-provisioner.yaml.gotmpl rename to helmfile.d/nfs-provisioner.yaml.gotmpl index 4d4484f2..c012c751 100644 --- a/temp/nfs-provisioner.yaml.gotmpl +++ b/helmfile.d/nfs-provisioner.yaml.gotmpl @@ -5,9 +5,8 @@ repositories: - name: nfs-provisioner url: 'https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/' - commonLabels: - tier: sys + tier: system releases: - name: nfs-provisioner @@ -28,9 +27,9 @@ releases: condition: nfs_provisioner.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/nfs-provisioner/values.yaml.gotmpl - - ../values/nfs-provisioner/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/nfs-provisioner/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/temp/postgres-operator.yaml.gotmpl b/helmfile.d/postgres-operator.yaml.gotmpl similarity index 88% rename from temp/postgres-operator.yaml.gotmpl rename to helmfile.d/postgres-operator.yaml.gotmpl index 3470cac2..848dce9a 100644 --- a/temp/postgres-operator.yaml.gotmpl +++ b/helmfile.d/postgres-operator.yaml.gotmpl @@ -30,9 +30,9 @@ releases: condition: postgres_operator.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/postgres-operator/values.yaml.gotmpl - - ../values/postgres-operator/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/postgres-operator/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/temp/prometheus.yaml.gotmpl b/helmfile.d/prometheus.yaml.gotmpl similarity index 86% rename from temp/prometheus.yaml.gotmpl rename to helmfile.d/prometheus.yaml.gotmpl index 5da92636..f6b37c1f 100644 --- a/temp/prometheus.yaml.gotmpl +++ b/helmfile.d/prometheus.yaml.gotmpl @@ -27,9 +27,9 @@ releases: condition: prometheus.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/prometheus/values.yaml.gotmpl - - ../values/prometheus/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/prometheus/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/helmfile.d/helmfile.yaml.gotmpl b/helmfile.d/velero.yaml.gotmpl similarity index 96% rename from helmfile.d/helmfile.yaml.gotmpl rename to helmfile.d/velero.yaml.gotmpl index 35d2f69c..06725915 100644 --- a/helmfile.d/helmfile.yaml.gotmpl +++ b/helmfile.d/velero.yaml.gotmpl @@ -8,6 +8,9 @@ repositories: commonLabels: tier: system +apiVersions: +- monitoring.coreos.com/v1 + releases: - name: velero namespace: velero diff --git a/temp/x509-exporter.yaml.gotmpl b/helmfile.d/x509-exporter.yaml.gotmpl similarity index 86% rename from temp/x509-exporter.yaml.gotmpl rename to helmfile.d/x509-exporter.yaml.gotmpl index de6ebb88..b7ef13ac 100644 --- a/temp/x509-exporter.yaml.gotmpl +++ b/helmfile.d/x509-exporter.yaml.gotmpl @@ -12,6 +12,7 @@ releases: - name: x509-exporter namespace: x509-exporter chart: x509-exporter/x509-certificate-exporter + version: 3.6.0 condition: x509_exporter.enabled values: - ../values/x509-exporter/values/x509-exporter.yaml.gotmpl @@ -26,9 +27,9 @@ releases: condition: x509_exporter.enabled missingFileHandler: Info values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml - ../values/x509-exporter/values.yaml.gotmpl - - ../values/x509-exporter/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl + - ../values/x509-exporter/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl hooks: - events: [ prepare, cleanup ] showlogs: true diff --git a/justfile b/justfile index 386ad3ad..49dfb4d2 100644 --- a/justfile +++ b/justfile @@ -2,12 +2,7 @@ default: just --list -u -# Lint a specifc helm chart -l HELMFILE ENV="default": - # helmfile --environment={{ENV}} lint --args --quiet --skip-deps --skip-refresh -f helmfile.d/{{HELMFILE}}.yaml.gotmpl - helmfile --environment={{ENV}} lint --args --quiet -f helmfile.d/{{HELMFILE}}.yaml.gotmpl - -# NOTE: Render a specifc helm chart +# Render a specifc helm chart r HELMFILE ENV="default": + helmfile --environment={{ENV}} lint --args --quiet -f helmfile.d/{{HELMFILE}}.yaml.gotmpl helmfile --environment={{ENV}} template -q -f helmfile.d/{{HELMFILE}}.yaml.gotmpl --output-dir-template="../_manifests/{{HELMFILE}}/{{ENV}}" - # helmfile --environment={{ENV}} template -q -f helmfile.d/{{HELMFILE}}.yaml.gotmpl #--output-dir-template="../_manifests/{{HELMFILE}}/{{ENV}}/{{{{.Release.Name }}" diff --git a/shell.nix b/shell.nix index f364b352..e47068dd 100644 --- a/shell.nix +++ b/shell.nix @@ -21,6 +21,7 @@ pkgs.mkShellNoCC { name = "clstr"; packages = with pkgs; [ + # nix helpers npins nix-converter @@ -29,6 +30,7 @@ pkgs.mkShellNoCC { helmfileWrap helmfile-nix + # kubectl tools kubectl-cnpg kubectl-neat ]; diff --git a/temp/metricsserver.yaml.gotmpl b/temp/metricsserver.yaml.gotmpl deleted file mode 100644 index 3c7b2c23..00000000 --- a/temp/metricsserver.yaml.gotmpl +++ /dev/null @@ -1,43 +0,0 @@ -bases: - - ../envs/environments.yaml.gotmpl - -repositories: - - name: metricsserver - url: 'https://kubernetes-sigs.github.io/metrics-server/' - - -commonLabels: - tier: sys - -releases: -- name: metricsserver - namespace: kube-system - chart: metricsserver/metricsserver - version: 3.8.2 - condition: metrics_server.enabled - values: - - ../values/metricsserver/values/metricsserver.yaml.gotmpl - - ../values/metricsserver/values/metricsserver-{{ .Environment.Name }}.yaml.gotmpl - postRenderer: ../bin/kustomizer - postRendererArgs: - - ../values/metricsserver/kustomize/{{ .Environment.Name }} - missingFileHandler: Info -- name: metricsserver-manifests - namespace: kube-system - chart: _metricsserver-manifests - condition: metrics_server.enabled - missingFileHandler: Info - values: - - ../values/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml - - ../values/metricsserver/values.yaml.gotmpl - - ../values/metricsserver/values-{{ requiredEnv "CLUSTER_NAME" }}.yaml.gotmpl - hooks: - - events: [ prepare, cleanup ] - showlogs: true - command: ../bin/helmify - args: - - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' - - '{{`{{ .Release.Chart }}`}}' - - '{{`{{ .Environment.Name }}`}}' - - ../values/metricsserver/manifests - - _metricsserver-manifests diff --git a/values/argo/manifests/argo.yaml b/values/argo/manifests/argo.yaml index af71c037..c99dfa03 100644 --- a/values/argo/manifests/argo.yaml +++ b/values/argo/manifests/argo.yaml @@ -12,13 +12,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/argocd + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: argo.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -27,6 +32,7 @@ spec: syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true + - ServerSideApply=true {{- if .Values.argocd.autosync }} automated: prune: true diff --git a/values/argo/manifests/dashboards/argocd.yaml b/values/argo/manifests/dashboards/argocd.yaml new file mode 100644 index 00000000..ffdb9ae5 --- /dev/null +++ b/values/argo/manifests/dashboards/argocd.yaml @@ -0,0 +1,4260 @@ +apiVersion: v1 +data: + argocd.json: |- + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 68, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 1 + }, + "id": 26, + "links": [], + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "![argoimage](https://avatars1.githubusercontent.com/u/30269780?s=110&v=4)", + "mode": "markdown" + }, + "pluginVersion": "9.2.4", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "transparent": true, + "type": "text" + }, + { + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 2, + "y": 1 + }, + "id": 32, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.2.4", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "time() - max(process_start_time_seconds{job=\"argocd-server-metrics\",namespace=~\"$namespace\"})", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "title": "Uptime", + "type": "stat" + }, + { + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "0" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 5, + "y": 1 + }, + "id": 94, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.2.4", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "count(count by (server) (argocd_cluster_info{namespace=~\"$namespace\"}))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "refId": "A" + } + ], + "title": "Clusters", + "type": "stat" + }, + { + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 8, + "y": 1 + }, + "id": 75, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.2.4", + "repeatDirection": "h", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_app_info{namespace=~\"$namespace\",dest_server=~\"$cluster\",health_status=~\"$health_status\",sync_status=~\"$sync_status\"})", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "refId": "A" + } + ], + "title": "Applications", + "type": "stat" + }, + { + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "0" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 11, + "y": 1 + }, + "id": 107, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.2.4", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "count(count by (repo) (argocd_app_info{namespace=~\"$namespace\"}))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "refId": "A" + } + ], + "title": "Repositories", + "type": "stat" + }, + { + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "0", + "type": 1, + "value": "null" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 14, + "y": 1 + }, + "id": 100, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.2.4", + "repeatDirection": "h", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_app_info{namespace=~\"$namespace\",dest_server=~\"$cluster\",operation!=\"\"})", + "format": "time_series", + "instant": true, + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "title": "Operations", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 4, + "w": 7, + "x": 17, + "y": 1 + }, + "hiddenSeries": false, + "id": 28, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_app_info{namespace=~\"$namespace\",dest_server=~\"$cluster\",health_status=~\"$health_status\",sync_status=~\"$sync_status\"}) by (namespace)", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "{{`{{namespace}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Applications", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 77, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Application Status", + "type": "row" + }, + { + "aliasColors": { + "Degraded": "semi-dark-red", + "Healthy": "green", + "Missing": "semi-dark-purple", + "Progressing": "semi-dark-blue", + "Suspended": "semi-dark-orange", + "Unknown": "rgb(255, 255, 255)" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 6 + }, + "hiddenSeries": false, + "id": 105, + "interval": "", + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_app_info{namespace=~\"$namespace\",dest_server=~\"$cluster\",health_status=~\"$health_status\",sync_status=~\"$sync_status\",health_status!=\"\"}) by (health_status)", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "{{`{{health_status}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Health Status", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 2, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": { + "Degraded": "semi-dark-red", + "Healthy": "green", + "Missing": "semi-dark-purple", + "OutOfSync": "semi-dark-yellow", + "Progressing": "semi-dark-blue", + "Suspended": "semi-dark-orange", + "Synced": "semi-dark-green", + "Unknown": "rgb(255, 255, 255)" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 6 + }, + "hiddenSeries": false, + "id": 106, + "interval": "", + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_app_info{namespace=~\"$namespace\",dest_server=~\"$cluster\",health_status=~\"$health_status\",sync_status=~\"$sync_status\",health_status!=\"\"}) by (sync_status)", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "{{`{{sync_status}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Sync Status", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 2, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 104, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Sync Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 13 + }, + "hiddenSeries": false, + "id": 56, + "interval": "", + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 1, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(round(increase(argocd_app_sync_total{namespace=~\"$namespace\",dest_server=~\"$cluster\"}[$interval]))) by ($grouping)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{$grouping}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Sync Activity", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "min": "0", + "show": true + }, + { + "decimals": -12, + "format": "short", + "label": "", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 19 + }, + "hiddenSeries": false, + "id": 73, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "hideEmpty": true, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(round(increase(argocd_app_sync_total{namespace=~\"$namespace\",phase=~\"Error|Failed\",dest_server=~\"$cluster\"}[$interval]))) by ($grouping, phase)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{phase}}`}}: {{`{{$grouping}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Sync Failures", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "label": "", + "logBase": 1, + "min": "0", + "show": true + }, + { + "format": "short", + "label": "", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 64, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Controller Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 25 + }, + "hiddenSeries": false, + "id": 58, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_app_reconcile_count{namespace=~\"$namespace\",dest_server=~\"$cluster\"}[$interval])) by ($grouping)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{$grouping}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Reconciliation Activity", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "cards": {}, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateSpectral", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "tsbuckets", + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 31 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 60, + "legend": { + "show": true + }, + "links": [], + "options": { + "calculate": false, + "calculation": {}, + "cellGap": 2, + "cellValues": { + "decimals": 0 + }, + "color": { + "exponent": 0.5, + "fill": "#b4ff00", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 128 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "showValue": "never", + "tooltip": { + "show": true, + "yHistogram": true + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "short" + } + }, + "pluginVersion": "9.2.4", + "reverseYBuckets": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_app_reconcile_bucket{namespace=~\"$namespace\"}[$interval])) by (le)", + "format": "heatmap", + "instant": false, + "intervalFactor": 10, + "legendFormat": "{{`{{le}}`}}", + "refId": "A" + } + ], + "title": "Reconciliation Performance", + "tooltip": { + "show": true, + "showHistogram": true + }, + "tooltipDecimals": 0, + "type": "heatmap", + "xAxis": { + "show": true + }, + "yAxis": { + "format": "short", + "logBase": 1, + "show": true + }, + "yBucketBound": "auto" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 38 + }, + "hiddenSeries": false, + "id": 80, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_app_k8s_request_total{namespace=~\"$namespace\",server=~\"$cluster\"}[$interval])) by (verb, resource_kind)", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "{{`{{verb}}`}} {{`{{resource_kind}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "K8s API Activity", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 44 + }, + "hiddenSeries": false, + "id": 96, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideZero": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(workqueue_depth{namespace=~\"$namespace\",name=~\"app_.*\"}) by (name)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{name}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Workqueue Depth", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "min": "0", + "show": true + }, + { + "format": "short", + "logBase": 1, + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 44 + }, + "hiddenSeries": false, + "id": 98, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideZero": false, + "max": true, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_kubectl_exec_pending{namespace=~\"$namespace\"}) by (command)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{command}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Pending kubectl run", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "min": "0", + "show": true + }, + { + "decimals": 0, + "format": "short", + "label": "", + "logBase": 1, + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 51 + }, + "id": 102, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Controller Telemetry", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 52 + }, + "hiddenSeries": false, + "id": 34, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "editorMode": "code", + "expr": "go_memstats_heap_alloc_bytes{job=~\"argocd-application-controller-metrics|argocd-applicationset-controller-metrics\",namespace=\"$namespace\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{namespace}}`}}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Memory Usage", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 59 + }, + "hiddenSeries": false, + "id": 108, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "editorMode": "code", + "expr": "irate(process_cpu_seconds_total{job=~\"argocd-notifications-controller-metrics|argocd-applicationset-controller-metrics\",namespace=~\"$namespace\"}[1m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{namespace}}`}}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "CPU Usage", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 1, + "format": "none", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 66 + }, + "hiddenSeries": false, + "id": 62, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": false, + "hideZero": false, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "editorMode": "code", + "expr": "go_goroutines{job=~\"argocd-application-controller-metrics|argocd-applicationset-controller-metrics\",namespace=~\"$namespace\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{namespace}}`}}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Goroutines", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 73 + }, + "id": 88, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Cluster Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 74 + }, + "hiddenSeries": false, + "id": 90, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(argocd_cluster_api_resource_objects{namespace=~\"$namespace\",server=~\"$cluster\"}) by (server)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{server}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Resource Objects Count", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 81 + }, + "hiddenSeries": false, + "id": 92, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": " sum(argocd_cluster_api_resources{namespace=~\"$namespace\",server=~\"$cluster\"}) by (server)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{server}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "API Resources Count", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 87 + }, + "hiddenSeries": false, + "id": 86, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_cluster_events_total{namespace=~\"$namespace\",server=~\"$cluster\"}[$interval])) by (server)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{server}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Cluster Events Count", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 94 + }, + "id": 70, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Repo Server Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 95 + }, + "hiddenSeries": false, + "id": 82, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_git_request_total{request_type=\"ls-remote\", namespace=~\"$namespace\"}[10m])) by (namespace)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{namespace}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Git Requests (ls-remote)", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 95 + }, + "hiddenSeries": false, + "id": 84, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_git_request_total{request_type=\"fetch\", namespace=~\"$namespace\"}[10m])) by (namespace)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{namespace}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Git Requests (checkout)", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "cards": {}, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateSpectral", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "tsbuckets", + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 103 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 114, + "legend": { + "show": false + }, + "options": { + "calculate": false, + "calculation": {}, + "cellGap": 2, + "cellValues": {}, + "color": { + "exponent": 0.5, + "fill": "#b4ff00", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 128 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": false + }, + "rowsFrame": { + "layout": "auto" + }, + "showValue": "never", + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "short" + } + }, + "pluginVersion": "9.2.4", + "reverseYBuckets": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_git_request_duration_seconds_bucket{request_type=\"fetch\", namespace=~\"$namespace\"}[$interval])) by (le)", + "format": "heatmap", + "intervalFactor": 10, + "legendFormat": "{{`{{le}}`}}", + "refId": "A" + } + ], + "title": "Git Fetch Performance", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "yAxis": { + "format": "short", + "logBase": 1, + "show": true + }, + "yBucketBound": "auto" + }, + { + "cards": {}, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateSpectral", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "tsbuckets", + "datasource": { + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 103 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 116, + "legend": { + "show": false + }, + "options": { + "calculate": false, + "calculation": {}, + "cellGap": 2, + "cellValues": {}, + "color": { + "exponent": 0.5, + "fill": "#b4ff00", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 128 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": false + }, + "rowsFrame": { + "layout": "auto" + }, + "showValue": "never", + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "short" + } + }, + "pluginVersion": "9.2.4", + "reverseYBuckets": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(argocd_git_request_duration_seconds_bucket{request_type=\"ls-remote\", namespace=~\"$namespace\"}[$interval])) by (le)", + "format": "heatmap", + "intervalFactor": 10, + "legendFormat": "{{`{{le}}`}}", + "refId": "A" + } + ], + "title": "Git Ls-Remote Performance", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "yAxis": { + "format": "short", + "logBase": 1, + "show": true + }, + "yBucketBound": "auto" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 111 + }, + "hiddenSeries": false, + "id": 71, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "editorMode": "code", + "expr": "go_memstats_heap_alloc_bytes{job=\"argocd-repo-server-metrics\",namespace=~\"$namespace\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{pod}}`}}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Memory Used", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 119 + }, + "hiddenSeries": false, + "id": 72, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "editorMode": "code", + "expr": "go_goroutines{job=\"argocd-repo-server-metrics\",namespace=~\"$namespace\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{pod}}`}}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Goroutines", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "uid": "$datasource" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 126 + }, + "id": 66, + "panels": [], + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Server Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 127 + }, + "hiddenSeries": false, + "id": 61, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "go_memstats_heap_alloc_bytes{job=\"argocd-server-metrics\",namespace=~\"$namespace\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Memory Used", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "logBase": 1, + "min": "0", + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 135 + }, + "hiddenSeries": false, + "id": 36, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "go_goroutines{job=\"argocd-server-metrics\",namespace=~\"$namespace\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Goroutines", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 144 + }, + "hiddenSeries": false, + "id": 38, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "go_gc_duration_seconds{job=\"argocd-server-metrics\", quantile=\"1\", namespace=~\"$namespace\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{`{{pod}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "GC Time Quantiles", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "gridPos": { + "h": 2, + "w": 24, + "x": 0, + "y": 153 + }, + "id": 54, + "links": [], + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "#### gRPC Services:", + "mode": "markdown" + }, + "pluginVersion": "9.2.4", + "transparent": true, + "type": "text" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 155 + }, + "hiddenSeries": false, + "id": 40, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"application.ApplicationService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "ApplicationService Requests", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 155 + }, + "hiddenSeries": false, + "id": 42, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"cluster.ClusterService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "ClusterService Requests", + "tooltip": { + "shared": false, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 164 + }, + "hiddenSeries": false, + "id": 44, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"project.ProjectService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "ProjectService Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 164 + }, + "hiddenSeries": false, + "id": 46, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"repository.RepositoryService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [ + { + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "yaxis": "left" + } + ], + "timeRegions": [], + "title": "RepositoryService Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 173 + }, + "hiddenSeries": false, + "id": 48, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"session.SessionService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "SessionService Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 173 + }, + "hiddenSeries": false, + "id": 49, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"version.VersionService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "VersionService Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 182 + }, + "hiddenSeries": false, + "id": 50, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"account.AccountService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "AccountService Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 182 + }, + "hiddenSeries": false, + "id": 99, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "paceLength": 10, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(grpc_server_handled_total{job=\"argocd-server-metrics\",grpc_service=\"settings.SettingsService\",namespace=~\"$namespace\"}[$interval])) by (grpc_code, grpc_method)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{`{{grpc_code}}`}},{{`{{grpc_method}}`}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "SettingsService Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 191 + }, + "id": 110, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Redis Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 192 + }, + "hiddenSeries": false, + "id": 112, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.2.4", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum(increase(argocd_redis_request_total{namespace=~\"$namespace\"}[$interval])) by (failed)", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Requests by result", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "refresh": false, + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": "argocd", + "value": "argocd" + }, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "definition": "label_values(kube_pod_info, namespace)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(kube_pod_info, namespace)", + "refId": "Prometheus-namespace-Variable-Query" + }, + "refresh": 1, + "regex": ".*argocd.*", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "auto": true, + "auto_count": 30, + "auto_min": "1m", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "2h", + "value": "2h" + }, + { + "selected": false, + "text": "4h", + "value": "4h" + }, + { + "selected": false, + "text": "8h", + "value": "8h" + } + ], + "query": "1m,5m,10m,30m,1h,2h,4h,8h", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "allValue": "", + "current": { + "selected": true, + "text": "namespace", + "value": "namespace" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "grouping", + "options": [ + { + "selected": true, + "text": "namespace", + "value": "namespace" + }, + { + "selected": false, + "text": "name", + "value": "name" + }, + { + "selected": false, + "text": "project", + "value": "project" + } + ], + "query": "namespace,name,project", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": ".*", + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "definition": "label_values(argocd_cluster_info, server)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "query": "label_values(argocd_cluster_info, server)", + "refId": "Prometheus-cluster-Variable-Query" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, + "hide": 0, + "includeAll": true, + "multi": false, + "name": "health_status", + "options": [ + { + "selected": true, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "Healthy", + "value": "Healthy" + }, + { + "selected": false, + "text": "Progressing", + "value": "Progressing" + }, + { + "selected": false, + "text": "Suspended", + "value": "Suspended" + }, + { + "selected": false, + "text": "Missing", + "value": "Missing" + }, + { + "selected": false, + "text": "Degraded", + "value": "Degraded" + }, + { + "selected": false, + "text": "Unknown", + "value": "Unknown" + } + ], + "query": "Healthy,Progressing,Suspended,Missing,Degraded,Unknown", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, + "hide": 0, + "includeAll": true, + "multi": false, + "name": "sync_status", + "options": [ + { + "selected": true, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "Synced", + "value": "Synced" + }, + { + "selected": false, + "text": "OutOfSync", + "value": "OutOfSync" + }, + { + "selected": false, + "text": "Unknown", + "value": "Unknown" + } + ], + "query": "Synced,OutOfSync,Unknown", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-30m", + "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": "ArgoCD", + "uid": "LCAgc9rWz", + "version": 1, + "weekStart": "" + } +kind: ConfigMap +metadata: + name: argocd-dashboard + namespace: prometheus + labels: + grafana_dashboard: "1" diff --git a/values/argo/manifests/nodeport.yaml b/values/argo/manifests/nodeport.yaml new file mode 100644 index 00000000..af3329fe --- /dev/null +++ b/values/argo/manifests/nodeport.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + name: argocd-server-nodeport + namespace: argocd +spec: + clusterIP: 10.102.84.163 + clusterIPs: + - 10.102.84.163 + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: http + nodePort: 30290 + port: 80 + targetPort: 8080 + - name: https + nodePort: 31261 + port: 443 + targetPort: 8080 + selector: + app.kubernetes.io/instance: argocd + app.kubernetes.io/name: argocd-server + type: NodePort diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-applicationset-ingress.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-applicationset-ingress.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-applicationset-ingress.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-applicationset-ingress.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-argo-notifications.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-argo-notifications.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-argo-notifications.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-argo-notifications.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-argo-repo-access-applicationset.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-argo-repo-access-applicationset.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-argo-repo-access-applicationset.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-argo-repo-access-applicationset.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-argo-repo-access.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-argo-repo-access.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-argo-repo-access.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-argo-repo-access.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-chartmuseum-ingress.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-chartmuseum-ingress.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-chartmuseum-ingress.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-chartmuseum-ingress.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-image-updater-repo-access.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-image-updater-repo-access.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-image-updater-repo-access.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-image-updater-repo-access.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-ingress.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-ingress.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-ingress.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-ingress.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-kube-api.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-kube-api.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-kube-api.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-kube-api.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-microsoft-sso.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-microsoft-sso.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-microsoft-sso.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-microsoft-sso.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-prometheus-metrics-rollout.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics-rollout.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-prometheus-metrics-rollout.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics-rollout.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-prometheus-metrics-workflows.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics-workflows.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-prometheus-metrics-workflows.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics-workflows.yaml diff --git a/values/argo/manifests/cilium/CiliumNetworkPolicy-allow-prometheus-metrics.yaml b/values/argo/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml similarity index 100% rename from values/argo/manifests/cilium/CiliumNetworkPolicy-allow-prometheus-metrics.yaml rename to values/argo/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml diff --git a/values/argo/manifests/sys-project.yaml b/values/argo/manifests/sys-project.yaml new file mode 100644 index 00000000..87c72b31 --- /dev/null +++ b/values/argo/manifests/sys-project.yaml @@ -0,0 +1,84 @@ +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: sys + namespace: argocd +spec: + clusterResourceWhitelist: + - group: '*' + kind: '*' + description: sys components project + destinations: + - namespace: argocd + server: https://kubernetes.default.svc + - namespace: kube-system + server: https://kubernetes.default.svc + - namespace: ingress-nginx + server: https://kubernetes.default.svc + - namespace: serit-operator + server: https://kubernetes.default.svc + - namespace: prometheus + server: https://kubernetes.default.svc + - namespace: cnpg + server: https://kubernetes.default.svc + - namespace: cert-manager + server: https://kubernetes.default.svc + - namespace: kubernetes-dashboard + server: https://kubernetes.default.svc + - namespace: rabbitmq + server: https://kubernetes.default.svc + - namespace: sealed-secrets + server: https://kubernetes.default.svc + - namespace: gitlab + server: https://kubernetes.default.svc + - namespace: thanos + server: https://kubernetes.default.svc + - namespace: linkerd + server: https://kubernetes.default.svc + - namespace: linkerd-multicluster + server: https://kubernetes.default.svc + - namespace: observability + server: https://kubernetes.default.svc + - namespace: kyverno + server: https://kubernetes.default.svc + - namespace: velero + server: https://kubernetes.default.svc + - namespace: loki + server: https://kubernetes.default.svc + - namespace: x509-exporter + server: https://kubernetes.default.svc + - namespace: mariadb-operator + server: https://kubernetes.default.svc + - namespace: cilium-spire + server: https://kubernetes.default.svc + - namespace: cilium-test + server: https://kubernetes.default.svc + - namespace: cilium-secrets + server: https://kubernetes.default.svc + sourceRepos: + - https://argoproj.github.io/argo-helm + - https://kubernetes-sigs.github.io/metrics-server/ + - https://gitlab.com/oceanbox/manifests.git + - https://gitlab.com/serit/k8s/serit-platform.git + - https://gitlab.com/serit/k8s/serit-platform-values.git + - https://gitlab.com/serit/k8s/serit-platform-manifests.git + - https://gitlab.com/serit/k8s/serit-operator.git + - https://kubernetes.github.io/ingress-nginx + - https://cloudnative-pg.github.io/charts + - https://charts.jetstack.io + - https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/ + - https://github.com/kubernetes/dashboard + - https://bitnami-labs.github.io/sealed-secrets + - https://prometheus-community.github.io/helm-charts + - https://github.com/prometheus-community/helm-charts.git + - https://charts.gitlab.io/ + - https://charts.bitnami.com/bitnami + - https://helm.linkerd.io/stable + - https://github.com/jaegertracing/jaeger-operator + - https://kyverno.github.io/kyverno/ + - https://vmware-tanzu.github.io/helm-charts + - https://grafana.github.io/helm-charts + - https://charts.enix.io + - https://helm.mariadb.com/mariadb-operator + - https://helm.cilium.io + - https://chartmuseum.github.io/charts diff --git a/values/argo/values.yaml.gotmpl b/values/argo/values.yaml.gotmpl index f9c189e1..9e70b222 100644 --- a/values/argo/values.yaml.gotmpl +++ b/values/argo/values.yaml.gotmpl @@ -8,12 +8,28 @@ argo: enabled: false argocd: + autosync: true + ingress: + enabled: true + adminLogin: false + kustomizeHelmSupport: false + applicationset_webhook: + enabled: false anyNamespaces: enabled: false glob: "" + resources: + controller: + memory: 2000Mi + cpu: 250m repoServers: - name: "helmfile-cmp" image: "registry.gitlab.com/oceanbox/manifests/helmfile-cmp:latest" - imagePullSecret: [] + imagePullSecrets: + - gitlab-pull-secret + - name: "kustomize-helm-with-rewrite" + image: "registry.gitlab.com/oceanbox/manifests/kustomize-helm-with-rewrite:latest" + imagePullSecrets: + - gitlab-pull-secret additional_rbac_settings: - g, "eb17a659-4ce6-41bc-9153-d9b117c44479", role:org-admin diff --git a/values/argo/values/argocd.yaml.gotmpl b/values/argo/values/argocd.yaml.gotmpl index b8e355ca..c5dcf11a 100644 --- a/values/argo/values/argocd.yaml.gotmpl +++ b/values/argo/values/argocd.yaml.gotmpl @@ -135,10 +135,10 @@ controller: enabled: true resources: limits: - memory: "1000Mi" + memory: {{ .Values.argocd.resources.controller.memory | default "1000Mi" }} requests: - cpu: "250m" - memory: "1000Mi" + cpu: {{ .Values.argocd.resources.controller.cpu | default "250m" }} + memory: {{ .Values.argocd.resources.controller.memory | default "1000Mi" }} # Mount azure ca as file for SAML auth dex: @@ -175,6 +175,25 @@ repoServer: enabled: true {{- range .Values.argocd.repoServers }} extraContainers: + - command: + - /var/run/argocd/argocd-cmp-server + image: registry.gitlab.com/oceanbox/manifests/helmfile-cmp:latest + imagePullPolicy: Always + name: helmfile-cmp + securityContext: + runAsNonRoot: true + runAsUser: 999 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/argocd + name: var-files + - mountPath: /home/argocd/cmp-server/plugins + name: plugins + - mountPath: /tmp + name: cmp-tmp + - mountPath: /helm-working-dir + name: helm-working-dir - command: - /var/run/argocd/argocd-cmp-server image: {{ .image }} @@ -196,10 +215,40 @@ repoServer: - name: cmp-tmp emptyDir: {} imagePullSecrets: - {{- range .imagePullSecret }} - - name: {{ .name }} + {{- range .imagePullSecrets }} + - name: {{ . }} {{- end }} {{- end }} + initContainers: + - command: + - /bin/sh + - /plugin/init-helm-repos.sh + env: + - name: OCEANBOX_HELM_ACCESS_TOKEN + valueFrom: + secretKeyRef: + key: token + name: oceanbox-helm + optional: false + image: registry.gitlab.com/oceanbox/manifests/kustomize-helm-with-rewrite:latest + imagePullPolicy: Always + name: init-helm-repos + resources: {} + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 999 + seccompProfile: + type: RuntimeDefault + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /helm-working-dir + name: helm-working-dir # Configuration for argocd server instance server: diff --git a/values/cert-manager/manifests/cert-manager.yaml b/values/cert-manager/manifests/cert-manager.yaml index b75be7be..de1227bc 100644 --- a/values/cert-manager/manifests/cert-manager.yaml +++ b/values/cert-manager/manifests/cert-manager.yaml @@ -4,8 +4,6 @@ kind: Application metadata: name: cert-manager namespace: argocd - annotations: - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true finalizers: - resources-finalizer.argocd.argoproj.io spec: @@ -14,13 +12,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/cert-manager + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: cert-manager.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -29,7 +32,7 @@ spec: syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true - # - ServerSideApply=true + - ServerSideApply=true {{- if .Values.cert_manager.autosync }} automated: prune: true diff --git a/values/cert-manager/manifests/pre-cert-manager.yaml b/values/cert-manager/manifests/pre-cert-manager.yaml index 8d6a498a..a022015b 100644 --- a/values/cert-manager/manifests/pre-cert-manager.yaml +++ b/values/cert-manager/manifests/pre-cert-manager.yaml @@ -10,7 +10,7 @@ spec: # The ACME server URL server: https://acme-v02.api.letsencrypt.org/directory # Email address used for ACME registration - email: {{ .Values.cluster_config.acme_email }} + email: {{ .Values.clusterConfig.acme_email }} # Name of a secret used to store the ACME account private key privateKeySecretRef: name: letsencrypt-production @@ -30,7 +30,7 @@ spec: # The ACME server URL server: https://acme-staging-v02.api.letsencrypt.org/directory # Email address used for ACME registration - email: {{ .Values.cluster_config.acme_email }} + email: {{ .Values.clusterConfig.acme_email }} # Name of a secret used to store the ACME account private key privateKeySecretRef: name: letsencrypt-staging @@ -93,7 +93,7 @@ rules: - watch --- -{{ if .Values.cluster_config.initca }} +{{ if .Values.clusterConfig.initca }} # Pod to update certificates from master nodes # only runs on control plane nodes (etcd) @@ -153,11 +153,11 @@ spec: volumes: - name: ca-pem hostPath: - path: {{.Values.cluster_config.initca}}/ca.pem + path: {{.Values.clusterConfig.initca}}/ca.pem type: File - name: ca-key-pem hostPath: - path: {{.Values.cluster_config.initca}}/ca-key.pem + path: {{.Values.clusterConfig.initca}}/ca-key.pem type: File - name: certs-script configMap: diff --git a/values/cilium/cilium-manifests/cilium-test/CiliumNetworkPolicy-allow-api-server.yaml b/values/cilium/cilium-manifests/cilium-test/CiliumNetworkPolicy-allow-api-server.yaml deleted file mode 100644 index 28045ea2..00000000 --- a/values/cilium/cilium-manifests/cilium-test/CiliumNetworkPolicy-allow-api-server.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: cilium.io/v2 -kind: CiliumNetworkPolicy -metadata: - name: allow-api-server - namespace: cilium-test -spec: - egress: - - toEndpoints: - - {} - - toEntities: - - cluster - - toEntities: - - remote-node - - toEntities: - - world - endpointSelector: - matchLabels: {} - ingress: - - fromEntities: - - cluster - - fromEntities: - - world diff --git a/values/cilium/cilium-manifests/cilium.yaml b/values/cilium/cilium-manifests/cilium.yaml index b58f5223..a5b3557d 100644 --- a/values/cilium/cilium-manifests/cilium.yaml +++ b/values/cilium/cilium-manifests/cilium.yaml @@ -12,13 +12,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/cilium + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: cilium.yaml.gotmpl project: sys syncPolicy: syncOptions: diff --git a/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-s3.yaml b/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-s3.yaml deleted file mode 100644 index eb551ed8..00000000 --- a/values/cilium/cilium-manifests/policies/CiliumClusterwideNetworkPolicy-allow-s3.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: cilium.io/v2 -kind: CiliumClusterwideNetworkPolicy -metadata: - name: allow-s3-traffic -spec: - description: Policy for egress for CNPG Backups. - egress: - - toFQDNs: - {{- range .Values.clusterConfig.s3.hosts }} - - matchName: {{ . | quote }} - {{- end }} - {{- range .Values.clusterConfig.s3.patterns }} - - matchPattern: {{ . | quote }} - {{- end }} - - toCIDR: - {{- range .Values.clusterConfig.s3.cidr }} - - {{ . | quote }} - {{- end }} - endpointSelector: - matchLabels: {} diff --git a/values/cilium/values-oceanbox.yaml.gotmpl b/values/cilium/values-oceanbox.yaml.gotmpl index 6ae6980a..676526db 100644 --- a/values/cilium/values-oceanbox.yaml.gotmpl +++ b/values/cilium/values-oceanbox.yaml.gotmpl @@ -1,9 +1,9 @@ cilium: enabled: true nodePort: - enable: true + enabled: true l2announcement: - enable: true + enabled: true loadbalancerPool: enabled: true cidr: @@ -12,4 +12,3 @@ cilium: - 10.255.241.13/32 - 10.255.241.14/32 - 10.255.241.15/32 - diff --git a/values/cilium/values.yaml.gotmpl b/values/cilium/values.yaml.gotmpl index 6163164c..c7cee1b0 100644 --- a/values/cilium/values.yaml.gotmpl +++ b/values/cilium/values.yaml.gotmpl @@ -16,6 +16,7 @@ cilium: enabled: false nodePort: enabled: false + # NOTE: Requires that ingresscontroller is also enabled gatewayAPI: enabled: false ingressController: @@ -23,7 +24,7 @@ cilium: defaultClass: false loadbalancerMode: shared policyAuditMode: false - upgradeCompatability: 1.15 + upgradeCompatability: 1.16 k8sServiceHost: localhost k8sServicePort: 7445 loadbalancerPool: diff --git a/values/cilium/values/cilium.yaml.gotmpl b/values/cilium/values/cilium.yaml.gotmpl index 61d3d62f..14fe29bb 100644 --- a/values/cilium/values/cilium.yaml.gotmpl +++ b/values/cilium/values/cilium.yaml.gotmpl @@ -83,6 +83,7 @@ prometheus: serviceMonitor: enabled: true rollOutCiliumPods: true +podSecurityContext: null securityContext: capabilities: ciliumAgent: diff --git a/values/ingress-nginx/manifests/ingress-nginx.yaml b/values/ingress-nginx/manifests/ingress-nginx.yaml index 7a12b854..0622842b 100644 --- a/values/ingress-nginx/manifests/ingress-nginx.yaml +++ b/values/ingress-nginx/manifests/ingress-nginx.yaml @@ -12,20 +12,27 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/ingress-nginx + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: ingress-nginx.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: labels: component: sys syncOptions: - - ServerSideApply=true + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + - ServerSideApply=true {{- if .Values.nginx.autosync }} automated: prune: true diff --git a/values/ingress-nginx/values/ingress-nginx.yaml.gotmpl b/values/ingress-nginx/values/ingress-nginx.yaml.gotmpl index 9f02ff85..44f80e33 100644 --- a/values/ingress-nginx/values/ingress-nginx.yaml.gotmpl +++ b/values/ingress-nginx/values/ingress-nginx.yaml.gotmpl @@ -7,8 +7,8 @@ fullnameOverride: main-ingress-nginx controller: resources: - limits: - memory: {{ .Values.nginx.resources.controller.memory }} + #limits: + # memory: {{ .Values.nginx.resources.controller.memory }} requests: cpu: {{ .Values.nginx.resources.controller.cpu }} memory: {{ .Values.nginx.resources.controller.memory }} diff --git a/values/kyverno/manifests/kyverno.yaml b/values/kyverno/manifests/kyverno.yaml index b255f435..77ba5897 100644 --- a/values/kyverno/manifests/kyverno.yaml +++ b/values/kyverno/manifests/kyverno.yaml @@ -10,13 +10,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/kyverno + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: kyverno.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -25,7 +30,7 @@ spec: syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true - # - ServerSideApply=true + - ServerSideApply=true {{- if .Values.kyverno.autosync }} automated: prune: true diff --git a/values/kyverno/manifests/policies/sync-gitlab.yaml b/values/kyverno/manifests/policies/sync-gitlab.yaml index 35f7304f..d20f865c 100644 --- a/values/kyverno/manifests/policies/sync-gitlab.yaml +++ b/values/kyverno/manifests/policies/sync-gitlab.yaml @@ -16,6 +16,7 @@ metadata: spec: rules: - name: sync-image-pull-secret + skipBackgroundRequests: true match: resources: kinds: diff --git a/values/kyverno/manifests/policies/sync-regcred.yaml b/values/kyverno/manifests/policies/sync-regcred.yaml index 2ee8df33..abaf2691 100644 --- a/values/kyverno/manifests/policies/sync-regcred.yaml +++ b/values/kyverno/manifests/policies/sync-regcred.yaml @@ -17,6 +17,7 @@ metadata: spec: rules: - name: sync-image-pull-secret + skipBackgroundRequests: true match: resources: kinds: diff --git a/values/kyverno/manifests/policies/sync-s3-secret.yaml b/values/kyverno/manifests/policies/sync-s3-secret.yaml index b1f1ea03..002579e5 100644 --- a/values/kyverno/manifests/policies/sync-s3-secret.yaml +++ b/values/kyverno/manifests/policies/sync-s3-secret.yaml @@ -29,5 +29,6 @@ spec: - "loki" - "tempo" name: sync-s3-secret + skipBackgroundRequests: true validationFailureAction: audit {{- end }} diff --git a/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml b/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml index 289f30de..d032d268 100644 --- a/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml +++ b/values/kyverno/manifests/policies/whitelist-internal-ingresses.yaml @@ -17,6 +17,7 @@ spec: #precondition: has whitelist annotation or rules: - name: ensure-nginx-whitelist-exists + skipBackgroundRequests: true match: resources: kinds: @@ -30,6 +31,7 @@ spec: annotations: +(nginx.ingress.kubernetes.io/whitelist-source-range): "" - name: append-existing-whitelist + skipBackgroundRequests: true match: resources: kinds: @@ -46,10 +48,11 @@ spec: patchStrategicMerge: metadata: annotations: - {{- with .Values.cluster_config.ingress_whitelist_ips }} + {{- with .Values.clusterConfig.ingress_whitelist_ips }} nginx.ingress.kubernetes.io/whitelist-source-range: "{{`{{ @ }}`}},{{ join "," . }}" {{- end }} - name: add-nginx-whitelist + skipBackgroundRequests: true match: resources: kinds: @@ -66,7 +69,7 @@ spec: patchStrategicMerge: metadata: annotations: - {{- with .Values.cluster_config.ingress_whitelist_ips }} + {{- with .Values.clusterConfig.ingress_whitelist_ips }} nginx.ingress.kubernetes.io/whitelist-source-range: "{{ join "," . }}" {{- end }} {{- end }} diff --git a/values/kyverno/values.yaml.gotmpl b/values/kyverno/values.yaml.gotmpl index 7f97294d..173c470b 100644 --- a/values/kyverno/values.yaml.gotmpl +++ b/values/kyverno/values.yaml.gotmpl @@ -1,6 +1,6 @@ kyverno: enabled: true - autosync: false + autosync: true metrics: false resources: cleanupController: diff --git a/values/metricsserver/manifests/metricsserver.yaml b/values/metrics-server/manifests/metrics-server.yaml similarity index 71% rename from values/metricsserver/manifests/metricsserver.yaml rename to values/metrics-server/manifests/metrics-server.yaml index 0a72c1df..530b6c87 100644 --- a/values/metricsserver/manifests/metricsserver.yaml +++ b/values/metrics-server/manifests/metrics-server.yaml @@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: metricsserver + name: metrics-server namespace: argocd finalizers: - resources-finalizer.argocd.argoproj.io @@ -12,13 +12,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/metricsserver + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: metrics-server.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -27,7 +32,7 @@ spec: syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true - # - ServerSideApply=true + - ServerSideApply=true {{- if .Values.metrics_server.autosync }} automated: prune: true diff --git a/values/metricsserver/values.yaml.gotmpl b/values/metrics-server/values.yaml.gotmpl similarity index 50% rename from values/metricsserver/values.yaml.gotmpl rename to values/metrics-server/values.yaml.gotmpl index e71a5877..20e345c4 100644 --- a/values/metricsserver/values.yaml.gotmpl +++ b/values/metrics-server/values.yaml.gotmpl @@ -1,4 +1,4 @@ -metricsserver: +metrics_server: enabled: true autosync: true - ignoreTLS: false \ No newline at end of file + ignoreTLS: false diff --git a/values/metricsserver/values/metricsserver.yaml.gotmpl b/values/metrics-server/values/metrics-server.yaml.gotmpl similarity index 71% rename from values/metricsserver/values/metricsserver.yaml.gotmpl rename to values/metrics-server/values/metrics-server.yaml.gotmpl index deaaa3e4..21658d31 100644 --- a/values/metricsserver/values/metricsserver.yaml.gotmpl +++ b/values/metrics-server/values/metrics-server.yaml.gotmpl @@ -1,9 +1,9 @@ containerPort: 10250 resources: requests: - cpu: 100m - memory: 200Mi + cpu: 100m + memory: 200Mi {{- if .Values.metrics_server.ignoreTLS }} args: - "--kubelet-insecure-tls" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/values/nfs-provisioner/manifests/nfs-provisioner.yaml b/values/nfs-provisioner/manifests/nfs-provisioner.yaml index 63fa319a..2730bc95 100644 --- a/values/nfs-provisioner/manifests/nfs-provisioner.yaml +++ b/values/nfs-provisioner/manifests/nfs-provisioner.yaml @@ -4,23 +4,24 @@ kind: Application metadata: name: nfs-provisioner namespace: argocd - annotations: - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true - finalizers: - - resources-finalizer.argocd.argoproj.io spec: destination: namespace: kube-system server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/nfs-provisioner + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: nfs-provisioner.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -29,7 +30,7 @@ spec: syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true - # - ServerSideApply=true + - ServerSideApply=true {{- if .Values.nfs_provisioner.autosync }} automated: prune: true diff --git a/values/nfs-provisioner/values-oceanbox.yaml.gotmpl b/values/nfs-provisioner/values-oceanbox.yaml.gotmpl new file mode 100644 index 00000000..58d5d7be --- /dev/null +++ b/values/nfs-provisioner/values-oceanbox.yaml.gotmpl @@ -0,0 +1,8 @@ +nfs_provisioner: + enabled: true + autosync: true + archiveOnDelete: true + defaultClass: true + path: "oceanbox" + extraMountOpts: + - soft diff --git a/values/nfs-provisioner/values.yaml.gotmpl b/values/nfs-provisioner/values.yaml.gotmpl index 17ed8833..d15702a8 100644 --- a/values/nfs-provisioner/values.yaml.gotmpl +++ b/values/nfs-provisioner/values.yaml.gotmpl @@ -3,4 +3,5 @@ nfs_provisioner: autosync: true archiveOnDelete: true defaultClass: true + path: "" extraMountOpts: [] diff --git a/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl b/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl index 2f3e33fe..80ad91d2 100644 --- a/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl +++ b/values/nfs-provisioner/values/nfs-provisioner.yaml.gotmpl @@ -1,5 +1,5 @@ nfs: - server: {{ .Values.cluster_config.fileserver }} + server: {{ .Values.clusterConfig.fileserver }} path: /{{ default (.Values.clusterConfig.cluster) .Values.nfs_provisioner.path }} mountOptions: - nfsvers=4.2 @@ -13,4 +13,4 @@ storageClass: tolerations: - key: unschedulable operator: Exists - effect: NoSchedule \ No newline at end of file + effect: NoSchedule diff --git a/values/postgres-operator/manifests/postgres-operator.yaml b/values/postgres-operator/manifests/postgres-operator.yaml index 05b57fb7..832003a2 100644 --- a/values/postgres-operator/manifests/postgres-operator.yaml +++ b/values/postgres-operator/manifests/postgres-operator.yaml @@ -10,13 +10,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/postgres-operator + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: postgres-operator.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -25,7 +30,7 @@ spec: syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true - # - ServerSideApply=true + - ServerSideApply=true {{- if .Values.postgres_operator.autosync }} automated: prune: true diff --git a/values/postgres-operator/values/postgres-operator.yaml.gotmpl b/values/postgres-operator/values/postgres-operator.yaml.gotmpl new file mode 100644 index 00000000..fbe14f63 --- /dev/null +++ b/values/postgres-operator/values/postgres-operator.yaml.gotmpl @@ -0,0 +1,6 @@ +additionalArgs: [] +config: + data: + INHERITED_ANNOTATIONS: "linkerd.io/*" + INHERITED_LABELS: "velero.io/*" + diff --git a/values/prometheus/manifests/dashboards/dotdc-grafana-dashboards-kubernetes.yaml b/values/prometheus/manifests/dashboards/dotdc-grafana-dashboards-kubernetes.yaml new file mode 100644 index 00000000..b06e20bf --- /dev/null +++ b/values/prometheus/manifests/dashboards/dotdc-grafana-dashboards-kubernetes.yaml @@ -0,0 +1,21313 @@ +apiVersion: v1 +data: + k8s-addons-prometheus.json: |- + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.5.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern 'Prometheus' dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 89, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" + } + ], + "title": "Information", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "?", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 1 + }, + "id": 78, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "name" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "prometheus_build_info{pod=~\"$pod\", cluster=~\"$cluster\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ version }}`}}", + "range": false, + "refId": "A" + } + ], + "title": "Prometheus version", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 1 + }, + "id": 92, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "up{pod=~\"$pod\", cluster=~\"$cluster\"} < 1", + "instant": true, + "interval": "", + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Instance Down", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 72, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(prometheus_tsdb_head_series{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "TSDB Head Series", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 94, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(prometheus_sd_discovered_targets{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "instant": true, + "interval": "", + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Discovered Targets", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 64, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" + } + ], + "title": "Prometheus", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 6 + }, + "id": 93, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "up{pod=~\"$pod\", cluster=~\"$cluster\"}", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Liveness by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 6 + }, + "id": 96, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(prometheus_config_last_reload_successful{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Config - Last Successful Reload by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 14 + }, + "id": 74, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_target_scrapes_exceeded_body_size_limit_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - Exceeded body size limit", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_target_scrapes_exceeded_sample_limit_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Exceeded sample limit", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_target_scrapes_sample_duplicate_timestamp_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Duplicate timestamp", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_target_scrapes_sample_out_of_bounds_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Sample out of bounds", + "range": true, + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_target_scrapes_sample_out_of_order_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Sample out of order", + "range": true, + "refId": "E" + } + ], + "title": "Target Scrapes Errors by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 14 + }, + "id": 84, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(prometheus_sd_discovered_targets{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Number of Targets by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 75, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_target_sync_length_seconds_sum{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod, scrape_job) * 1000", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - {{`{{ scrape_job }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Target Sync by pod, scrape_job", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 22 + }, + "id": 85, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "round(sum(rate(prometheus_target_interval_length_seconds_sum{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval]) / rate(prometheus_target_interval_length_seconds_count{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod))", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Average Scrape Interval by pod", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 98, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" + } + ], + "title": "Prometheus TSDB / Query Engine", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 31 + }, + "id": 59, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(prometheus_tsdb_head_series{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - Head Series", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(prometheus_tsdb_head_chunks{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Head Chunks", + "range": true, + "refId": "B" + } + ], + "title": "TSDB Head Series & Chunks by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 31 + }, + "id": 60, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_tsdb_head_samples_appended_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "TSDB Head samples appended - rate by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 39 + }, + "id": 101, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(prometheus_tsdb_blocks_loaded{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - Head Series", + "range": true, + "refId": "A" + } + ], + "title": "TSDB Blocks Loaded by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 39 + }, + "id": 102, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_tsdb_compactions_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - Total Compactions", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_tsdb_compactions_triggered_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Triggered Compactions", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_tsdb_compactions_skipped_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Skipped Compactions", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_tsdb_compactions_failed_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Failed Compactions", + "range": true, + "refId": "D" + } + ], + "title": "TSDB Rate of Compactions by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 47 + }, + "id": 90, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_tsdb_reloads_failures_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "TSDB Reload Failures by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 47 + }, + "id": 95, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_tsdb_head_series_created_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - Created series", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(prometheus_tsdb_head_series_removed_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "hide": false, + "legendFormat": "{{`{{ pod }}`}} - Deleted series", + "range": true, + "refId": "B" + } + ], + "title": "TSDB Created & Deleted series by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 55 + }, + "id": 73, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(prometheus_engine_query_duration_seconds_count{pod=~\"$pod\", slice=\"inner_eval\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Engine Query Count by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 55 + }, + "id": 86, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "max(prometheus_engine_query_duration_seconds{pod=~\"$pod\", cluster=~\"$cluster\"}) by (pod, slice) * 1000", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - {{`{{ slice }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Engine Query Duration by pod, slice", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 63 + }, + "id": 47, + "panels": [], + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], + "title": "Resources", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU Cores", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 4, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "limit" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2495C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 64 + }, + "id": 29, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{pod=~\"$pod\", image!=\"\", container!=\"\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod, container)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - {{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Usage by pod, container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 64 + }, + "id": 51, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{pod=~\"$pod\", image!=\"\", container!=\"\", cluster=~\"$cluster\"}) by (pod, container)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}} - {{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Memory Usage by container", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 72 + }, + "id": 66, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" + } + ], + "title": "Storage", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 73 + }, + "id": 62, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kubelet_volume_stats_used_bytes{persistentvolumeclaim=~\".*prom.*\", cluster=~\"$cluster\"}) by (persistentvolumeclaim) / sum(kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~\".*prom.*\", cluster=~\"$cluster\"}) by (persistentvolumeclaim)", + "interval": "", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Persistent Volumes - Capacity and usage in %", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 73 + }, + "id": 87, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kubelet_volume_stats_used_bytes{persistentvolumeclaim=~\".*prom.*\", cluster=~\"$cluster\"}) by (persistentvolumeclaim)", + "interval": "", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}} - Used", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~\".*prom.*\", cluster=~\"$cluster\"}) by (persistentvolumeclaim)", + "hide": false, + "legendFormat": "{{`{{ persistentvolumeclaim }}`}} - Capacity", + "range": true, + "refId": "B" + } + ], + "title": "Persistent Volumes - Capacity and usage in bytes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 81 + }, + "id": 68, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.4", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "1 - sum(kubelet_volume_stats_inodes_used{persistentvolumeclaim=~\".*prom.*\", cluster=~\"$cluster\"}) by (persistentvolumeclaim) / sum(kubelet_volume_stats_inodes{persistentvolumeclaim=~\".*prom.*\", cluster=~\"$cluster\"}) by (persistentvolumeclaim)", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{`{{ persistentvolumeclaim }}`}}", + "range": true, + "refId": "A", + "step": 240 + } + ], + "title": "Persistent Volumes - Inodes", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 89 + }, + "id": 45, + "panels": [], + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], + "title": "Network", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 90 + }, + "id": 31, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_network_receive_bytes_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Received", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_bytes_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Transmitted", + "range": true, + "refId": "B" + } + ], + "title": "Network - Bandwidth by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 90 + }, + "id": 34, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_network_receive_packets_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Received", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_packets_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Transmitted", + "range": true, + "refId": "B" + } + ], + "title": "Network - Packets rate by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 98 + }, + "id": 36, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_network_receive_packets_dropped_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Received", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_packets_dropped_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Transmitted", + "range": true, + "refId": "B" + } + ], + "title": "Network - Packets Dropped by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 98 + }, + "id": 37, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_network_receive_errors_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Received", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_errors_total{pod=~\"$pod\", cluster=~\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}} - Transmitted", + "range": true, + "refId": "B" + } + ], + "title": "Network - Errors by pod", + "type": "timeseries" + } + ], + "refresh": "30s", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(prometheus_build_info{cluster=\"$cluster\"}, pod)", + "hide": 0, + "includeAll": true, + "multi": false, + "name": "pod", + "options": [], + "query": { + "query": "label_values(prometheus_build_info{cluster=\"$cluster\"}, pod)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Prometheus", + "uid": "k8s_addons_prometheus", + "version": 3, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-addons-prometheus + namespace: prometheus +--- +#apiVersion: v1 +#data: +# k8s-addons-trivy-operator.json: | +# { +# "__inputs": [ +# { +# "name": "DS_PROMETHEUS", +# "label": "Prometheus", +# "description": "", +# "type": "datasource", +# "pluginId": "prometheus", +# "pluginName": "Prometheus" +# } +# ], +# "__elements": [], +# "__requires": [ +# { +# "type": "grafana", +# "id": "grafana", +# "name": "Grafana", +# "version": "8.5.0" +# }, +# { +# "type": "datasource", +# "id": "prometheus", +# "name": "Prometheus", +# "version": "5.0.0" +# }, +# { +# "type": "panel", +# "id": "timeseries", +# "name": "Time series", +# "version": "" +# }, +# { +# "type": "panel", +# "id": "stat", +# "name": "Stat", +# "version": "" +# }, +# { +# "type": "panel", +# "id": "table", +# "name": "Table", +# "version": "" +# } +# ], +# "annotations": { +# "list": [ +# { +# "builtIn": 1, +# "datasource": { +# "type": "datasource", +# "uid": "grafana" +# }, +# "enable": true, +# "hide": true, +# "iconColor": "rgba(0, 211, 255, 1)", +# "name": "Annotations & Alerts", +# "target": { +# "limit": 100, +# "matchAny": false, +# "tags": [], +# "type": "dashboard" +# }, +# "type": "dashboard" +# } +# ] +# }, +# "description": "This is a modern dashboard for the Trivy Operator from Aqua Security. Made to take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", +# "editable": true, +# "fiscalYearStartMonth": 0, +# "graphTooltip": 1, +# "links": [], +# "liveNow": false, +# "panels": [ +# { +# "collapsed": false, +# "datasource": { +# "type": "datasource", +# "uid": "grafana" +# }, +# "gridPos": { +# "h": 1, +# "w": 24, +# "x": 0, +# "y": 0 +# }, +# "id": 43, +# "panels": [], +# "title": "Vulnerabilities", +# "type": "row" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "red", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 0, +# "y": 1 +# }, +# "id": 51, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{severity=\"Critical\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "CRITICAL", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "orange", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 4, +# "y": 1 +# }, +# "id": 50, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{severity=\"High\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "HIGH", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "yellow", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 8, +# "y": 1 +# }, +# "id": 49, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{severity=\"Medium\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "MEDIUM", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 12, +# "y": 1 +# }, +# "id": 60, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{severity=\"Low\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "LOW", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "purple", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 16, +# "y": 1 +# }, +# "id": 52, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{severity=\"Unknown\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "UNKNOWN", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "text", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 20, +# "y": 1 +# }, +# "id": 39, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "TOTAL", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 8, +# "w": 12, +# "x": 0, +# "y": 5 +# }, +# "id": 58, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "single", +# "sort": "none" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{cluster=~\"$cluster\"}) by (namespace)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "{{`{{namespace}}`}}", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total vulnerabilities by namespaces", +# "type": "timeseries" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [ +# { +# "matcher": { +# "id": "byName", +# "options": "Critical" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "red", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "High" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "orange", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Medium" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "yellow", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Low" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "blue", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Unknown" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "purple", +# "mode": "fixed" +# } +# } +# ] +# } +# ] +# }, +# "gridPos": { +# "h": 8, +# "w": 12, +# "x": 12, +# "y": 5 +# }, +# "id": 61, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "multi", +# "sort": "desc" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{cluster=~\"$cluster\"}) by (severity)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total vulnerabilities by severity", +# "type": "timeseries" +# }, +# { +# "collapsed": false, +# "gridPos": { +# "h": 1, +# "w": 24, +# "x": 0, +# "y": 13 +# }, +# "id": 85, +# "panels": [], +# "title": "Vulnerability Details", +# "type": "row" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "description": "", +# "fieldConfig": { +# "defaults": { +# "custom": { +# "align": "auto", +# "displayMode": "auto", +# "filterable": true, +# "inspect": false +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "orange", +# "value": 80 +# } +# ] +# } +# }, +# "overrides": [ +# { +# "matcher": { +# "id": "byName", +# "options": "severity" +# }, +# "properties": [ +# { +# "id": "mappings", +# "value": [ +# { +# "options": { +# "Critical": { +# "color": "red", +# "index": 0 +# }, +# "High": { +# "color": "orange", +# "index": 1 +# }, +# "Low": { +# "color": "blue", +# "index": 3 +# }, +# "Medium": { +# "color": "yellow", +# "index": 2 +# }, +# "Unknown": { +# "color": "purple", +# "index": 4 +# } +# }, +# "type": "value" +# } +# ] +# }, +# { +# "id": "custom.displayMode", +# "value": "color-text" +# } +# ] +# } +# ] +# }, +# "gridPos": { +# "h": 12, +# "w": 24, +# "x": 0, +# "y": 14 +# }, +# "id": 83, +# "options": { +# "footer": { +# "enablePagination": true, +# "fields": [ +# "Value" +# ], +# "reducer": [ +# "sum" +# ], +# "show": false +# }, +# "showHeader": true, +# "sortBy": [] +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_vulnerabilities{namespace=~\"$namespace\", cluster=~\"$cluster\"}) by (namespace, image_registry, image_repository, image_tag, severity) > 0", +# "format": "table", +# "instant": false, +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Vulnerability count per image and severity in $namespace namespace(s)", +# "transformations": [ +# { +# "id": "organize", +# "options": { +# "excludeByName": { +# "Time": true, +# "Value": false +# }, +# "indexByName": { +# "Time": 0, +# "Value": 6, +# "image_registry": 2, +# "image_repository": 3, +# "image_tag": 4, +# "namespace": 1, +# "severity": 5 +# }, +# "renameByName": { +# "Value": "Nb of vulnerabilities", +# "image_registry": "Image Registry", +# "image_repository": "Image Repository", +# "image_tag": "Image Tag", +# "namespace": "Namespace", +# "severity": "Severity" +# } +# } +# }, +# { +# "id": "groupBy", +# "options": { +# "fields": { +# "All values": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Count": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Image Registry": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Image Repository": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Image Tag": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Namespace": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Nb of vulnerabilities": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Severity": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Value": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "image_registry": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "image_repository": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "image_tag": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "namespace": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "severity": { +# "aggregations": [], +# "operation": "groupby" +# } +# } +# } +# } +# ], +# "type": "table" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "description": "Require operator.metricsVulnIdEnabled: true", +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "custom": { +# "align": "auto", +# "displayMode": "auto", +# "filterable": true, +# "inspect": false +# }, +# "links": [], +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [ +# { +# "matcher": { +# "id": "byName", +# "options": "severity" +# }, +# "properties": [ +# { +# "id": "mappings", +# "value": [ +# { +# "options": { +# "Critical": { +# "color": "red", +# "index": 0 +# }, +# "High": { +# "color": "orange", +# "index": 1 +# }, +# "Low": { +# "color": "blue", +# "index": 3 +# }, +# "Medium": { +# "color": "yellow", +# "index": 2 +# }, +# "Unknown": { +# "color": "purple", +# "index": 4 +# } +# }, +# "type": "value" +# } +# ] +# }, +# { +# "id": "custom.displayMode", +# "value": "color-text" +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "vuln_id" +# }, +# "properties": [ +# { +# "id": "links", +# "value": [ +# { +# "targetBlank": true, +# "title": "https://nvd.nist.gov/vuln/detail/${__value.text}", +# "url": "https://nvd.nist.gov/vuln/detail/${__value.text}" +# } +# ] +# } +# ] +# } +# ] +# }, +# "gridPos": { +# "h": 12, +# "w": 24, +# "x": 0, +# "y": 26 +# }, +# "id": 78, +# "options": { +# "footer": { +# "enablePagination": true, +# "fields": "", +# "reducer": [ +# "sum" +# ], +# "show": false +# }, +# "showHeader": true, +# "sortBy": [] +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_vulnerability_id{vuln_id=~\"CVE.*\", namespace=~\"$namespace\", cluster=~\"$cluster\"}) by (namespace, image_registry, image_repository, image_tag, vuln_id, severity)", +# "format": "table", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Detaillled CVE vulnerabilities in $namespace namespace(s)", +# "transformations": [ +# { +# "id": "organize", +# "options": { +# "excludeByName": { +# "Time": true, +# "Value": true, +# "__name__": true, +# "container": true, +# "endpoint": true, +# "instance": true, +# "job": true, +# "namespace": false, +# "service": true +# }, +# "indexByName": { +# "Time": 0, +# "Value": 7, +# "image_registry": 2, +# "image_repository": 3, +# "image_tag": 4, +# "namespace": 1, +# "severity": 6, +# "vuln_id": 5 +# }, +# "renameByName": { +# "image_namespace": "namespace", +# "image_registry": "Image Registry", +# "image_repository": "Image Repository", +# "image_tag": "Image Tag", +# "namespace": "Namespace", +# "severity": "Severity", +# "vuln_id": "Vulnerability", +# "vulnerability_id": "" +# } +# } +# }, +# { +# "id": "groupBy", +# "options": { +# "fields": { +# "Image Registry": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Image Repository": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Image Tag": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Namespace": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Severity": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "Value": { +# "aggregations": [ +# "lastNotNull" +# ] +# }, +# "Vulnerability": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "image_namespace": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "namespace": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "severity": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "vuln_id": { +# "aggregations": [], +# "operation": "groupby" +# }, +# "vulnerability_id": { +# "aggregations": [], +# "operation": "groupby" +# } +# } +# } +# } +# ], +# "type": "table" +# }, +# { +# "collapsed": false, +# "datasource": { +# "type": "datasource", +# "uid": "grafana" +# }, +# "gridPos": { +# "h": 1, +# "w": 24, +# "x": 0, +# "y": 38 +# }, +# "id": 47, +# "panels": [], +# "title": "Config Audit Reports", +# "type": "row" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "red", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 0, +# "y": 39 +# }, +# "id": 56, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{severity=\"Critical\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "CRITICAL", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "orange", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 4, +# "y": 39 +# }, +# "id": 55, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{severity=\"High\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "HIGH", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "yellow", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 8, +# "y": 39 +# }, +# "id": 54, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{severity=\"Medium\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "MEDIUM", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 12, +# "y": 39 +# }, +# "id": 53, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{severity=\"Low\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "LOW", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "text", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 16, +# "y": 39 +# }, +# "id": 65, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "TOTAL", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 8, +# "w": 12, +# "x": 0, +# "y": 43 +# }, +# "id": 62, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "single", +# "sort": "none" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{cluster=~\"$cluster\"}) by (namespace)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total config audit report by namespaces", +# "type": "timeseries" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [ +# { +# "matcher": { +# "id": "byName", +# "options": "Critical" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "red", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "High" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "orange", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Medium" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "yellow", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Low" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "blue", +# "mode": "fixed" +# } +# } +# ] +# } +# ] +# }, +# "gridPos": { +# "h": 8, +# "w": 12, +# "x": 12, +# "y": 43 +# }, +# "id": 63, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "multi", +# "sort": "desc" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_resource_configaudits{cluster=~\"$cluster\"}) by (severity)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total config audit report by severity", +# "type": "timeseries" +# }, +# { +# "collapsed": false, +# "gridPos": { +# "h": 1, +# "w": 24, +# "x": 0, +# "y": 51 +# }, +# "id": 68, +# "panels": [], +# "title": "RBAC Assessments", +# "type": "row" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "red", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 0, +# "y": 52 +# }, +# "id": 72, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{severity=\"Critical\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "CRITICAL", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "orange", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 4, +# "y": 52 +# }, +# "id": 71, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{severity=\"High\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "HIGH", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "yellow", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 8, +# "y": 52 +# }, +# "id": 70, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{severity=\"Medium\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "MEDIUM", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 12, +# "y": 52 +# }, +# "id": 69, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{severity=\"Low\", namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "LOW", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "thresholds" +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "text", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 4, +# "w": 4, +# "x": 16, +# "y": 52 +# }, +# "id": 73, +# "options": { +# "colorMode": "value", +# "graphMode": "area", +# "justifyMode": "auto", +# "orientation": "auto", +# "reduceOptions": { +# "calcs": [ +# "last" +# ], +# "fields": "", +# "values": false +# }, +# "textMode": "auto" +# }, +# "pluginVersion": "9.3.8", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{namespace=~\"$namespace\", cluster=~\"$cluster\"})", +# "instant": true, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "refId": "A" +# } +# ], +# "title": "TOTAL", +# "type": "stat" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 8, +# "w": 12, +# "x": 0, +# "y": 56 +# }, +# "id": 74, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "single", +# "sort": "none" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{cluster=~\"$cluster\"}) by (namespace)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total RBAC Assessments by namespaces", +# "type": "timeseries" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [ +# { +# "matcher": { +# "id": "byName", +# "options": "Critical" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "red", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "High" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "orange", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Medium" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "yellow", +# "mode": "fixed" +# } +# } +# ] +# }, +# { +# "matcher": { +# "id": "byName", +# "options": "Low" +# }, +# "properties": [ +# { +# "id": "color", +# "value": { +# "fixedColor": "blue", +# "mode": "fixed" +# } +# } +# ] +# } +# ] +# }, +# "gridPos": { +# "h": 8, +# "w": 12, +# "x": 12, +# "y": 56 +# }, +# "id": 75, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "multi", +# "sort": "desc" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_role_rbacassessments{cluster=~\"$cluster\"}) by (severity)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total RBAC Assessments by severity", +# "type": "timeseries" +# }, +# { +# "collapsed": false, +# "gridPos": { +# "h": 1, +# "w": 24, +# "x": 0, +# "y": 64 +# }, +# "id": 81, +# "panels": [], +# "title": "Exposed Secrets", +# "type": "row" +# }, +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "fieldConfig": { +# "defaults": { +# "color": { +# "mode": "palette-classic" +# }, +# "custom": { +# "axisCenteredZero": false, +# "axisColorMode": "text", +# "axisLabel": "", +# "axisPlacement": "auto", +# "barAlignment": 0, +# "drawStyle": "line", +# "fillOpacity": 15, +# "gradientMode": "opacity", +# "hideFrom": { +# "legend": false, +# "tooltip": false, +# "viz": false +# }, +# "lineInterpolation": "linear", +# "lineWidth": 2, +# "pointSize": 5, +# "scaleDistribution": { +# "type": "linear" +# }, +# "showPoints": "never", +# "spanNulls": false, +# "stacking": { +# "group": "A", +# "mode": "none" +# }, +# "thresholdsStyle": { +# "mode": "off" +# } +# }, +# "mappings": [], +# "thresholds": { +# "mode": "absolute", +# "steps": [ +# { +# "color": "green", +# "value": null +# }, +# { +# "color": "blue", +# "value": 1 +# } +# ] +# }, +# "unit": "none" +# }, +# "overrides": [] +# }, +# "gridPos": { +# "h": 8, +# "w": 24, +# "x": 0, +# "y": 65 +# }, +# "id": 76, +# "options": { +# "legend": { +# "calcs": [], +# "displayMode": "table", +# "placement": "right", +# "showLegend": true +# }, +# "tooltip": { +# "mode": "single", +# "sort": "none" +# } +# }, +# "pluginVersion": "8.5.0", +# "targets": [ +# { +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "editorMode": "code", +# "exemplar": false, +# "expr": "sum(trivy_image_exposedsecrets{cluster=~\"$cluster\"}) by (namespace)", +# "instant": false, +# "interval": "$resolution", +# "legendFormat": "__auto", +# "range": true, +# "refId": "A" +# } +# ], +# "title": "Total Exposed Secrets by namespaces", +# "type": "timeseries" +# } +# ], +# "refresh": "30s", +# "schemaVersion": 37, +# "style": "dark", +# "tags": [ +# "Prometheus", +# "Addons", +# "Trivy", +# "Trivy-operator" +# ], +# "templating": { +# "list": [ +# { +# "current": { +# "selected": false, +# "text": "Prometheus", +# "value": "Prometheus" +# }, +# "hide": 0, +# "includeAll": false, +# "multi": false, +# "name": "datasource", +# "options": [], +# "query": "prometheus", +# "queryValue": "", +# "refresh": 1, +# "regex": "", +# "skipUrlSync": false, +# "type": "datasource" +# }, +# { +# "current": { +# "isNone": true, +# "selected": false, +# "text": "None", +# "value": "" +# }, +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "definition": "label_values(kube_node_info,cluster)", +# "hide": 0, +# "includeAll": false, +# "multi": false, +# "name": "cluster", +# "options": [], +# "query": { +# "qryType": 1, +# "query": "label_values(kube_node_info,cluster)", +# "refId": "PrometheusVariableQueryEditor-VariableQuery" +# }, +# "refresh": 1, +# "regex": "", +# "skipUrlSync": false, +# "sort": 1, +# "type": "query" +# }, +# { +# "current": { +# "selected": true, +# "text": [ +# "All" +# ], +# "value": [ +# "$__all" +# ] +# }, +# "datasource": { +# "type": "prometheus", +# "uid": "${datasource}" +# }, +# "definition": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)", +# "hide": 0, +# "includeAll": true, +# "multi": true, +# "name": "namespace", +# "options": [], +# "query": { +# "query": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)", +# "refId": "StandardVariableQuery" +# }, +# "refresh": 1, +# "regex": "", +# "skipUrlSync": false, +# "sort": 1, +# "type": "query" +# }, +# { +# "current": { +# "selected": true, +# "text": "30s", +# "value": "30s" +# }, +# "hide": 0, +# "includeAll": false, +# "multi": false, +# "name": "resolution", +# "options": [ +# { +# "selected": false, +# "text": "1s", +# "value": "1s" +# }, +# { +# "selected": false, +# "text": "15s", +# "value": "15s" +# }, +# { +# "selected": true, +# "text": "30s", +# "value": "30s" +# }, +# { +# "selected": false, +# "text": "1m", +# "value": "1m" +# }, +# { +# "selected": false, +# "text": "3m", +# "value": "3m" +# }, +# { +# "selected": false, +# "text": "5m", +# "value": "5m" +# } +# ], +# "query": "1s, 15s, 30s, 1m, 3m, 5m", +# "queryValue": "", +# "skipUrlSync": false, +# "type": "custom" +# } +# ] +# }, +# "time": { +# "from": "now-1h", +# "to": "now" +# }, +# "timepicker": {}, +# "timezone": "", +# "title": "Trivy Operator - Vulnerabilities", +# "uid": "security_trivy_operator", +# "version": 12, +# "weekStart": "" +# } +#kind: ConfigMap +#metadata: +# annotations: +# grafana_folder: Kubernetes +# labels: +# grafana_dashboard: "1" +# name: dashboards-k8s-addons-trivy-operator +# namespace: prometheus +--- +apiVersion: v1 +data: + k8s-system-api-server.json: | + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.4.4" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern API Server dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [ + { + "options": { + "0": { + "text": "DOWN" + }, + "1": { + "text": "UP" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 42, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "value_and_name" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "up{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}", + "interval": "", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - Health Status", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "__name__" + }, + "properties": [ + { + "id": "custom.width", + "value": 188 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 60, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "removed_release" + } + ] + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "apiserver_requested_deprecated_apis{cluster=~\"$cluster\"}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Deprecated Kubernetes Resources", + "transformations": [ + { + "id": "labelsToFields", + "options": { + "keepLabels": [ + "group", + "job", + "removed_release", + "resource", + "version", + "name" + ], + "mode": "columns" + } + }, + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": true, + "job": true + }, + "indexByName": { + "Time": 6, + "Value": 7, + "group": 1, + "job": 5, + "namespace": 0, + "removed_release": 4, + "resource": 3, + "version": 2 + }, + "renameByName": {} + } + }, + { + "id": "groupBy", + "options": { + "fields": { + "group": { + "aggregations": [ + "lastNotNull" + ], + "operation": "groupby" + }, + "job": { + "aggregations": [], + "operation": "groupby" + }, + "namespace": { + "aggregations": [ + "lastNotNull" + ], + "operation": "groupby" + }, + "removed_release": { + "aggregations": [], + "operation": "groupby" + }, + "resource": { + "aggregations": [ + "lastNotNull" + ], + "operation": "groupby" + }, + "version": { + "aggregations": [], + "operation": "groupby" + } + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 38, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum by (code) (rate(apiserver_request_total{cluster=~\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "{{`{{ code }}`}}", + "refId": "A" + } + ], + "title": "API Server - HTTP Requests by code", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 39, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum by (verb) (rate(apiserver_request_total{cluster=~\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "{{`{{ verb}}`}}", + "refId": "A" + } + ], + "title": "API Server - HTTP Requests by verb", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 53, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(apiserver_request_duration_seconds_sum{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval])) by (instance)\n/\nsum(rate(apiserver_request_duration_seconds_count{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - HTTP Requests Latency by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "id": 54, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(apiserver_request_duration_seconds_sum{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval])) by (verb)\n/\nsum(rate(apiserver_request_duration_seconds_count{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval])) by (verb)", + "interval": "$resolution", + "legendFormat": "{{`{{ verb }}`}}", + "refId": "A" + } + ], + "title": "API Server - HTTP Requests Latency by verb", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum by(instance) (rate(apiserver_request_total{code=~\"5..\", job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval]))\n / sum by(instance) (rate(apiserver_request_total{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - Errors by Instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 51, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum by(verb) (rate(apiserver_request_total{code=~\"5..\",job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval]))\n / sum by(verb) (rate(apiserver_request_total{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "{{`{{ verb }}`}}", + "refId": "A" + } + ], + "title": "API Server - Errors by verb", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 32 + }, + "id": 40, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(apiserver_request_total{cluster=~\"$cluster\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - Stacked HTTP Requests by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 56, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(workqueue_depth{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - Work Queue by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 40 + }, + "id": 47, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "rate(process_cpu_seconds_total{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}[$__rate_interval])", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - CPU Usage by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 40 + }, + "id": 48, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "process_resident_memory_bytes{job=~\"kubernetes-apiservers|apiserver\", cluster=~\"$cluster\"}", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "API Server - Memory Usage by instance", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 38, + "style": "dark", + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": true, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubernetes / System / API Server", + "uid": "k8s_system_apisrv", + "version": 17, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-system-api-server + namespace: prometheus +--- +apiVersion: v1 +data: + k8s-system-coredns.json: | + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.4.4" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern CoreDNS dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [ + { + "options": { + "0": { + "text": "DOWN" + }, + "1": { + "text": "UP" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 25, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "up{job=~\"$job\", instance=~\"$instance\", cluster=~\"$cluster\"}", + "interval": "", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - Health Status", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 3 + }, + "id": 19, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "rate(process_cpu_seconds_total{job=~\"$job\", instance=~\"$instance\", cluster=~\"$cluster\"}[$__rate_interval])", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - CPU Usage by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 3 + }, + "id": 21, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "process_resident_memory_bytes{job=~\"$job\", instance=~\"$instance\", cluster=~\"$cluster\"}", + "interval": "", + "legendFormat": "{{`{{ instance }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - Memory Usage by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 11 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_dns_requests_total{instance=~\"$instance\",proto=\"$protocol\", cluster=~\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "total $protocol requests", + "refId": "A" + } + ], + "title": "CoreDNS - Total DNS Requests ($protocol)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 11 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_dns_request_size_bytes_sum{instance=~\"$instance\",proto=\"$protocol\", cluster=~\"$cluster\"}[$__rate_interval])) by (proto) / sum(rate(coredns_dns_request_size_bytes_count{instance=~\"$instance\",proto=\"$protocol\", cluster=~\"$cluster\"}[$__rate_interval])) by (proto)", + "interval": "$resolution", + "legendFormat": "average $protocol packet size", + "refId": "A" + } + ], + "title": "CoreDNS - Average Packet Size ($protocol)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 19 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_dns_requests_total{instance=~\"$instance\", cluster=~\"$cluster\"}[$__rate_interval])) by (type)", + "interval": "$resolution", + "legendFormat": "{{`{{ type }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - Requests by type", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 19 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_dns_responses_total{instance=~\"$instance\", cluster=~\"$cluster\"}[$__rate_interval])) by (rcode)", + "interval": "$resolution", + "legendFormat": "{{`{{ rcode }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - Requests by return code", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 27 + }, + "id": 23, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_forward_requests_total{cluster=~\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "total forward requests", + "refId": "A" + } + ], + "title": "CoreDNS - Total Forward Requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 27 + }, + "id": 13, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_forward_responses_total{rcode=~\"SERVFAIL|REFUSED\", cluster=~\"$cluster\"}[$__rate_interval])) by (rcode)", + "interval": "$resolution", + "legendFormat": "{{`{{ rcode }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - DNS Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 35 + }, + "id": 17, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_cache_hits_total{instance=~\"$instance\", cluster=~\"$cluster\"}[$__rate_interval])) by (type)", + "interval": "$resolution", + "legendFormat": "{{`{{ type }}`}}", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(coredns_cache_misses_total{instance=~\"$instance\", cluster=~\"$cluster\"}[$__rate_interval])) by (type)", + "interval": "$resolution", + "legendFormat": "misses", + "refId": "B" + } + ], + "title": "CoreDNS - Cache Hits / Misses", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 35 + }, + "id": 15, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(coredns_cache_entries{cluster=~\"$cluster\"}) by (type)", + "interval": "", + "legendFormat": "{{`{{ type }}`}}", + "refId": "A" + } + ], + "title": "CoreDNS - Cache Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 27, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "RdYlBu", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(increase(coredns_dns_request_duration_seconds_bucket{instance=~\"$instance\", cluster=~\"$cluster\"}[$__rate_interval])) by (le)", + "format": "heatmap", + "legendFormat": "{{`{{le}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CoreDNS - DNS request duration", + "type": "heatmap" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 28, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "RdYlBu", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "decbytes" + } + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(increase(coredns_dns_request_size_bytes_bucket{instance=~\"$instance\", le!=\"0\", cluster=~\"$cluster\"}[$__rate_interval])) by (le)", + "format": "heatmap", + "legendFormat": "{{`{{le}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CoreDNS - DNS request size", + "type": "heatmap" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 53 + }, + "id": 29, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "RdYlBu", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "decbytes" + } + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(increase(coredns_dns_response_size_bytes_bucket{instance=~\"$instance\", le!=\"0\", cluster=~\"$cluster\"}[$__rate_interval])) by (le)", + "format": "heatmap", + "legendFormat": "{{`{{le}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CoreDNS - DNS response size", + "type": "heatmap" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(up{job=\"$job\", cluster=\"$cluster\"},instance)", + "hide": 0, + "includeAll": true, + "label": "", + "multi": false, + "name": "instance", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(up{job=\"$job\", cluster=\"$cluster\"},instance)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": "udp,tcp", + "current": { + "selected": false, + "text": "udp", + "value": "udp" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(coredns_dns_requests_total{cluster=\"$cluster\"}, proto)", + "hide": 0, + "includeAll": false, + "label": "", + "multi": false, + "name": "protocol", + "options": [], + "query": { + "query": "label_values(coredns_dns_requests_total{cluster=\"$cluster\"}, proto)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": true, + "text": [ + "coredns" + ], + "value": [ + "coredns" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(coredns_build_info{cluster=\"$cluster\"},job)", + "hide": 0, + "includeAll": false, + "multi": true, + "name": "job", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(coredns_build_info{cluster=\"$cluster\"},job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubernetes / System / CoreDNS", + "uid": "k8s_system_coredns", + "version": 18, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-system-coredns + namespace: prometheus +--- +apiVersion: v1 +data: + k8s-views-global.json: | + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.3.1" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern 'Global View' dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 67, + "panels": [], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 1 + }, + "id": 77, + "options": { + "displayMode": "lcd", + "maxVizHeight": 300, + "minVizHeight": 10, + "minVizWidth": 0, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "avg(sum by (instance, cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])))", + "interval": "", + "legendFormat": "Real Linux", + "range": true, + "refId": "Real Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "avg(sum by (core) (rate(windows_cpu_time_total{mode!=\"idle\", cluster=\"$cluster\"}[$__rate_interval])))", + "hide": false, + "interval": "", + "legendFormat": "Real Windows", + "range": true, + "refId": "Real Windows" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\", cluster=\"$cluster\"}) / sum(machine_cpu_cores{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Requests", + "range": true, + "refId": "Requests" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_limits{resource=\"cpu\", cluster=\"$cluster\"}) / sum(machine_cpu_cores{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Limits", + "range": true, + "refId": "Limits" + } + ], + "title": "Global CPU Usage", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Real", + "mode": "reduceRow", + "reduce": { + "include": [ + "Real Linux", + "Real Windows" + ], + "reducer": "mean" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Real Linux": true, + "Real Windows": true, + "Time": true + }, + "indexByName": { + "Limits": 5, + "Real": 1, + "Real Linux": 2, + "Real Windows": 3, + "Requests": 4, + "Time": 0 + }, + "renameByName": {} + } + } + ], + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 1 + }, + "id": 78, + "options": { + "displayMode": "lcd", + "maxVizHeight": 300, + "minVizHeight": 10, + "minVizWidth": 0, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "text": {}, + "valueMode": "color" + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(node_memory_MemTotal_bytes{cluster=\"$cluster\", job=\"$job\"} - node_memory_MemAvailable_bytes{cluster=\"$cluster\", job=\"$job\"}) / sum(node_memory_MemTotal_bytes{cluster=\"$cluster\", job=\"$job\"})", + "hide": false, + "interval": "", + "legendFormat": "Real Linux", + "range": true, + "refId": "Real Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(windows_memory_available_bytes{cluster=\"$cluster\"} + windows_memory_cache_bytes{cluster=\"$cluster\"}) / sum(windows_os_visible_memory_bytes{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Real Windows", + "range": true, + "refId": "Real Windows" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\", cluster=\"$cluster\"}) / sum(machine_memory_bytes{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Requests", + "range": true, + "refId": "Requests" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_limits{resource=\"memory\", cluster=\"$cluster\"}) / sum(machine_memory_bytes{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Limits", + "range": true, + "refId": "Limits" + } + ], + "title": "Global RAM Usage", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Real", + "mode": "reduceRow", + "reduce": { + "include": [ + "Real Linux", + "Real Windows" + ], + "reducer": "mean" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Real Linux": true, + "Real Windows": true, + "Time": true + }, + "includeByName": {}, + "indexByName": { + "Limits": 5, + "Real": 3, + "Real Linux": 1, + "Real Windows": 2, + "Requests": 4, + "Time": 0 + }, + "renameByName": {} + } + } + ], + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 1 + }, + "id": 63, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "count(count by (node) (kube_node_info{cluster=\"$cluster\"}))", + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "Nodes", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 10, + "x": 14, + "y": 1 + }, + "id": 52, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kube_namespace_labels{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Namespaces", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_container_status_running{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Running Containers", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_status_phase{phase=\"Running\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Running Pods", + "refId": "O" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_service_info{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Services", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_endpoint_info{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Endpoints", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_ingress_info{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Ingresses", + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_deployment_labels{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Deployments", + "refId": "F" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_statefulset_labels{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Statefulsets", + "refId": "G" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_daemonset_labels{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Daemonsets", + "refId": "H" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_persistentvolumeclaim_info{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Persistent Volume Claims", + "refId": "I" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_hpa_labels{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Horizontal Pod Autoscalers", + "refId": "J" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_configmap_info{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Configmaps", + "refId": "K" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_secret_info{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Secrets", + "refId": "L" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_networkpolicy_labels{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Network Policies", + "refId": "M" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "count(count by (node) (kube_node_info{cluster=\"$cluster\"}))", + "hide": false, + "interval": "", + "legendFormat": "Nodes", + "refId": "N" + } + ], + "title": "Kubernetes Resource Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 5 + }, + "id": 59, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "count(kube_namespace_created{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Namespaces", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 9 + }, + "id": 37, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval]))", + "interval": "", + "legendFormat": "Real Linux", + "range": true, + "refId": "Real Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(windows_cpu_time_total{mode!=\"idle\", cluster=\"$cluster\"}[$__rate_interval]))", + "hide": false, + "interval": "", + "legendFormat": "Real Windows", + "range": true, + "refId": "Real Windows" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Requests", + "range": true, + "refId": "Requests" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_limits{resource=\"cpu\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Limits", + "range": true, + "refId": "Limits" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(machine_cpu_cores{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Total", + "range": true, + "refId": "Total" + } + ], + "title": "CPU Usage", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Real", + "mode": "reduceRow", + "reduce": { + "include": [ + "Real Linux", + "Real Windows" + ], + "reducer": "sum" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Real Linux": true, + "Real Windows": true, + "Time": true, + "Total Linux": true, + "Total Windows": true + }, + "indexByName": { + "Limits": 5, + "Real": 3, + "Real Linux": 1, + "Real Windows": 2, + "Requests": 4, + "Time": 0, + "Total": 8, + "Total Linux": 6, + "Total Windows": 7 + }, + "renameByName": {} + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 9 + }, + "id": 39, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(node_memory_MemTotal_bytes{cluster=\"$cluster\", job=\"$job\"} - node_memory_MemAvailable_bytes{cluster=\"$cluster\", job=\"$job\"})", + "interval": "", + "legendFormat": "Real Linux", + "range": true, + "refId": "Real Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(windows_os_visible_memory_bytes{cluster=\"$cluster\"} - windows_memory_available_bytes{cluster=\"$cluster\"} - windows_memory_cache_bytes{cluster=\"$cluster\"})", + "hide": false, + "interval": "", + "legendFormat": "Real Windows", + "range": true, + "refId": "Real Windows" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Requests", + "range": true, + "refId": "Requests" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_limits{resource=\"memory\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Limits", + "range": true, + "refId": "Limits" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(machine_memory_bytes{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Total", + "range": true, + "refId": "Total" + } + ], + "title": "RAM Usage", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Real", + "mode": "reduceRow", + "reduce": { + "include": [ + "Real Linux", + "Real Windows" + ], + "reducer": "mean" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Real Linux": true, + "Real Windows": true, + "Time": true + }, + "includeByName": {}, + "indexByName": { + "Limits": 5, + "Real": 3, + "Real Linux": 1, + "Real Windows": 2, + "Requests": 4, + "Time": 0, + "Total": 6 + }, + "renameByName": {} + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 9 + }, + "id": 62, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_status_phase{phase=\"Running\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Running Pods", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 71, + "panels": [], + "title": "Resources", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd", + "seriesBy": "last" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU %", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 0.5 + }, + { + "color": "red", + "value": 0.7 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 14 + }, + "id": 72, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "avg(sum by (instance, cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])))", + "interval": "$resolution", + "legendFormat": "Linux", + "range": true, + "refId": "Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "1 - avg(rate(windows_cpu_time_total{cluster=\"$cluster\",mode=\"idle\"}[$__rate_interval]))", + "hide": false, + "interval": "$resolution", + "legendFormat": "Windows", + "range": true, + "refId": "Windows" + } + ], + "title": "Cluster CPU Utilization", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "CPU usage in %", + "mode": "reduceRow", + "reduce": { + "reducer": "mean" + }, + "replaceFields": true + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "MEMORY", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.5 + }, + { + "color": "red", + "value": 0.7 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 14 + }, + "id": 55, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "hidden", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(node_memory_MemTotal_bytes{cluster=\"$cluster\", job=\"$job\"} - node_memory_MemAvailable_bytes{cluster=\"$cluster\", job=\"$job\"}) / sum(node_memory_MemTotal_bytes{cluster=\"$cluster\", job=\"$job\"})", + "interval": "$resolution", + "legendFormat": "Linux", + "range": true, + "refId": "Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(windows_os_visible_memory_bytes{cluster=\"$cluster\"} - windows_memory_available_bytes{cluster=\"$cluster\"}) / sum(windows_os_visible_memory_bytes{cluster=\"$cluster\"})", + "hide": false, + "interval": "$resolution", + "legendFormat": "Windows", + "range": true, + "refId": "Windows" + } + ], + "title": "Cluster Memory Utilization", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Memory usage in %", + "mode": "reduceRow", + "reduce": { + "reducer": "mean" + }, + "replaceFields": true + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU CORES", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 46, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (namespace)\n+ on (namespace)\n(sum(rate(windows_container_cpu_usage_seconds_total{container_id!=\"\", cluster=\"$cluster\"}[$__rate_interval]) * on (container_id) group_left (container, pod, namespace) max by ( container, container_id, pod, namespace) (kube_pod_container_info{container_id!=\"\", cluster=\"$cluster\"}) OR kube_namespace_created{cluster=\"$cluster\"} * 0) by (namespace))", + "format": "time_series", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{ namespace }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Utilization by namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 22 + }, + "id": 50, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{image!=\"\", cluster=\"$cluster\"}) by (namespace)\n+ on (namespace)\n(sum(windows_container_memory_usage_commit_bytes{container_id!=\"\", cluster=\"$cluster\"} * on (container_id) group_left (container, pod, namespace) max by ( container, container_id, pod, namespace) (kube_pod_container_info{container_id!=\"\", cluster=\"$cluster\"}) OR kube_namespace_created{cluster=\"$cluster\"} * 0) by (namespace))", + "interval": "$resolution", + "legendFormat": "{{`{{ namespace }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Memory Utilization by namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU %", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 54, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "avg(sum by (instance, cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval]))) by (instance)", + "interval": "$resolution", + "legendFormat": "{{`{{ node }}`}}", + "range": true, + "refId": "Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "avg(sum by (instance,core) (rate(windows_cpu_time_total{mode!=\"idle\", cluster=\"$cluster\"}[$__rate_interval]))) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{ node }}`}}", + "range": true, + "refId": "Windows" + } + ], + "title": "CPU Utilization by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "MEMORY", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 73, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(node_memory_MemTotal_bytes{cluster=\"$cluster\", job=\"$job\"} - node_memory_MemAvailable_bytes{cluster=\"$cluster\", job=\"$job\"}) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "range": true, + "refId": "Linux" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(windows_os_visible_memory_bytes{cluster=\"$cluster\"} - windows_memory_available_bytes{cluster=\"$cluster\"}) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "range": true, + "refId": "Windows" + } + ], + "title": "Memory Utilization by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "No data is generally a good thing here.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "SECONDS", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 38 + }, + "id": 82, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_cfs_throttled_seconds_total{image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (namespace) > 0", + "interval": "$resolution", + "legendFormat": "{{`{{ namespace }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Throttled seconds by namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "No data is generally a good thing here.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "NB", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 38 + }, + "id": 83, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_cpu_core_throttles_total{cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "{{`{{ instance }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Core Throttled by instance", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 86, + "panels": [], + "title": "Kubernetes", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 47 + }, + "id": 84, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_qos_class{cluster=\"$cluster\"}) by (qos_class)", + "interval": "", + "legendFormat": "{{`{{ qos_class }}`}} pods", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_info{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Total pods", + "range": true, + "refId": "B" + } + ], + "title": "Kubernetes Pods QoS classes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 47 + }, + "id": 85, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_reason{cluster=\"$cluster\"}) by (reason)", + "interval": "", + "legendFormat": "{{`{{ reason }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Kubernetes Pods Status Reason", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "No data is generally a good thing here.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 56 + }, + "id": 87, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(increase(container_oom_events_total{cluster=\"$cluster\"}[$__rate_interval])) by (namespace) > 0", + "interval": "", + "legendFormat": "{{`{{ namespace }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "OOM Events by namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "No data is generally a good thing here.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 56 + }, + "id": 88, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(increase(kube_pod_container_status_restarts_total{cluster=\"$cluster\"}[$__rate_interval])) by (namespace) > 0", + "interval": "", + "legendFormat": "{{`{{ namespace }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Container Restarts by namespace", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 65 + }, + "id": 69, + "panels": [], + "title": "Network", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Dropped noisy virtual devices for readability.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "BANDWIDTH", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 66 + }, + "id": 44, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_bytes_total{device!~\"(veth|azv|lxc).*\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (device)", + "interval": "$resolution", + "legendFormat": "Received : {{`{{ device }}`}}", + "range": true, + "refId": "Linux Received" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(node_network_transmit_bytes_total{device!~\"(veth|azv|lxc).*\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (device)", + "interval": "$resolution", + "legendFormat": "Transmitted : {{`{{ device }}`}}", + "range": true, + "refId": "Linux Transmitted" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(windows_net_bytes_received_total{cluster=\"$cluster\"}[$__rate_interval])) by (nic)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Received : {{`{{ nic }}`}}", + "range": true, + "refId": "Windows Received" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(windows_net_bytes_sent_total{cluster=\"$cluster\"}[$__rate_interval])) by (nic)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted : {{`{{ device }}`}}", + "range": true, + "refId": "Windows Transmitted" + } + ], + "title": "Global Network Utilization by device", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "DROPPED PACKETS", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 66 + }, + "id": 53, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_drop_total{cluster=\"$cluster\", job=\"$job\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Linux Packets dropped (receive)", + "range": true, + "refId": "Linux Packets dropped (receive)" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(node_network_transmit_drop_total{cluster=\"$cluster\", job=\"$job\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Linux Packets dropped (transmit)", + "range": true, + "refId": "Linux Packets dropped (transmit)" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(windows_net_packets_received_discarded_total{cluster=\"$cluster\"}[$__rate_interval]))", + "hide": false, + "interval": "$resolution", + "legendFormat": "Windows Packets dropped (receive)", + "range": true, + "refId": "Windows Packets dropped (receive)" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(windows_net_packets_outbound_discarded_total{cluster=\"$cluster\"}[$__rate_interval]))", + "hide": false, + "interval": "$resolution", + "legendFormat": "Windows Packets dropped (transmit)", + "range": true, + "refId": "Windows Packets dropped (transmit)" + } + ], + "title": "Network Saturation - Packets dropped", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Packets dropped (receive)", + "mode": "reduceRow", + "reduce": { + "include": [ + "Linux Packets dropped (receive)", + "Windows Packets dropped (receive)" + ], + "reducer": "mean" + } + } + }, + { + "id": "calculateField", + "options": { + "alias": "Packets dropped (transmit)", + "mode": "reduceRow", + "reduce": { + "include": [ + "Linux Packets dropped (transmit)", + "Windows Packets dropped (transmit)" + ], + "reducer": "mean" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Linux Packets dropped (receive)": true, + "Linux Packets dropped (transmit)": true, + "Time": false, + "Windows Packets dropped (receive)": true, + "Windows Packets dropped (transmit)": true + }, + "includeByName": {}, + "indexByName": {}, + "renameByName": {} + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "BANDWIDTH", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 74 + }, + "id": 79, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_network_receive_bytes_total{cluster=\"$cluster\"}[$__rate_interval])) by (namespace)\n+ on (namespace)\n(sum(rate(windows_container_network_receive_bytes_total{container_id!=\"\", cluster=\"$cluster\"}[$__rate_interval]) * on (container_id) group_left (container, pod, namespace) max by ( container, container_id, pod, namespace) (kube_pod_container_info{container_id!=\"\", cluster=\"$cluster\"}) OR kube_namespace_created{cluster=\"$cluster\"} * 0) by (namespace))", + "interval": "$resolution", + "legendFormat": "Received : {{`{{ namespace }}`}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "- (sum(rate(container_network_transmit_bytes_total{cluster=\"$cluster\"}[$__rate_interval])) by (namespace)\n+ on (namespace)\n(sum(rate(windows_container_network_transmit_bytes_total{container_id!=\"\", cluster=\"$cluster\"}[$__rate_interval]) * on (container_id) group_left (container, pod, namespace) max by ( container, container_id, pod, namespace) (kube_pod_container_info{container_id!=\"\", cluster=\"$cluster\"}) OR kube_namespace_created{cluster=\"$cluster\"} * 0) by (namespace)))", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted : {{`{{ namespace }}`}}", + "range": true, + "refId": "B" + } + ], + "title": "Network Received by namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "BANDWIDTH", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 74 + }, + "id": 80, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_bytes_total{cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "Received bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "Linux Received bytes" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "- sum(rate(node_network_transmit_bytes_total{cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "Linux Transmitted bytes" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(windows_net_bytes_received_total{cluster=\"$cluster\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Received bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "Windows Received bytes" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "- sum(rate(windows_net_bytes_sent_total{cluster=\"$cluster\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "Windows Transmitted bytes" + } + ], + "title": "Total Network Received (with all virtual devices) by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Dropped noisy virtual devices for readability.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "BANDWIDTH", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 82 + }, + "id": 56, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_bytes_total{device!~\"(veth|azv|lxc|lo).*\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "Received bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "- sum(rate(node_network_transmit_bytes_total{device!~\"(veth|azv|lxc|lo).*\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(windows_net_bytes_received_total{nic!~\".*Virtual.*\",cluster=\"$cluster\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Received bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(windows_net_bytes_sent_total{nic!~\".*Virtual.*\",cluster=\"$cluster\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "D" + } + ], + "title": "Network Received (without loopback) by instance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Dropped noisy virtual devices for readability.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "BANDWIDTH", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 82 + }, + "id": 81, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_bytes_total{device=\"lo\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "interval": "$resolution", + "legendFormat": "Received bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "- sum(rate(node_network_transmit_bytes_total{device=\"lo\", cluster=\"$cluster\", job=\"$job\"}[$__rate_interval])) by (instance)", + "hide": false, + "interval": "$resolution", + "legendFormat": "Transmitted bytes in {{`{{ instance }}`}}", + "range": true, + "refId": "B" + } + ], + "title": "Network Received (loopback only) by instance", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(node_cpu_seconds_total{cluster=\"$cluster\"},job)", + "hide": 0, + "includeAll": false, + "multi": true, + "name": "job", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(node_cpu_seconds_total{cluster=\"$cluster\"},job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubernetes / Views / Global", + "uid": "k8s_views_global", + "version": 39, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-views-global + namespace: prometheus +--- +apiVersion: v1 +data: + k8s-views-namespaces.json: | + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.3.1" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern 'Namespaces View' dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 38, + "panels": [], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 50 + }, + { + "color": "red", + "value": 70 + } + ] + }, + "unit": "percentunit", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 0, + "y": 1 + }, + "id": 46, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=~\"$namespace\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) / sum(machine_cpu_cores{cluster=\"$cluster\"})", + "instant": true, + "interval": "", + "legendFormat": "", + "range": false, + "refId": "A" + } + ], + "title": "Namespace(s) usage on total cluster CPU in %", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 50 + }, + { + "color": "red", + "value": 70 + } + ] + }, + "unit": "percentunit", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 6, + "y": 1 + }, + "id": 48, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{namespace=~\"$namespace\", image!=\"\", cluster=\"$cluster\"}) / sum(machine_memory_bytes{cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Namespace(s) usage on total cluster RAM in %", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 32, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Running Pods", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_service_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Services", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_ingress_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Ingresses", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_deployment_labels{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Deployments", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_statefulset_labels{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Statefulsets", + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_daemonset_labels{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Daemonsets", + "refId": "F" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_persistentvolumeclaim_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Persistent Volume Claims", + "refId": "G" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_hpa_labels{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Horizontal Pod Autoscalers", + "refId": "H" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_configmap_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Configmaps", + "refId": "I" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_secret_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Secrets", + "refId": "J" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_networkpolicy_labels{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Network Policies", + "refId": "K" + } + ], + "title": "Kubernetes Resource Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 62, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=~\"$namespace\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "", + "legendFormat": "Real", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_requests{namespace=~\"$namespace\", resource=\"cpu\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Requests", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_limits{namespace=~\"$namespace\", resource=\"cpu\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Limits", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(machine_cpu_cores{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Cluster Total", + "range": true, + "refId": "D" + } + ], + "title": "Namespace(s) CPU Usage in cores", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 64, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{namespace=~\"$namespace\", image!=\"\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Real", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_requests{namespace=~\"$namespace\", resource=\"memory\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Requests", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_resource_limits{namespace=~\"$namespace\", resource=\"memory\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Limits", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(machine_memory_bytes{cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Cluster Total", + "range": true, + "refId": "D" + } + ], + "title": "Namespace(s) RAM Usage in bytes", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 40, + "panels": [], + "title": "Resources", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU CORES", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 13 + }, + "id": 29, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=~\"$namespace\", image!=\"\", pod=~\"${created_by}.*\", cluster=\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU usage by Pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 13 + }, + "id": 30, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{namespace=~\"$namespace\", image!=\"\", pod=~\"${created_by}.*\", cluster=\"$cluster\"}) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Memory usage by Pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "SECONDS", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 68, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_cfs_throttled_seconds_total{namespace=~\"$namespace\", image!=\"\", pod=~\"${created_by}.*\", cluster=\"$cluster\"}[$__rate_interval])) by (pod) > 0", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Throttled seconds by pod", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 29 + }, + "id": 73, + "panels": [], + "title": "Kubernetes", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 70, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_qos_class{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (qos_class)", + "interval": "", + "legendFormat": "{{`{{ qos_class }}`}} pods", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_info{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "hide": false, + "legendFormat": "Total pods", + "range": true, + "refId": "B" + } + ], + "title": "Kubernetes Pods QoS classes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 72, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_reason{cluster=\"$cluster\"}) by (reason)", + "interval": "", + "legendFormat": "{{`{{ reason }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Kubernetes Pods Status Reason", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "No data is generally a good thing here.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 39 + }, + "id": 74, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(increase(container_oom_events_total{namespace=~\"${namespace}\", cluster=\"$cluster\"}[$__rate_interval])) by (namespace, pod) > 0", + "interval": "", + "legendFormat": "namespace: {{`{{ namespace }}`}} - pod: {{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "OOM Events by namespace, pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "No data is generally a good thing here.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "points", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 39 + }, + "id": 75, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(increase(kube_pod_container_status_restarts_total{namespace=~\"${namespace}\", cluster=\"$cluster\"}[$__rate_interval])) by (namespace, pod) > 0", + "interval": "", + "legendFormat": "namespace: {{`{{ namespace }}`}} - pod: {{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Container Restarts by namespace, pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 48 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_status_ready{namespace=~\"$namespace\", pod=~\"${created_by}.*\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Ready", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_status_running{namespace=~\"$namespace\", pod=~\"${created_by}.*\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Running", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_container_status_waiting{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Waiting", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_container_status_restarts_total{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Restarts Total", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(kube_pod_container_status_terminated{namespace=~\"$namespace\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "Terminated", + "refId": "E" + } + ], + "title": "Nb of pods by state", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 48 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_info{namespace=~\"$namespace\", pod=~\"${created_by}.*\", cluster=\"$cluster\"}) by (pod)", + "interval": "", + "legendFormat": "{{`{{ pod }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Nb of containers by pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 56 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_deployment_status_replicas_available{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (deployment)", + "interval": "", + "legendFormat": "{{`{{ deployment }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Replicas available by deployment", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 56 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_deployment_status_replicas_unavailable{namespace=~\"$namespace\", pod=~\"${created_by}.*\", cluster=\"$cluster\"}) by (deployment)", + "interval": "", + "legendFormat": "{{`{{ deployment }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Replicas unavailable by deployment", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 64 + }, + "id": 42, + "panels": [], + "title": "Kubernetes Storage", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 65 + }, + "id": 65, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kubelet_volume_stats_used_bytes{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (persistentvolumeclaim) / sum(kubelet_volume_stats_capacity_bytes{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "interval": "", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}}", + "refId": "A" + } + ], + "title": "Persistent Volumes - Capacity and usage in %", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 65 + }, + "id": 66, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kubelet_volume_stats_used_bytes{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "interval": "", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}} - Used", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kubelet_volume_stats_capacity_bytes{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "hide": false, + "interval": "", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}} - Capacity", + "refId": "B" + } + ], + "title": "Persistent Volumes - Capacity and usage in bytes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 73 + }, + "id": 27, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "1 - sum(kubelet_volume_stats_inodes_used{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (persistentvolumeclaim) / sum(kubelet_volume_stats_inodes{namespace=~\"$namespace\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "interval": "", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}}", + "refId": "A" + } + ], + "title": "Persistent Volumes - Inodes", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": {}, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_pod_info{namespace=~\"$namespace\", container!=\"\", cluster=\"$cluster\"},created_by_name)", + "description": "Can be used to filter on a specific deployment, statefulset or deamonset (only relevant panels).", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "created_by", + "options": [], + "query": { + "query": "label_values(kube_pod_info{namespace=~\"$namespace\", container!=\"\", cluster=\"$cluster\"},created_by_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubernetes / Views / Namespaces", + "uid": "k8s_views_ns", + "version": 34, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-views-namespaces + namespace: prometheus +--- +apiVersion: v1 +data: + k8s-views-nodes.json: | + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.3.1" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern 'Nodes View' dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 40, + "panels": [], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 50 + }, + { + "color": "red", + "value": 70 + } + ] + }, + "unit": "percentunit", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 7, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": false, + "expr": "avg(sum by (cpu) (rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])))", + "instant": true, + "interval": "$resolution", + "legendFormat": "", + "refId": "A" + } + ], + "title": "CPU Usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 50 + }, + { + "color": "red", + "value": 70 + } + ] + }, + "unit": "percentunit", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 13, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "text": {} + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": false, + "expr": "sum(node_memory_MemTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"} - node_memory_MemAvailable_bytes{instance=\"$instance\", cluster=\"$cluster\"}) / sum(node_memory_MemTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"})", + "instant": true, + "interval": "$resolution", + "legendFormat": "", + "refId": "A" + } + ], + "title": "RAM Usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 8, + "y": 1 + }, + "id": 24, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kube_pod_info{node=\"$node\", cluster=\"$cluster\"})", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Pods on node", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "links": [ + { + "targetBlank": true, + "title": "Pod details", + "url": "/d/k8s_views_pods/kubernetes-views-pods?${datasource:queryparam}&var-namespace=${__data.fields.namespace}&var-pod=${__data.fields.pod}&${resolution:queryparam}&${__url_time_range}" + } + ], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unitScale": true + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "pod" + }, + "properties": [ + { + "id": "custom.width", + "value": 416 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "priority_class" + }, + "properties": [ + { + "id": "custom.width", + "value": 176 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "pod_ip" + }, + "properties": [ + { + "id": "custom.width", + "value": 157 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "created_by_kind" + }, + "properties": [ + { + "id": "custom.width", + "value": 205 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "namespace" + }, + "properties": [ + { + "id": "custom.width", + "value": 263 + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 5, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "kube_pod_info{node=\"$node\", cluster=\"$cluster\"}", + "format": "table", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "List of pods on node ($node)", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": true, + "__name__": true, + "container": true, + "created_by_kind": false, + "created_by_name": true, + "endpoint": true, + "env": true, + "host_ip": true, + "host_network": true, + "instance": true, + "job": true, + "node": true, + "project": true, + "prometheus_replica": true, + "service": true, + "uid": true + }, + "indexByName": { + "Time": 6, + "Value": 20, + "__name__": 7, + "container": 8, + "created_by_kind": 2, + "created_by_name": 9, + "endpoint": 10, + "env": 11, + "host_ip": 5, + "host_network": 12, + "instance": 13, + "job": 14, + "namespace": 1, + "node": 15, + "pod": 0, + "pod_ip": 3, + "priority_class": 4, + "project": 16, + "prometheus_replica": 17, + "service": 18, + "uid": 19 + }, + "renameByName": {} + } + }, + { + "id": "groupBy", + "options": { + "fields": { + "created_by_kind": { + "aggregations": [], + "operation": "groupby" + }, + "host_ip": { + "aggregations": [], + "operation": "groupby" + }, + "namespace": { + "aggregations": [ + "last" + ], + "operation": "groupby" + }, + "pod": { + "aggregations": [], + "operation": "groupby" + }, + "pod_ip": { + "aggregations": [], + "operation": "groupby" + }, + "priority_class": { + "aggregations": [], + "operation": "groupby" + } + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 3, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 0, + "y": 9 + }, + "id": 9, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": false, + "expr": "sum(rate(node_cpu_seconds_total{mode!~\"idle|iowait|steal\", instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "instant": true, + "interval": "$resolution", + "legendFormat": "", + "refId": "A" + } + ], + "title": "CPU Used", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 2, + "y": 9 + }, + "id": 11, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(machine_cpu_cores{node=\"$node\", cluster=\"$cluster\"})", + "interval": "$resolution", + "legendFormat": "", + "refId": "A" + } + ], + "title": "CPU Total", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 4, + "y": 9 + }, + "id": 15, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": false, + "expr": "sum(node_memory_MemTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"} - node_memory_MemAvailable_bytes{instance=\"$instance\", cluster=\"$cluster\"})", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "RAM Used", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "bytes", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 6, + "y": 9 + }, + "id": 17, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "machine_memory_bytes{node=\"$node\", cluster=\"$cluster\"}", + "instant": false, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "RAM Total", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 25228800 + }, + { + "color": "red", + "value": 31536000 + } + ] + }, + "unit": "s", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 8, + "y": 9 + }, + "id": 18, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_time_seconds{instance=\"$instance\", cluster=\"$cluster\"} - node_boot_time_seconds{instance=\"$instance\", cluster=\"$cluster\"}", + "instant": false, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "uptime", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 38, + "panels": [], + "title": "Resources", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 100, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 13 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "avg(rate(node_cpu_seconds_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]) * 100) by (mode)", + "hide": false, + "instant": false, + "interval": "$resolution", + "legendFormat": "{{`{{ mode }}`}}", + "refId": "A" + } + ], + "title": "CPU Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 13 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_MemTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"} - node_memory_MemFree_bytes{instance=\"$instance\", cluster=\"$cluster\"} - (node_memory_Cached_bytes{instance=\"$instance\", cluster=\"$cluster\"} + node_memory_Buffers_bytes{instance=\"$instance\", cluster=\"$cluster\"})", + "instant": false, + "interval": "$resolution", + "legendFormat": "RAM Used", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_MemTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "RAM Total", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_Cached_bytes{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "RAM Cache", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_Buffers_bytes{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "RAM Buffer", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_MemFree_bytes{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "RAM Free", + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_SwapTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"} - node_memory_SwapFree_bytes{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "SWAP Used", + "refId": "F" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "node_memory_SwapTotal_bytes{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "SWAP Total", + "refId": "G" + } + ], + "title": "Memory Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU Cores", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 26, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{node=\"$node\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}}", + "refId": "A" + } + ], + "title": "CPU usage by Pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 22 + }, + "id": 28, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{node=\"$node\", image!=\"\", cluster=\"$cluster\"}) by (pod)", + "interval": "$resolution", + "legendFormat": "{{`{{ pod }}`}}", + "refId": "A" + } + ], + "title": "Memory usage by Pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Number of times a CPU core has been throttled on an instance.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU CORES", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 66, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_cpu_core_throttles_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Nb of cpu core throttles", + "range": true, + "refId": "A" + } + ], + "title": "Number of CPU Core Throttled", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 44, + "panels": [], + "title": "System", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 39 + }, + "id": 48, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_load1{instance=\"$instance\", cluster=\"$cluster\"}", + "interval": "$resolution", + "legendFormat": "1m", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_load5{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "5m", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_load15{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "15m", + "range": true, + "refId": "C" + } + ], + "title": "System Load", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 39 + }, + "id": 46, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_context_switches_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])", + "interval": "$resolution", + "intervalFactor": 1, + "legendFormat": "Context switches", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_intr_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])", + "hide": false, + "interval": "$resolution", + "legendFormat": "Interrupts", + "range": true, + "refId": "B" + } + ], + "title": "Context Switches & Interrupts", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 47 + }, + "id": 49, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_filefd_maximum{instance=\"$instance\", cluster=\"$cluster\"}", + "instant": false, + "interval": "$resolution", + "legendFormat": "Maximum file descriptors", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_filefd_allocated{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "instant": false, + "interval": "$resolution", + "legendFormat": "Allocated file descriptors", + "refId": "B" + } + ], + "title": "File Descriptors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 47 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_timex_estimated_error_seconds{instance=\"$instance\", cluster=\"$cluster\"}", + "instant": false, + "interval": "$resolution", + "intervalFactor": 1, + "legendFormat": "Estimated error in seconds", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_timex_maxerror_seconds{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "intervalFactor": 1, + "legendFormat": "Maximum error in seconds", + "range": true, + "refId": "B" + } + ], + "title": "Time Sync", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 55 + }, + "id": 36, + "panels": [], + "title": "Network", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "BANDWIDTH", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 56 + }, + "id": 20, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_bytes_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "In", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(node_network_transmit_bytes_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Out", + "range": true, + "refId": "B" + } + ], + "title": "Network usage (bytes)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 56 + }, + "id": 61, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(node_network_receive_errs_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "In", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(node_network_transmit_errs_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Out", + "range": true, + "refId": "B" + } + ], + "title": "Network errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 64 + }, + "id": 62, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(node_network_receive_packets_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "In", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "- sum(rate(node_network_transmit_packets_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Out", + "range": true, + "refId": "B" + } + ], + "title": "Network usage (packet/s)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 64 + }, + "id": 64, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(node_network_receive_drop_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "hide": false, + "interval": "$resolution", + "legendFormat": "In", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "- sum(rate(node_network_transmit_drop_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]))", + "hide": false, + "interval": "$resolution", + "legendFormat": "Out", + "refId": "B" + } + ], + "title": "Network total drops", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 72 + }, + "id": 60, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_netstat_Tcp_CurrEstab{instance=\"$instance\", cluster=\"$cluster\"}", + "instant": false, + "interval": "$resolution", + "legendFormat": "TCP Currently Established", + "refId": "A" + } + ], + "title": "TCP Currently Established", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "NF Conntrack limit" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 72 + }, + "id": 63, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_nf_conntrack_entries{instance=\"$instance\", cluster=\"$cluster\"}", + "instant": false, + "interval": "$resolution", + "legendFormat": "NF Conntrack entries", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "node_nf_conntrack_entries_limit{instance=\"$instance\", cluster=\"$cluster\"}", + "hide": false, + "interval": "$resolution", + "legendFormat": "NF Conntrack limit", + "range": true, + "refId": "B" + } + ], + "title": "NF Conntrack", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 80 + }, + "id": 54, + "panels": [], + "title": "Kubernetes Storage", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 81 + }, + "id": 30, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kubelet_volume_stats_used_bytes{node=\"$node\", cluster=\"$cluster\"}) by (persistentvolumeclaim) / sum(kubelet_volume_stats_capacity_bytes{node=\"$node\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "interval": "$resolution", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Persistent Volumes - Usage in %", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Used" + }, + "properties": [ + { + "id": "custom.width", + "value": 146 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "custom.width", + "value": 167 + } + ] + } + ] + }, + "gridPos": { + "h": 16, + "w": 12, + "x": 12, + "y": 81 + }, + "id": 34, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "10.2.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kubelet_volume_stats_used_bytes{node=\"$node\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "format": "table", + "hide": false, + "interval": "", + "legendFormat": "", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(kubelet_volume_stats_capacity_bytes{node=\"$node\", cluster=\"$cluster\"}) by (persistentvolumeclaim)", + "format": "table", + "hide": false, + "interval": "", + "legendFormat": "", + "refId": "B" + } + ], + "title": "Persistent Volumes - Usage in GB", + "transformations": [ + { + "id": "groupBy", + "options": { + "fields": { + "Value": { + "aggregations": [ + "lastNotNull" + ], + "operation": "aggregate" + }, + "Value #A": { + "aggregations": [ + "lastNotNull" + ], + "operation": "aggregate" + }, + "Value #B": { + "aggregations": [ + "lastNotNull" + ], + "operation": "aggregate" + }, + "persistentvolumeclaim": { + "aggregations": [], + "operation": "groupby" + } + } + } + }, + { + "id": "seriesToColumns", + "options": { + "byField": "persistentvolumeclaim" + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": {}, + "renameByName": { + "Value #A (lastNotNull)": "Used", + "Value #B (lastNotNull)": "Total", + "persistentvolumeclaim": "Persistent Volume Claim" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 89 + }, + "id": 32, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kubelet_volume_stats_inodes_used{node=\"$node\", cluster=\"$cluster\"}) by (persistentvolumeclaim) / sum(kubelet_volume_stats_inodes{node=\"$node\", cluster=\"$cluster\"}) by (persistentvolumeclaim) * 100", + "interval": "$resolution", + "legendFormat": "{{`{{ persistentvolumeclaim }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Persistent Volumes - Inodes", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 97 + }, + "id": 42, + "panels": [], + "title": "Node Storage", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 98 + }, + "id": 33, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "100 - ((node_filesystem_avail_bytes{instance=\"$instance\", cluster=\"$cluster\"} * 100) / node_filesystem_size_bytes{instance=\"$instance\", cluster=\"$cluster\"})", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{ mountpoint }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "FS usage in %", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 98 + }, + "id": 59, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "100 - (node_filesystem_files_free{instance=\"$instance\", cluster=\"$cluster\"} / node_filesystem_files{instance=\"$instance\", cluster=\"$cluster\"} * 100)", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{ mountpoint }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "FS inode usage in %", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 106 + }, + "id": 52, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_disk_read_bytes_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])", + "interval": "$resolution", + "legendFormat": "{{`{{device}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Reads by disk (bytes)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 106 + }, + "id": 57, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_disk_written_bytes_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{device}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Writes by disk (bytes)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "read/s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 114 + }, + "id": 51, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_disk_reads_completed_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])", + "interval": "$resolution", + "legendFormat": "{{`{{device}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Completed reads by disk", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "write/s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 114 + }, + "id": 56, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_disk_writes_completed_total{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval])", + "hide": false, + "interval": "$resolution", + "legendFormat": "{{`{{device}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Completed writes by disk", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "io/s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 122 + }, + "id": 58, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(node_disk_io_now{instance=\"$instance\", cluster=\"$cluster\"}[$__rate_interval]) ", + "interval": "$resolution", + "legendFormat": "{{`{{device}}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Disk(s) io/s", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 122 + }, + "id": 55, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(node_filesystem_device_error{instance=\"$instance\", cluster=\"$cluster\"}) by (mountpoint)", + "interval": "$resolution", + "legendFormat": "{{`{{ mountpoint }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "FS - Device Errors", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": {}, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info{cluster=\"$cluster\"}, node)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "node", + "options": [], + "query": { + "query": "label_values(kube_node_info{cluster=\"$cluster\"}, node)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(node_uname_info{nodename=~\"(?i:($node))\"}, instance)", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "label_values(node_uname_info{nodename=~\"(?i:($node))\"}, instance)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubernetes / Views / Nodes", + "uid": "k8s_views_nodes", + "version": 29, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-views-nodes + namespace: prometheus +--- +apiVersion: v1 +data: + k8s-views-pods.json: | + { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.4" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "5.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "This is a modern 'Pods View' dashboard for your Kubernetes cluster(s). Made for kube-prometheus-stack and take advantage of the latest Grafana features. GitHub repository: https://github.com/dotdc/grafana-dashboards-kubernetes", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 43, + "panels": [], + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], + "title": "Information", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 2, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_info{namespace=\"$namespace\", pod=\"$pod\", cluster=\"$cluster\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ created_by_kind }}`}}: {{`{{ created_by_name }}`}}", + "refId": "A" + } + ], + "title": "Created by", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "links": [ + { + "title": "", + "url": "/d/k8s_views_nodes/kubernetes-views-nodes?var-datasource=${datasource}&var-node=${__data.fields.node}" + } + ], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 33, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_info{namespace=\"$namespace\", pod=\"$pod\", cluster=\"$cluster\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ node }}`}}", + "refId": "A" + } + ], + "title": "Running on", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 41, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_info{namespace=\"$namespace\", pod=\"$pod\", cluster=\"$cluster\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ pod_ip }}`}}", + "refId": "A" + } + ], + "title": "Pod IP", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(255, 255, 255)", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 5, + "x": 0, + "y": 3 + }, + "id": 52, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_info{namespace=\"$namespace\", pod=\"$pod\", priority_class!=\"\", cluster=\"$cluster\"}", + "format": "time_series", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ priority_class }}`}}", + "range": false, + "refId": "A" + } + ], + "title": "Priority Class", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Burstable" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "BestEffort" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 2, + "w": 7, + "x": 5, + "y": 3 + }, + "id": 53, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_status_qos_class{namespace=\"$namespace\", pod=\"$pod\", cluster=\"$cluster\"} > 0", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ qos_class }}`}}", + "refId": "A" + } + ], + "title": "QOS Class", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + }, + { + "color": "red", + "value": 1 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 12, + "y": 3 + }, + "id": 56, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "name", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_container_status_last_terminated_reason{namespace=\"$namespace\", pod=\"$pod\", cluster=\"$cluster\"}", + "instant": true, + "interval": "", + "legendFormat": "{{`{{ reason }}`}}", + "refId": "A" + } + ], + "title": "Last Terminated Reason", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Panel only works when a single pod is selected.", + "fieldConfig": { + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + }, + { + "color": "red", + "value": 1 + }, + { + "color": "#EAB839", + "value": 2 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 6, + "x": 18, + "y": 3 + }, + "id": 57, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": true + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "kube_pod_container_status_last_terminated_exitcode{namespace=\"$namespace\", pod=\"$pod\", cluster=\"$cluster\"}", + "instant": true, + "interval": "", + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Last Terminated Exit Code", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 47, + "panels": [], + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], + "title": "Resources", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 60 + }, + { + "color": "red", + "value": 75 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 0, + "y": 6 + }, + "id": 39, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) / sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$pod\", resource=\"cpu\", job=~\"$job\", cluster=\"$cluster\"})", + "instant": true, + "interval": "$resolution", + "legendFormat": "Requests", + "refId": "A" + } + ], + "title": "Total pod CPU Requests usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 60 + }, + { + "color": "red", + "value": 75 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 3, + "y": 6 + }, + "id": 48, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) / sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$pod\", resource=\"cpu\", job=~\"$job\", cluster=\"$cluster\"})", + "instant": true, + "interval": "$resolution", + "legendFormat": "Limits", + "refId": "A" + } + ], + "title": "Total pod CPU Limits usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "blue", + "value": null + }, + { + "color": "#EAB839", + "value": 80 + }, + { + "color": "red", + "value": 99 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 6, + "y": 6 + }, + "id": 40, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}) / sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$pod\", resource=\"memory\", job=~\"$job\", cluster=\"$cluster\"})", + "instant": true, + "interval": "$resolution", + "legendFormat": "Requests", + "refId": "A" + } + ], + "title": "Total pod RAM Requests usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "decimals": 2, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 60 + }, + { + "color": "red", + "value": 75 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 9, + "y": 6 + }, + "id": 49, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}) / sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$pod\", resource=\"memory\", job=~\"$job\", cluster=\"$cluster\"}) ", + "instant": true, + "interval": "$resolution", + "legendFormat": "Limits", + "refId": "B" + } + ], + "title": "Total pod RAM Limits usage", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false, + "minWidth": 100 + }, + "decimals": 4, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Memory Requests" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Memory Limits" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Memory Used" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + }, + { + "id": "decimals", + "value": 2 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 6 + }, + "id": 38, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$pod\", resource=\"cpu\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$pod\", resource=\"cpu\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "format": "table", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$pod\", resource=\"memory\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$pod\", resource=\"memory\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", container!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (container)", + "format": "table", + "hide": false, + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", container!=\"\", cluster=\"$cluster\"}) by (container)", + "format": "table", + "hide": false, + "instant": true, + "range": false, + "refId": "F" + } + ], + "title": "Resources by container", + "transformations": [ + { + "id": "seriesToColumns", + "options": { + "byField": "container" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Time 1": true, + "Time 2": true, + "Time 4": true, + "__name__": true, + "__name__ 1": true, + "__name__ 2": true, + "__name__ 3": true, + "__name__ 4": true, + "container": false, + "endpoint": true, + "endpoint 2": true, + "endpoint 3": true, + "endpoint 4": true, + "instance": true, + "instance 2": true, + "instance 3": true, + "instance 4": true, + "job": true, + "job 2": true, + "job 3": true, + "job 4": true, + "namespace": true, + "namespace 2": true, + "namespace 3": true, + "namespace 4": true, + "node": true, + "node 2": true, + "node 3": true, + "node 4": true, + "pod": true, + "pod 2": true, + "pod 3": true, + "pod 4": true, + "resource 1": true, + "resource 2": true, + "resource 3": true, + "resource 4": true, + "service": true, + "service 2": true, + "service 3": true, + "service 4": true, + "uid 1": true, + "uid 2": true, + "uid 3": true, + "uid 4": true, + "unit 1": true, + "unit 2": true, + "unit 3": true, + "unit 4": true + }, + "indexByName": { + "Time 1": 7, + "Time 2": 8, + "Time 3": 9, + "Time 4": 10, + "Time 5": 11, + "Time 6": 12, + "Value #A": 2, + "Value #B": 3, + "Value #C": 5, + "Value #D": 6, + "Value #E": 1, + "Value #F": 4, + "container": 0 + }, + "renameByName": { + "Value #A": "CPU Requests", + "Value #B": "CPU Limits", + "Value #C": "Memory Requests", + "Value #D": "Memory Limits", + "Value #E": "CPU Used", + "Value #F": "Memory Used", + "container": "Container" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Percent", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "area" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": 20 + }, + { + "color": "green", + "value": 30 + }, + { + "color": "yellow", + "value": 70 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 14 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (container) / sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$pod\", resource=\"cpu\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "interval": "$resolution", + "legendFormat": "{{`{{ container }}`}} REQUESTS", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (container) / sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$pod\", resource=\"cpu\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "hide": false, + "legendFormat": "{{`{{ container }}`}} LIMITS", + "range": true, + "refId": "B" + } + ], + "title": "CPU Usage / Requests & Limits by container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Percent", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "area" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": 20 + }, + { + "color": "green", + "value": 30 + }, + { + "color": "#EAB839", + "value": 70 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 14 + }, + "id": 30, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}) by (container) / sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$pod\", resource=\"memory\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "interval": "", + "legendFormat": "{{`{{ container }}`}} REQUESTS", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", cluster=\"$cluster\"}) by (container) / sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$pod\", resource=\"memory\", job=~\"$job\", cluster=\"$cluster\"}) by (container)", + "hide": false, + "legendFormat": "{{`{{ container }}`}} LIMITS", + "range": true, + "refId": "B" + } + ], + "title": "Memory Usage / Requests & Limits by container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "CPU Cores", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 4, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "limit" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2495C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 29, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", container!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (container)", + "interval": "$resolution", + "legendFormat": "{{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Usage by container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 22 + }, + "id": 51, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", image!=\"\", container!=\"\", cluster=\"$cluster\"}) by (container)", + "interval": "", + "legendFormat": "{{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Memory Usage by container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "SECONDS", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 59, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(rate(container_cpu_cfs_throttled_seconds_total{namespace=~\"$namespace\", pod=~\"$pod\", image!=\"\", container!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (container)", + "interval": "$resolution", + "legendFormat": "{{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Throttled seconds by container", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 62, + "panels": [], + "title": "Kubernetes", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Percent", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "area" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": 20 + }, + { + "color": "green", + "value": 30 + }, + { + "color": "#EAB839", + "value": 70 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 39 + }, + "id": 60, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(increase(container_oom_events_total{namespace=\"${namespace}\", pod=\"${pod}\", container!=\"\", cluster=\"$cluster\"}[$__rate_interval])) by (container)", + "interval": "", + "legendFormat": "{{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "OOM Events by container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Percent", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "area" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": 20 + }, + { + "color": "green", + "value": 30 + }, + { + "color": "#EAB839", + "value": 70 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 39 + }, + "id": 61, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(increase(kube_pod_container_status_restarts_total{namespace=~\"${namespace}\", pod=\"${pod}\", container!=\"\", job=~\"$job\", cluster=\"$cluster\"}[$__rate_interval])) by (container)", + "interval": "", + "legendFormat": "{{`{{ container }}`}}", + "range": true, + "refId": "A" + } + ], + "title": "Container Restarts by container", + "type": "timeseries" + }, + { + "collapsed": false, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 47 + }, + "id": 45, + "panels": [], + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], + "title": "Network", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 48 + }, + "id": 31, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(container_network_receive_bytes_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Received", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_bytes_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Transmitted", + "refId": "B" + } + ], + "title": "Network - Bandwidth", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 48 + }, + "id": 34, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(container_network_receive_packets_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Received", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_packets_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Transmitted", + "refId": "B" + } + ], + "title": "Network - Packets Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 56 + }, + "id": 36, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(container_network_receive_packets_dropped_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Received", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_packets_dropped_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Transmitted", + "refId": "B" + } + ], + "title": "Network - Packets Dropped", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 56 + }, + "id": 37, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "sum(rate(container_network_receive_errors_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Received", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "exemplar": true, + "expr": "- sum(rate(container_network_transmit_errors_total{namespace=\"$namespace\", pod=~\"$pod\", cluster=\"$cluster\"}[$__rate_interval]))", + "interval": "$resolution", + "legendFormat": "Transmitted", + "refId": "B" + } + ], + "title": "Network - Errors", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "Kubernetes", + "Prometheus" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_node_info,cluster)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "cluster", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_node_info,cluster)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "monitoring", + "value": "monitoring" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)", + "refId": "Prometheus-namespace-Variable-Query" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_pod_info{namespace=\"$namespace\", cluster=\"$cluster\"}, pod)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "pod", + "options": [], + "query": { + "query": "label_values(kube_pod_info{namespace=\"$namespace\", cluster=\"$cluster\"}, pod)", + "refId": "Prometheus-pod-Variable-Query" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "30s", + "value": "30s" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "resolution", + "options": [ + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": true, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "3m", + "value": "3m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + } + ], + "query": "1s, 15s, 30s, 1m, 3m, 5m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "kube-state-metrics", + "value": "kube-state-metrics" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(kube_pod_info{namespace=\"$namespace\", cluster=\"$cluster\"},job)", + "hide": 0, + "includeAll": false, + "multi": true, + "name": "job", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(kube_pod_info{namespace=\"$namespace\", cluster=\"$cluster\"},job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubernetes / Views / Pods", + "uid": "k8s_views_pods", + "version": 28, + "weekStart": "" + } +kind: ConfigMap +metadata: + annotations: + grafana_folder: Kubernetes + labels: + grafana_dashboard: "1" + name: dashboards-k8s-views-pods + namespace: prometheus diff --git a/values/prometheus/manifests/dashboards/persistent-volume-usage.yaml b/values/prometheus/manifests/dashboards/persistent-volume-usage.yaml new file mode 100644 index 00000000..40e123ef --- /dev/null +++ b/values/prometheus/manifests/dashboards/persistent-volume-usage.yaml @@ -0,0 +1,1592 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: persistent-volumes + namespace: prometheus + labels: + grafana_dashboard: "1" + annotations: + grafana_folder: Kubernetes +data: + persistent-volumes.json: |- + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "limit": 100, + "name": "Annotations & Alerts", + "showIn": 0, + "type": "dashboard" + } + ] + }, + "description": "Monitors all persistent volumes that exists within a Kubernetes cluster. Prometheus is used as datasource. ", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 13646, + "graphTooltip": 0, + "id": 48, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 26, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Alerts", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "light-green", + "value": null + }, + { + "color": "light-green", + "value": -0.0001 + }, + { + "color": "semi-dark-orange", + "value": 0.0001 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 0, + "y": 1 + }, + "id": 22, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "(\n count (\n (kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"})\n and\n (predict_linear(kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"}[1d], 2 * 24 * 60 * 60) < 0)\n )\n)\nor\nvector(0)", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "PVCs Full in 2 days - Based on Daily Usage", + "transformations": [ + { + "id": "organize", + "options": {} + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "light-green", + "value": null + }, + { + "color": "light-green", + "value": -0.0001 + }, + { + "color": "semi-dark-orange", + "value": 0.0001 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 1 + }, + "id": 28, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "(\n count (\n (kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"})\n and\n (predict_linear(kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"}[1d], 5 * 24 * 60 * 60) < 0)\n )\n)\nor\nvector(0)", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "PVCs Full in 5 days - Based on Daily Usage", + "transformations": [ + { + "id": "organize", + "options": {} + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "light-green", + "value": null + }, + { + "color": "light-green", + "value": -0.0001 + }, + { + "color": "semi-dark-orange", + "value": 0.0001 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 16, + "y": 1 + }, + "id": 27, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "(\n count (\n (kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"})\n and\n (predict_linear(kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"}[1d], 7 * 24 * 60 * 60) < 0)\n )\n)\nor\nvector(0)", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "PVCs Full in 1 Week - Based on Daily Usage", + "transformations": [ + { + "id": "organize", + "options": {} + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-red", + "value": null + }, + { + "color": "light-green", + "value": -0.0001 + }, + { + "color": "semi-dark-red", + "value": 0.0001 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 0, + "y": 5 + }, + "id": 21, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "count (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"} ) and (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"} )) / (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"} )) >= (${warning_threshold} / 100)) or vector (0)", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "PVCs Above Warning Threshold", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-red", + "value": null + }, + { + "color": "light-green", + "value": -0.0001 + }, + { + "color": "semi-dark-red", + "value": 0.0001 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 5 + }, + "id": 24, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "count((kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=\"Pending\"}==1)) or vector(0)", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "PVCs in Pending State", + "transformations": [ + { + "id": "organize", + "options": {} + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-red", + "value": null + }, + { + "color": "light-green", + "value": -0.0001 + }, + { + "color": "semi-dark-red", + "value": 0.0001 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 16, + "y": 5 + }, + "id": 23, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "count((kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=\"Lost\"}==1)) or vector(0)", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "PVCs in Lost State", + "transformations": [ + { + "id": "organize", + "options": {} + } + ], + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 17, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Usage statistics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false + }, + "mappings": [], + "noValue": "--", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "light-green", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Used (%)" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge" + } + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "light-green", + "value": null + }, + { + "color": "semi-dark-yellow", + "value": 70 + }, + { + "color": "dark-red", + "value": 80 + } + ] + } + }, + { + "id": "decimals", + "value": 1 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "mappings", + "value": [ + { + "options": { + "0": { + "text": "Bound" + }, + "1": { + "text": "Pending" + }, + "2": { + "text": "Lost" + } + }, + "type": "value" + } + ] + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "light-green", + "value": null + }, + { + "color": "light-green", + "value": 0 + }, + { + "color": "semi-dark-orange", + "value": 1 + }, + { + "color": "semi-dark-red", + "value": 2 + } + ] + } + }, + { + "id": "noValue", + "value": "--" + }, + { + "id": "custom.align", + "value": "center" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Namespace" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "custom.width", + "value": 80 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Capacity (GiB)" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Used (GiB)" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Available (GiB)" + }, + "properties": [ + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "StorageClass" + }, + "properties": [ + { + "id": "custom.width", + "value": 150 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PersistentVolumeClaim" + }, + "properties": [ + { + "id": "custom.width", + "value": 370 + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 29, + "interval": "", + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 2, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Used (%)" + } + ] + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": " sum by (persistentvolumeclaim,namespace,storageclass,volumename) (kube_persistentvolumeclaim_info{namespace=~\"${k8s_namespace}\"})", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum(kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=~\"(Pending|Lost)\"}) by (persistentvolumeclaim) + sum(kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=~\"(Lost)\"}) by (persistentvolumeclaim)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}/kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"} * 100)", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "F" + } + ], + "title": "Persistent Volume Claim", + "transformations": [ + { + "id": "seriesToColumns", + "options": { + "byField": "persistentvolumeclaim" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Time 1": true, + "Time 2": true, + "Time 3": true, + "Time 4": true, + "Time 5": true, + "Time 6": true, + "Value #A": true + }, + "indexByName": {}, + "renameByName": { + "Time 1": "", + "Time 2": "", + "Time 3": "", + "Time 4": "", + "Time 5": "", + "Time 6": "", + "Value #A": "", + "Value #B": "Capacity (GiB)", + "Value #C": "Used (GiB)", + "Value #D": "Available (GiB)", + "Value #E": "Status", + "Value #F": "Used (%)", + "namespace": "Namespace", + "persistentvolumeclaim": "PersistentVolumeClaim", + "storageclass": "StorageClass", + "volumename": "PhysicalVolume" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "custom": { + "cellOptions": { + "type": "auto" + }, + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 7, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Status" + } + ] + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "kube_storageclass_info", + "format": "table", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Storage Class", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": true, + "__name__": true, + "app_kubernetes_io_instance": true, + "app_kubernetes_io_name": true, + "instance": true, + "job": true, + "kubernetes_namespace": true, + "kubernetes_pod_name": true, + "pod_template_hash": true + }, + "indexByName": { + "Time": 1, + "Value": 13, + "__name__": 2, + "app_kubernetes_io_instance": 3, + "app_kubernetes_io_name": 4, + "instance": 5, + "job": 6, + "kubernetes_namespace": 7, + "kubernetes_pod_name": 8, + "pod_template_hash": 9, + "provisioner": 10, + "reclaimPolicy": 11, + "storageclass": 0, + "volumeBindingMode": 12 + }, + "renameByName": { + "provisioner": "Provisioner", + "reclaimPolicy": "ReclaimPolicy", + "storageclass": "StorageClass", + "volumeBindingMode": "VolumeBindingMode" + } + } + }, + { + "id": "groupBy", + "options": { + "fields": { + "Provisioner": { + "aggregations": [], + "operation": "groupby" + }, + "ReclaimPolicy": { + "aggregations": [], + "operation": "groupby" + }, + "StorageClass": { + "aggregations": [], + "operation": "groupby" + }, + "VolumeBindingMode": { + "aggregations": [], + "operation": "groupby" + } + } + } + } + ], + "type": "table" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 15, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Graphical usage data ", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "7.2.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "(max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}))", + "interval": "", + "legendFormat": "{{`{{namespace}}`}} ({{`{{persistentvolumeclaim}}`}})", + "refId": "A" + } + ], + "title": "All Running PVCs Used Bytes", + "type": "timeseries" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 40 + }, + "id": 19, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 41 + }, + "hiddenSeries": false, + "id": 11, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1h])", + "instant": false, + "interval": "", + "legendFormat": "{{`{{namespace}}`}} ({{`{{persistentvolumeclaim}}`}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Hourly Volume Usage Rate", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "binBps", + "logBase": 1, + "show": true + }, + { + "format": "Date & time", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 48 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1d])", + "interval": "", + "legendFormat": "{{`{{namespace}}`}} ({{`{{persistentvolumeclaim}}`}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Daily Volume Usage Rate", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "binBps", + "logBase": 1, + "show": true + }, + { + "format": "Date & time", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 55 + }, + "hiddenSeries": false, + "id": 13, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1w])", + "instant": false, + "interval": "", + "legendFormat": "{{`{{namespace}}`}} ({{`{{persistentvolumeclaim}}`}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Weekly Volume Usage Rate", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "binBps", + "logBase": 1, + "show": true + }, + { + "format": "Date & time", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Usage Rate", + "type": "row" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": ".*", + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(namespace)", + "hide": 0, + "includeAll": true, + "label": "Namespace", + "multi": true, + "name": "k8s_namespace", + "options": [], + "query": "label_values(namespace)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "80", + "value": "80" + }, + "hide": 2, + "label": "PVC % Used Warning Threshold", + "name": "warning_threshold", + "options": [ + { + "selected": true, + "text": "80", + "value": "80" + } + ], + "query": "80", + "skipUrlSync": false, + "type": "textbox" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "kubernetes-persistent-volumes", + "uid": "peR80gTGk", + "version": 1, + "weekStart": "" + } diff --git a/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-slack.yaml b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-slack.yaml new file mode 100644 index 00000000..86f00f44 --- /dev/null +++ b/values/prometheus/manifests/policies/CiliumNetworkPolicy-allow-slack.yaml @@ -0,0 +1,12 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-slack + namespace: prometheus +spec: + egress: + - toFQDNs: + - matchPattern: slack.com + - matchName: hooks.slack.com + endpointSelector: + matchLabels: {} diff --git a/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml b/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml index 0bb56a35..c3505a1d 100644 --- a/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml +++ b/values/prometheus/manifests/policies/prometheus-add-folder-to-default-dashboards.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.kyverno.enabled) (.Values.prometheus.enabled) }} +{{- if .Values.prometheus.enabled }} apiVersion: kyverno.io/v1 kind: Policy metadata: diff --git a/values/prometheus/manifests/prometheus.yaml b/values/prometheus/manifests/prometheus.yaml index 93f610ee..03dc5923 100644 --- a/values/prometheus/manifests/prometheus.yaml +++ b/values/prometheus/manifests/prometheus.yaml @@ -10,13 +10,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/prometheus + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: prometheus.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: @@ -24,6 +29,8 @@ spec: component: sys syncOptions: - ServerSideApply=true + - CreateNamespace=true + - ApplyOutOfSyncOnly=true {{- if .Values.prometheus.autosync }} automated: prune: true diff --git a/values/prometheus/values-oceanbox.yaml.gotmpl b/values/prometheus/values-oceanbox.yaml.gotmpl index 6ae6980a..5e1fe5bf 100644 --- a/values/prometheus/values-oceanbox.yaml.gotmpl +++ b/values/prometheus/values-oceanbox.yaml.gotmpl @@ -1,15 +1,19 @@ -cilium: - enabled: true - nodePort: - enable: true - l2announcement: - enable: true - loadbalancerPool: +prometheus: + snitchUrl: "https://nosnch.in/136c1b564f" + pagerdutyRoutingKey: a5cff1fc46414d0bc02851e4af159ee7 + certRenewCronEnabled: false + fullname: prom + enableFeatures: + - otlp-write-reciever + - remote-write-reciever + grafana: + persistence: true + thanos: enabled: true - cidr: - - 10.255.241.11/32 - - 10.255.241.12/32 - - 10.255.241.13/32 - - 10.255.241.14/32 - - 10.255.241.15/32 - + coredns: + targetPort: 9153 + scheduler: + targetPort: 10259 + kubelet: + enabled: true + https: true diff --git a/values/prometheus/values.yaml.gotmpl b/values/prometheus/values.yaml.gotmpl index 9cfc35ba..78b0ad7b 100644 --- a/values/prometheus/values.yaml.gotmpl +++ b/values/prometheus/values.yaml.gotmpl @@ -13,6 +13,10 @@ prometheus: additionalScrapeConfigs: [] additionalDataSources: [] enableFeatures: [] + #alert_receiver: oncall + #alert_group_by: [ "cluster", "namespace", "alertname" ] + alert_group_by: [] + alert_receiver: "" storage: size: 50Gi grafana: diff --git a/values/prometheus/values/prometheus.yaml.gotmpl b/values/prometheus/values/prometheus.yaml.gotmpl index 61d3d62f..5cf1a411 100644 --- a/values/prometheus/values/prometheus.yaml.gotmpl +++ b/values/prometheus/values/prometheus.yaml.gotmpl @@ -1,106 +1,545 @@ -authentication: - mutual: - spire: - enabled: {{ .Values.cilium.spire.enabled }} -cgroup: - autoMount: - enabled: false - hostRoot: /sys/fs/cgroup -dashboards: - enabled: true - namespace: prometheus -enableXTSocketFallback: false -encryption: - enabled: {{ .Values.cilium.encryption.enabled }} - type: {{ .Values.cilium.encryption.type}} -envoy: - enabled: {{ .Values.cilium.envoy.enabled }} - prometheus: - serviceMonitor: - enabled: {{ .Values.cilium.envoy.enabled }} -extraConfig: - enable-envoy-config: "true" -hubble: - enabled: true - tls: - auto: - method: cronJob - metrics: +crds: + enabled: false + +fullnameOverride: {{ .Values.prometheus.fullname | default "prometheus-kube-prometheus" }} + +{{- with .Values.prometheus.defaultRules }} +defaultRules: +{{- . | toYaml | nindent 10 }} +{{- end}} + +## Configuration for alertmanager +## ref: https://prometheus.io/docs/alerting/alertmanager/ +## +alertmanager: + config: + route: + {{- if .Values.prometheus.alert_group_by }} + group_by: + {{- range .Values.prometheus.alert_group_by }} + - {{ . | quote }} + {{- end }} + {{- else }} + group_by: ["alertname"] + {{- end }} + group_wait: 60s + group_interval: 15m + repeat_interval: 24h + receiver: {{ .Values.prometheus.alert_receiver | default "pagerduty" }} + routes: + - match: + alertname: Watchdog + group_wait: 0s + group_interval: 1m + repeat_interval: 50s + receiver: snitch + {{- if .Values.prometheus.oncallUrl}} + - match: + alertname: .* + receiver: oncall + continue: true + {{- end }} + receivers: + - name: pagerduty + pagerduty_configs: + - routing_key: {{ default "key" .Values.prometheus.pagerdutyRoutingKey }} + url: "https://events.pagerduty.com/v2/enqueue" + severity: {{`'{{ if .CommonLabels.severity }}{{ .CommonLabels.severity | toLower }}{{ else }}critical{{ end }}'`}} + {{- if .Values.prometheus.snitchUrl}} + - name: snitch + webhook_configs: + - url: "{{ .Values.prometheus.snitchUrl }}" + send_resolved: false + {{- end }} + - name: teams + webhook_configs: + - url: "https://prometheus-msteams.{{ .Values.clusterConfig.domain }}/{{ .Values.clusterConfig.cluster }}" + http_config: + tls_config: + insecure_skip_verify: true + {{- if .Values.prometheus.oncallUrl}} + - name: oncall + webhook_configs: + - url: "{{ .Values.prometheus.oncallUrl }}" + send_resolved: true + {{- end }} + + storage: {} + + ingress: + enabled: true + ingressClassName: nginx + annotations: + cert-manager.io/cluster-issuer: {{ .Values.clusterConfig.ingress_clusterissuer }} + nginx.ingress.kubernetes.io/ssl-redirect: "true" + {{- with .Values.clusterConfig.ingress_whitelist_ips }} + nginx.ingress.kubernetes.io/whitelist-source-range: {{ join "," . }} + {{- end }} + hosts: + - alertmanager.{{ .Values.clusterConfig.domain }} + paths: + - / + pathType: ImplementationSpecific + tls: + - secretName: alertmanager-general-tls + hosts: + - alertmanager.{{ .Values.clusterConfig.domain }} + + ingressPerReplica: + pathType: ImplementationSpecific + + alertmanagerSpec: + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/hostname + # operator: In + # values: + # - {{ .Values.clusterConfig.cluster }}-0.itpartner.intern + + tolerations: [] + # - key: unschedulable + # operator: Exists + # effect: NoSchedule + +grafana: + defaultDashboardsEnabled: {{ .Values.prometheus.grafana.defaultDashboardsEnabled }} + {{- if .Values.prometheus.grafana.plugins }} + plugins: + {{- range .Values.prometheus.grafana.plugins }} + - {{ . }} + {{- end }} + {{- end }} + grafana.ini: + server: + root_url: "https://grafana.{{.Values.clusterConfig.domain}}:443" + security: + allow_embedding: "true" + auth: + disable_login_form: "{{ .Values.prometheus.grafana.disable_login_form }}" + users: + auto_assign_org_role: "Admin" + {{- range .Values.clusterConfig.oidc }} + {{- if eq .provider "azuread" }} + auth.{{ .provider }}: + enabled: true + name: {{ .name }} + client_id: $__file{/etc/secrets/oauth/{{ .name }}/client_id} + client_secret: $__file{/etc/secrets/oauth/{{ .name }}/client_secret} + scopes: openid email profile + auth_url: https://login.microsoftonline.com/{{ .tenant }}/oauth2/v2.0/authorize + token_url: https://login.microsoftonline.com/{{ .tenant }}/oauth2/v2.0/token + allowed_groups: {{ .group_id }} + allow_sign_up: true + role_attribute_strict: false + allow_assign_grafana_admin: true + {{- else if eq .provider "github" }} + auth.{{ .provider }}: + name: {{ .name }} + enabled: true + client_id: $__file{/etc/secrets/oauth/{{ .name }}/client_id} + client_secret: $__file{/etc/secrets/oauth/{{ .name }}/client_secret} + allowed_organizations: {{ .allowed_organizations }} + {{- if .allowed_teams }} + allowed_teams: "{{ .allowed_teams }}" + {{- end }} + scopes: user:email,read:org + auth_url: https://github.com/login/oauth/authorize + token_url: https://github.com/login/oauth/access_token + allow_sign_up: true + role_attribute_strict: false + allow_assign_grafana_admin: true + {{- end }} + {{- end }} + extraSecretMounts: + {{- range .Values.clusterConfig.oidc }} + - name: {{ .name }} + secretName: {{ .secret_ref.name }} + defaultMode: 0440 + mountPath: /etc/secrets/oauth/{{ .name }} + readOnly: true + {{- end }} + + {{- if .Values.prometheus.grafana.persistence }} + persistence: + enabled: true + size: 10Gi + {{- end }} + ingress: + enabled: true + ingressClassName: nginx + annotations: + cert-manager.io/cluster-issuer: {{ .Values.clusterConfig.ingress_clusterissuer }} + nginx.ingress.kubernetes.io/ssl-redirect: "true" + {{- with .Values.clusterConfig.ingress_whitelist_ips}} + nginx.ingress.kubernetes.io/whitelist-source-range: {{ join "," . }} + {{- end }} + hosts: + - grafana.{{ .Values.clusterConfig.domain }} + path: / + tls: + - secretName: grafana-general-tls + hosts: + - grafana.{{ .Values.clusterConfig.domain }} + sidecar: dashboards: enabled: true - namespace: prometheus - enabled: - - dns:query;ignoreAAAA - - drop - - tcp - - flow - - icmp - - policy:sourceContext=app|workload-name|pod|reserved-identity;destinationContext=app|workload-name|pod|dns|reserved-identity;labelsContext=source_namespace,destination_namespace - - httpV2:exemplars=false;labelsContext=source_ip,source_namespace,source_workload,destination_ip,destination_namespace,destination_workload,traffic_direction - port: 12304 - serviceMonitor: + label: grafana_dashboard + folderAnnotation: grafana_folder + annotations: {} + multicluster: + global: + enabled: true + etcd: + enabled: false + provider: + allowUiUpdates: false + foldersFromFilesStructure: true + {{- if .Values.prometheus.thanos.datasource.enabled }} + datasources: enabled: true - redact: - enabled: true - relay: - enabled: true - prometheus: - enabled: true - serviceMonitor: - enabled: true - ui: - enabled: {{ .Values.cilium.hubble.ui }} -ipam: - mode: kubernetes -kubeProxyReplacement: {{ .Values.cilium.kubeProxyReplacement }} -l2announcements: - enabled: {{ .Values.cilium.l2announcement.enabled }} -k8sServiceHost: {{ .Values.cilium.k8sServiceHost }} -k8sServicePort: {{ .Values.cilium.k8sServicePort }} -nodePort: - enabled: {{ .Values.cilium.nodePort.enabled }} -gatewayAPI: - enabled: {{ .Values.cilium.gatewayAPI.enabled }} -ingressController: - enabled: {{ .Values.cilium.ingressController.enabled }} - default: {{ .Values.cilium.ingressController.defaultClass }} - loadbalancerMode: {{ .Values.cilium.ingressController.loadbalancerMode }} -operator: - dashboards: - enabled: true - namespace: prometheus - prometheus: - enabled: true - port: 12301 - serviceMointor: - enabled: true - port: 12302 - rollOutPods: true -policyAuditMode: {{ .Values.cilium.policyAuditMode }} -prometheus: - enabled: true - port: 12300 + defaultDatasourceEnabled: true + url: http://thanos-query-frontend.thanos.svc:9090/ + # defaultDatasourceScrapeInterval: 15s + annotations: {} + + ## Create datasource for each Pod of Prometheus StatefulSet; + ## this uses headless service `prometheus-operated` which is + ## created by Prometheus Operator + ## ref: https://git.io/fjaBS + createPrometheusReplicasDatasources: false + label: grafana_datasource + {{ end }} + {{- if or .Values.loki.enabled .Values.prometheus.additionalDataSources }} + additionalDataSources: + {{- end }} + {{- if .Values.tempo.enabled }} + - name: Tempo + type: tempo + uid: tempo + orgId: 1 + url: http://tempo.tempo:3100 + isDefault: false + version: 1 + access: proxy + jsonData: + nodeGraph: + enabled: true + serviceMap: + datasourceUid: 'Prometheus' + tracesToLogs: + datasourceUid: loki + filterByTraceID: false + spanEndTimeShift: "500ms" + spanStartTimeShift: "-500ms" + timeInterval: 30s + {{- end }} + {{- if .Values.loki.enabled }} + - name: loki + type: loki + uid: loki + access: proxy + basicAuth: false + editable: false + jsonData: + tlsSkipVerify: false + {{- if .Values.tempo.enabled }} + derivedFields: + - datasourceUid: tempo + matcherRegex: trace_id + matcherType: label + name: Trace ID + url: $${__value.raw} + urlDisplayLabel: 'Trace ID: $${__value.raw}' + {{- end }} + orgId: 1 + url: http://loki-read-headless.loki:3100 + version: 1 + {{- end }} + {{- with .Values.prometheus.additionalDataSources }} + {{- toYaml . | nindent 10 }} + {{- end }} + +kubeApiServer: + tlsConfig: + serverName: kubernetes + insecureSkipVerify: true + +kubelet: + serviceMonitor: + https: {{ .Values.prometheus.kubelet.https }} + cAdvisor: true + + # NOTE(simkir): Including throttling seconds by setting this. We use that in some dashboards, and could be useful + ## MetricRelabelConfigs to apply to samples after scraping, but before ingestion. + ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api-reference/api.md#relabelconfig + ## + cAdvisorMetricRelabelings: + # Drop less useful container CPU metrics. + - sourceLabels: [__name__] + action: drop + regex: 'container_cpu_(load_average_10s|system_seconds_total|user_seconds_total)' + # Drop less useful container / always zero filesystem metrics. + - sourceLabels: [__name__] + action: drop + regex: 'container_fs_(io_current|io_time_seconds_total|io_time_weighted_seconds_total|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total)' + # Drop less useful / always zero container memory metrics. + - sourceLabels: [__name__] + action: drop + regex: 'container_memory_(mapped_file|swap)' + # Drop less useful container process metrics. + - sourceLabels: [__name__] + action: drop + regex: 'container_(file_descriptors|tasks_state|threads_max)' + # Drop container_memory_failures_total{scope="hierarchy"} metrics, + # we only need the container scope. + - sourceLabels: [__name__, scope] + action: drop + regex: 'container_memory_failures_total;hierarchy' + # Drop container_network_... metrics that match various interfaces that + # correspond to CNI and similar interfaces. This avoids capturing network + # metrics for host network containers. + - sourceLabels: [__name__, interface] + action: drop + regex: 'container_network_.*;(cali|cilium|cni|lxc|nodelocaldns|tunl).*' + # Drop container spec metrics that overlap with kube-state-metrics. + - sourceLabels: [__name__] + action: drop + regex: 'container_spec.*' + # Drop cgroup metrics with no pod. + - sourceLabels: [id, pod] + action: drop + regex: '.+;' + # - sourceLabels: [__name__, image] + # separator: ; + # regex: container_([a-z_]+); + # replacement: $1 + # action: drop + # - sourceLabels: [__name__] + # separator: ; + # regex: container_(network_tcp_usage_total|network_udp_usage_total|tasks_state|cpu_load_average_10s) + # replacement: $1 + # action: drop + +kubeControllerManager: + enabled: false + {{- if .Values.clusterConfig.apiserverip }} + endpoints: + - {{ .Values.clusterConfig.apiserverip }} + {{- end }} + service: + port: 10252 + selector: + k8s-app: kube-controller-manager serviceMonitor: enabled: true -rollOutCiliumPods: true -securityContext: - capabilities: - ciliumAgent: - - CHOWN - - KILL - - NET_ADMIN - - NET_RAW - - IPC_LOCK - - SYS_ADMIN - - SYS_RESOURCE - - DAC_OVERRIDE - - FOWNER - - SETGID - - SETUID - cleanCiliumState: - - NET_ADMIN - - SYS_ADMIN - - SYS_RESOURCE -{{- with .Values.cilium.upgradeCompatability}} -upgradeCompatability: {{ . }} -{{- end }} + https: true + insecureSkipVerify: true + +coreDns: + enabled: true + service: + targetPort: {{ .Values.prometheus.coredns.targetPort | default 10055 }} + selector: + k8s-app: kube-dns + +kubeEtcd: + enabled: true + {{- if .Values.clusterConfig.etcd_nodes }} + endpoints: {{ .Values.clusterConfig.etcd_nodes }} + {{- end }} + service: + port: {{ .Values.prometheus.etcd.targetPort | default 2379 }} + targetPort: {{ .Values.prometheus.etcd.targetPort | default 2379 }} + serviceMonitor: + enabled: true + scheme: https + insecureSkipVerify: true + caFile: /etc/prometheus/secrets/etcd-client-cert/ca.pem + certFile: /etc/prometheus/secrets/etcd-client-cert/etcd.pem + keyFile: /etc/prometheus/secrets/etcd-client-cert/etcd-key.pem + +kubeScheduler: + enabled: false + {{- if .Values.clusterConfig.apiserverip }} + endpoints: + - {{ .Values.clusterConfig.apiserverip }} + {{- end }} + service: + port: {{ .Values.prometheus.scheduler.targetPort | default 10251 }} + targetPort: {{ .Values.prometheus.scheduler.targetPort | default 10251 }} + selector: + k8s-app: kube-scheduler + +kubeProxy: + enabled: false + {{- if .Values.clusterConfig.k8s_nodes }} + endpoints: {{ .Values.clusterConfig.k8s_nodes }} + {{- else }} + service: + selector: + k8s-app: kube-proxy + {{- end }} + +prometheusOperator: + enabled: true + + admissionWebhooks: + certManager: + enabled: true + issuerRef: + name: "ca-issuer" + kind: "ClusterIssuer" + + kubeletService: + enabled: {{ .Values.prometheus.kubelet.enabled }} + + +prometheus: + enabled: true + + thanosService: + enabled: false + type: ClusterIP + + ## gRPC port config + portName: grpc + port: 10901 + targetPort: "grpc" + + ## HTTP port config (for metrics) + httpPortName: http + httpPort: 10902 + targetHttpPort: "http" + + # Default is to make this a headless service ("None") + # clusterIP: "None" + + ## Port to expose on each node, if service type is NodePort + ## + nodePort: 30901 + httpNodePort: 30902 + + {{- if .Values.prometheus.thanos.enabled }} + # ServiceMonitor to scrape Sidecar metrics + # Needs thanosService to be enabled as well + thanosServiceMonitor: + enabled: true + interval: "" + + thanosIngress: + enabled: true + servicePort: 10901 + ingressClassName: nginx + annotations: + cert-manager.io/cluster-issuer: {{ .Values.clusterConfig.ingress_clusterissuer }} + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/backend-protocol: "GRPC" + {{- with .Values.clusterConfig.ingress_whitelist_ips }} + nginx.ingress.kubernetes.io/whitelist-source-range: {{ join "," . }} + {{- end }} + kubernetes.io/ingress.allow-http: "false" + hosts: + - thanos-gateway.{{ .Values.clusterConfig.domain }} + paths: + - / + pathType: ImplementationSpecific + tls: + - secretName: thanos-gateway-tls + hosts: + - thanos-gateway.{{ .Values.clusterConfig.domain }} + {{- end }} + + ingress: + enabled: true + ingressClassName: nginx + annotations: + cert-manager.io/cluster-issuer: {{ .Values.clusterConfig.ingress_clusterissuer }} + nginx.ingress.kubernetes.io/ssl-redirect: "true" + {{- with .Values.clusterConfig.ingress_whitelist_ips }} + nginx.ingress.kubernetes.io/whitelist-source-range: {{ join "," . }} + {{- end }} + hosts: + - prometheus.{{ .Values.clusterConfig.domain }} + paths: + - / + pathType: ImplementationSpecific + tls: + - secretName: prometheus-general-tls + hosts: + - prometheus.{{ .Values.clusterConfig.domain }} + + ingressPerReplica: + enabled: false + pathType: ImplementationSpecific + + prometheusSpec: + #{{- if .Values.install.otel.enabled }} + enableRemoteWriteReceiver: true + #{{- end }} + + tolerations: [] + # - key: unschedulable + # operator: Exists + # effect: NoSchedule + secrets: + - etcd-client-cert + storageSpec: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: {{ .Values.prometheus.storage.size }} + {{- with .Values.prometheus.enableFeatures}} + enableFeatures: + {{- range . }} + - {{ . }} + {{- end }} + {{- end }} + + ## External labels to add to any time series or alerts when communicating with external systems + ## + externalLabels: + cluster: {{ .Values.clusterConfig.cluster }} + + ## Name of the external label used to denote replica name + ## + replicaExternalLabelName: "" + + ## If true, the Operator won't add the external label used to denote replica name + ## + replicaExternalLabelNameClear: true + + ## Name of the external label used to denote Prometheus instance name + ## + prometheusExternalLabelName: "" + + ## If true, the Operator won't add the external label used to denote Prometheus instance name + ## + prometheusExternalLabelNameClear: true + + serviceMonitorSelectorNilUsesHelmValues: false + podMonitorSelectorNilUsesHelmValues: false + ruleSelectorNilUsesHelmValues: false + + ## Thanos configuration allows configuring various aspects of a Prometheus server in a Thanos environment. + ## This section is experimental, it may change significantly without deprecation notice in any release. + ## This is experimental and may change significantly without backward compatibility in any release. + ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#thanosspec + ## + {{- if .Values.prometheus.thanos.enabled }} + thanos: + objectStorageConfig: + key: thanos.yaml + name: thanos-objstore-config + {{- end }} + # remoteWrite: + # - url: https://thanos-receive.k1.itpartner.no/api/v1/receive + # name: {{ .Values.clusterConfig.cluster }} + {{- with .Values.prometheus.additionalScrapeConfigs}} + additionalScrapeConfigs: + {{- toYaml . | nindent 12 }} + {{- end }} diff --git a/values/values-oceanbox.yaml b/values/values-oceanbox.yaml index 7b2b8369..664c21a9 100644 --- a/values/values-oceanbox.yaml +++ b/values/values-oceanbox.yaml @@ -41,4 +41,6 @@ clusterConfig: - 172.16.0.0/12 - 192.168.0.0/16 - 172.19.255.0/24 - +install: + otel: + enabled: true diff --git a/values/velero/manifests/velero.yaml b/values/velero/manifests/velero.yaml index 595dc1da..780ea9ad 100644 --- a/values/velero/manifests/velero.yaml +++ b/values/velero/manifests/velero.yaml @@ -20,6 +20,8 @@ spec: value: {{ .Values.clusterConfig.cluster }} - name: HELMFILE_ENVIRONMENT value: default + - name: HELMFILE_FILE_PATH + value: velero.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: diff --git a/values/velero/values.yaml.gotmpl b/values/velero/values.yaml.gotmpl index 9cd033cb..b3589aa5 100644 --- a/values/velero/values.yaml.gotmpl +++ b/values/velero/values.yaml.gotmpl @@ -1,12 +1,12 @@ velero: enabled: true autosync: true - kubeletRootDir: "/var/lib/kubernetes/pods" - bucket: backup + kubeletRootDir: "/var/lib/kubelet/pods" + bucket: velero bsl: default # Opt-in or opt-out pvc backup # https://velero.io/docs/main/file-system-backup/#to-back-up - backupAllVolumes: true + backupAllVolumes: false credentials: secretName: "velero-s3" s3: @@ -16,13 +16,13 @@ velero: resources: velero: request: - cpu: 500m + cpu: 20m memory: 1Gi limit: memory: 2Gi nodeAgent: request: - cpu: 500m + cpu: 20m memory: 1Gi limit: memory: 2Gi diff --git a/values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml b/values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml new file mode 100644 index 00000000..7742a0fe --- /dev/null +++ b/values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml @@ -0,0 +1,16 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-api-server + namespace: x509-exporter +spec: + egress: + - toEntities: + - kube-apiserver + toPorts: + - ports: + - port: "6443" + protocol: TCP + endpointSelector: + matchLabels: + app.kubernetes.io/instance: x509-exporter diff --git a/values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml b/values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml new file mode 100644 index 00000000..cc040dd9 --- /dev/null +++ b/values/x509-exporter/manifests/policies/CiliumNetworkPolicy-allow-prometheus-metrics.yaml @@ -0,0 +1,17 @@ +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-prometheus-metrics + namespace: x509-exporter +spec: + endpointSelector: + matchLabels: + app.kubernetes.io/instance: x509-exporter + ingress: + - fromEndpoints: + - matchLabels: + io.kubernetes.pod.namespace: prometheus + - toPorts: + - ports: + - port: "9793" + protocol: TCP diff --git a/values/x509-exporter/manifests/x509-exporter.yaml b/values/x509-exporter/manifests/x509-exporter.yaml index d8708339..9bac91ee 100644 --- a/values/x509-exporter/manifests/x509-exporter.yaml +++ b/values/x509-exporter/manifests/x509-exporter.yaml @@ -14,13 +14,18 @@ spec: server: 'https://kubernetes.default.svc' sources: - repoURL: {{ .Values.clusterConfig.manifests }} - targetRevision: HEAD - path: helmfiles/x509-exporter + # targetRevision: HEAD + targetRevision: mrtz/helmify + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - name: CLUSTER_NAME value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: x509-exporter.yaml.gotmpl project: sys syncPolicy: managedNamespaceMetadata: diff --git a/values/x509-exporter/values/x509-exporter.yaml.gotmpl b/values/x509-exporter/values/x509-exporter.yaml.gotmpl index ae3d279b..0e7ff0f3 100644 --- a/values/x509-exporter/values/x509-exporter.yaml.gotmpl +++ b/values/x509-exporter/values/x509-exporter.yaml.gotmpl @@ -4,13 +4,13 @@ secretsExporter: excludeLabels: - cert-manager.io/* resources: - limits: - memory: 100Mi - requests: - cpu: 20m - memory: 100Mi + limits: + memory: 100Mi + requests: + cpu: 20m + memory: 100Mi prometheusServiceMonitor: extraLabels: k8s-app: x509-exporter prometheusRules: - create: false \ No newline at end of file + create: false -- 2.52.0