Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudnative-pg): cleanup #658

Merged
merged 1 commit into from
Nov 20, 2024
Merged

feat(cloudnative-pg): cleanup #658

merged 1 commit into from
Nov 20, 2024

Conversation

GeckoSplinter
Copy link
Owner

No description provided.

Copy link

--- kubernetes/apps/databases/cloudnative-pg/app Kustomization: flux-system/cloudnative-pg HelmRelease: databases/cloudnative-pg

+++ kubernetes/apps/databases/cloudnative-pg/app Kustomization: flux-system/cloudnative-pg HelmRelease: databases/cloudnative-pg

@@ -1,39 +0,0 @@

----
-apiVersion: helm.toolkit.fluxcd.io/v2
-kind: HelmRelease
-metadata:
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    kustomize.toolkit.fluxcd.io/name: cloudnative-pg
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: cloudnative-pg
-  namespace: databases
-spec:
-  chart:
-    spec:
-      chart: cloudnative-pg
-      sourceRef:
-        kind: HelmRepository
-        name: cloudnative-pg
-        namespace: flux-system
-      version: 0.22.1
-  dependsOn:
-  - name: openebs
-    namespace: openebs-system
-  install:
-    remediation:
-      retries: 3
-  interval: 30m
-  upgrade:
-    cleanupOnFail: true
-    remediation:
-      retries: 3
-      strategy: rollback
-  values:
-    crds:
-      create: true
-    monitoring:
-      grafanaDashboard:
-        create: true
-      podMonitorEnabled: false
-
--- kubernetes/apps/databases/cloudnative-pg/app Kustomization: flux-system/cloudnative-pg ExternalSecret: databases/cloudnative-pg

+++ kubernetes/apps/databases/cloudnative-pg/app Kustomization: flux-system/cloudnative-pg ExternalSecret: databases/cloudnative-pg

@@ -1,31 +0,0 @@

----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    kustomize.toolkit.fluxcd.io/name: cloudnative-pg
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: cloudnative-pg
-  namespace: databases
-spec:
-  data:
-  - remoteRef:
-      key: cloudnative-pg
-      property: POSTGRES_SUPER_USER
-    secretKey: username
-  - remoteRef:
-      key: cloudnative-pg
-      property: POSTGRES_SUPER_PASS
-    secretKey: password
-  secretStoreRef:
-    kind: ClusterSecretStore
-    name: onepassword-connect
-  target:
-    name: cloudnative-pg-secret
-    template:
-      engineVersion: v2
-      metadata:
-        labels:
-          cnpg.io/reload: 'true'
-
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg

@@ -1,40 +0,0 @@

----
-apiVersion: kustomize.toolkit.fluxcd.io/v1
-kind: Kustomization
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: cloudnative-pg
-  namespace: flux-system
-spec:
-  commonMetadata:
-    labels:
-      app.kubernetes.io/name: cloudnative-pg
-  decryption:
-    provider: sops
-    secretRef:
-      name: sops-age
-  interval: 30m
-  path: ./kubernetes/apps/databases/cloudnative-pg/app
-  postBuild:
-    substituteFrom:
-    - kind: ConfigMap
-      name: cluster-settings
-    - kind: Secret
-      name: cluster-secrets
-    - kind: ConfigMap
-      name: cluster-settings-user
-      optional: true
-    - kind: Secret
-      name: cluster-secrets-user
-      optional: true
-  prune: true
-  retryInterval: 1m
-  sourceRef:
-    kind: GitRepository
-    name: home-kubernetes
-  targetNamespace: databases
-  timeout: 5m
-  wait: true
-
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg-cluster

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/cloudnative-pg-cluster

@@ -1,42 +0,0 @@

----
-apiVersion: kustomize.toolkit.fluxcd.io/v1
-kind: Kustomization
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: cloudnative-pg-cluster
-  namespace: flux-system
-spec:
-  commonMetadata:
-    labels:
-      app.kubernetes.io/name: cloudnative-pg-cluster
-  decryption:
-    provider: sops
-    secretRef:
-      name: sops-age
-  dependsOn:
-  - name: cloudnative-pg
-  interval: 30m
-  path: ./kubernetes/apps/databases/cloudnative-pg/cluster
-  postBuild:
-    substituteFrom:
-    - kind: ConfigMap
-      name: cluster-settings
-    - kind: Secret
-      name: cluster-secrets
-    - kind: ConfigMap
-      name: cluster-settings-user
-      optional: true
-    - kind: Secret
-      name: cluster-secrets-user
-      optional: true
-  prune: true
-  retryInterval: 1m
-  sourceRef:
-    kind: GitRepository
-    name: home-kubernetes
-  targetNamespace: databases
-  timeout: 5m
-  wait: true
-
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/home-assistant-old

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/home-assistant-old

@@ -1,40 +0,0 @@

----
-apiVersion: kustomize.toolkit.fluxcd.io/v1
-kind: Kustomization
-metadata:
-  labels:
-    kustomize.toolkit.fluxcd.io/name: cluster-apps
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: home-assistant-old
-  namespace: flux-system
-spec:
-  commonMetadata:
-    labels:
-      app.kubernetes.io/name: home-assistant-old
-  decryption:
-    provider: sops
-    secretRef:
-      name: sops-age
-  interval: 30m
-  path: ./kubernetes/apps/home/home-assistant-old/app
-  postBuild:
-    substituteFrom:
-    - kind: ConfigMap
-      name: cluster-settings
-    - kind: Secret
-      name: cluster-secrets
-    - kind: ConfigMap
-      name: cluster-settings-user
-      optional: true
-    - kind: Secret
-      name: cluster-secrets-user
-      optional: true
-  prune: true
-  retryInterval: 1m
-  sourceRef:
-    kind: GitRepository
-    name: home-kubernetes
-  targetNamespace: home
-  timeout: 5m
-  wait: true
-
--- kubernetes/apps/databases/cloudnative-pg/cluster Kustomization: flux-system/cloudnative-pg-cluster Cluster: databases/main

+++ kubernetes/apps/databases/cloudnative-pg/cluster Kustomization: flux-system/cloudnative-pg-cluster Cluster: databases/main

@@ -1,32 +0,0 @@

----
-apiVersion: postgresql.cnpg.io/v1
-kind: Cluster
-metadata:
-  labels:
-    app.kubernetes.io/name: cloudnative-pg-cluster
-    kustomize.toolkit.fluxcd.io/name: cloudnative-pg-cluster
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: main
-  namespace: databases
-spec:
-  enableSuperuserAccess: true
-  imageName: ghcr.io/cloudnative-pg/postgresql:16.3-4
-  instances: 3
-  monitoring:
-    enablePodMonitor: true
-  nodeMaintenanceWindow:
-    reusePVC: true
-  resources:
-    limits:
-      memory: 4Gi
-    requests:
-      cpu: 500m
-  storage:
-    pvcTemplate:
-      accessModes:
-      - ReadWriteOnce
-    size: 20Gi
-    storageClass: longhorn
-  superuserSecret:
-    name: cloudnative-pg-secret
-

Copy link

--- HelmRelease: databases/cloudnative-pg ServiceAccount: databases/cloudnative-pg

+++ HelmRelease: databases/cloudnative-pg ServiceAccount: databases/cloudnative-pg

@@ -1,10 +0,0 @@

----
-apiVersion: v1
-kind: ServiceAccount
-metadata:
-  name: cloudnative-pg
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-
--- HelmRelease: databases/cloudnative-pg ConfigMap: databases/cnpg-grafana-dashboard

+++ HelmRelease: databases/cloudnative-pg ConfigMap: databases/cnpg-grafana-dashboard

@@ -1,9200 +0,0 @@

----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: cnpg-grafana-dashboard
-  namespace: databases
-  labels:
-    grafana_dashboard: '1'
-data:
-  cnp.json: |-
-    {
-      "__inputs": [
-        {
-          "name": "DS_PROMETHEUS",
-          "label": "Prometheus",
-          "description": "",
-          "type": "datasource",
-          "pluginId": "prometheus",
-          "pluginName": "Prometheus"
-        },
-        {
-          "name": "DS_EXPRESSION",
-          "label": "Expression",
-          "description": "",
-          "type": "datasource",
-          "pluginId": "__expr__"
-        }
-      ],
-      "__elements": {},
-      "__requires": [
-        {
-          "type": "datasource",
-          "id": "__expr__",
-          "version": "1.0.0"
-        },
-        {
-          "type": "panel",
-          "id": "alertlist",
-          "name": "Alert list",
-          "version": ""
-        },
-        {
-          "type": "panel",
-          "id": "bargauge",
-          "name": "Bar gauge",
-          "version": ""
-        },
-        {
-          "type": "panel",
-          "id": "gauge",
-          "name": "Gauge",
-          "version": ""
-        },
-        {
-          "type": "grafana",
-          "id": "grafana",
-          "name": "Grafana",
-          "version": "10.3.3"
-        },
-        {
-          "type": "panel",
-          "id": "heatmap",
-          "name": "Heatmap",
-          "version": ""
-        },
-        {
-          "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": "text",
-          "name": "Text",
-          "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"
-          }
-        ]
-      },
-      "editable": true,
-      "fiscalYearStartMonth": 0,
-      "graphTooltip": 1,
-      "id": null,
-      "links": [
-        {
-          "asDropdown": false,
-          "icon": "external link",
-          "includeVars": false,
-          "keepTime": false,
-          "tags": [
-            "cloudnativepg"
-          ],
-          "targetBlank": false,
-          "title": "Related Dashboards",
-          "tooltip": "",
-          "type": "dashboards",
-          "url": ""
-        }
-      ],
-      "liveNow": false,
-      "panels": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "gridPos": {
-            "h": 7,
-            "w": 3,
-            "x": 0,
-            "y": 0
-          },
-          "id": 676,
-          "options": {
-            "alertInstanceLabelFilter": "{namespace=~\"$namespace\",pod=~\"$instances\"}",
-            "alertName": "",
-            "dashboardAlerts": false,
-            "folder": "",
-            "groupBy": [],
-            "groupMode": "default",
-            "maxItems": 20,
-            "sortOrder": 1,
-            "stateFilter": {
-              "error": true,
-              "firing": true,
-              "noData": false,
-              "normal": true,
-              "pending": true
-            },
-            "viewMode": "list"
-          },
-          "title": "Alerts",
-          "type": "alertlist"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "gridPos": {
-            "h": 1,
-            "w": 4,
-            "x": 3,
-            "y": 0
-          },
-          "id": 586,
-          "options": {
-            "code": {
-              "language": "plaintext",
-              "showLineNumbers": false,
-              "showMiniMap": false
-            },
-            "content": "",
-            "mode": "markdown"
-          },
-          "pluginVersion": "10.3.3",
-          "title": "Health",
-          "type": "text"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "gridPos": {
-            "h": 1,
-            "w": 12,
-            "x": 7,
-            "y": 0
-          },
-          "id": 336,
-          "options": {
-            "code": {
-              "language": "plaintext",
-              "showLineNumbers": false,
-              "showMiniMap": false
-            },
-            "content": "",
-            "mode": "markdown"
-          },
-          "pluginVersion": "10.3.3",
-          "title": "Overview",
-          "type": "text"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "gridPos": {
-            "h": 1,
-            "w": 2,
-            "x": 19,
-            "y": 0
-          },
-          "id": 352,
-          "options": {
-            "code": {
-              "language": "plaintext",
-              "showLineNumbers": false,
-              "showMiniMap": false
-            },
-            "content": "",
-            "mode": "markdown"
-          },
-          "pluginVersion": "10.3.3",
-          "title": "Storage",
-          "type": "text"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "gridPos": {
-            "h": 1,
-            "w": 3,
-            "x": 21,
-            "y": 0
-          },
-          "id": 354,
-          "options": {
-            "code": {
-              "language": "plaintext",
-              "showLineNumbers": false,
-              "showMiniMap": false
-            },
-            "content": "",
-            "mode": "markdown"
-          },
-          "pluginVersion": "10.3.3",
-          "title": "Backups",
-          "type": "text"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "Cluster Replication Health represents the availability of replica servers available to replace the primary in case of a failure.",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "thresholds"
-              },
-              "mappings": [
-                {
-                  "options": {
-                    "0": {
-                      "color": "red",
-                      "index": 2,
-                      "text": "None"
-                    },
-                    "1": {
-                      "color": "orange",
-                      "index": 1,
-                      "text": "Degraded"
-                    }
-                  },
-                  "type": "value"
-                },
-                {
-                  "options": {
-                    "from": 2,
-                    "result": {
-                      "color": "green",
-                      "index": 0,
-                      "text": "Healthy"
-                    },
-                    "to": 999
-                  },
-                  "type": "range"
-                }
-              ],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              },
-              "unitScale": true
-            },
-            "overrides": []
-          },
-          "gridPos": {
-            "h": 2,
-            "w": 2,
-            "x": 3,
-            "y": 1
-          },
-          "id": 585,
-          "options": {
-            "colorMode": "background",
-            "graphMode": "none",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "fields": "",
-              "values": false
-            },
-            "showPercentChange": false,
-            "textMode": "auto",
-            "wideLayout": true
-          },
-          "pluginVersion": "10.3.3",
-          "targets": [
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "code",
-              "expr": "max(cnpg_pg_replication_streaming_replicas{namespace=~\"$namespace\", pod=~\"$instances\"} - cnpg_pg_replication_is_wal_receiver_up{namespace=~\"$namespace\", pod=~\"$instances\"})",
-              "legendFormat": "Replication",
-              "range": true,
-              "refId": "A"
-            }
-          ],
-          "type": "stat"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "High lag indicates issue with replication. Network or storage interfaces may not have enough bandwidth to handle incoming traffic and replication at the same time.",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "thresholds"
-              },
-              "mappings": [
-                {
-                  "options": {
-                    "match": "null",
[Diff truncated by flux-local]
--- HelmRelease: databases/cloudnative-pg ConfigMap: databases/cnpg-controller-manager-config

+++ HelmRelease: databases/cloudnative-pg ConfigMap: databases/cnpg-controller-manager-config

@@ -1,11 +0,0 @@

----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: cnpg-controller-manager-config
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-data: {}
-
--- HelmRelease: databases/cloudnative-pg ConfigMap: databases/cnpg-default-monitoring

+++ HelmRelease: databases/cloudnative-pg ConfigMap: databases/cnpg-default-monitoring

@@ -1,460 +0,0 @@

----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: cnpg-default-monitoring
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-    cnpg.io/reload: ''
-data:
-  queries: |
-    backends:
-      query: |
-       SELECT sa.datname
-           , sa.usename
-           , sa.application_name
-           , states.state
-           , COALESCE(sa.count, 0) AS total
-           , COALESCE(sa.max_tx_secs, 0) AS max_tx_duration_seconds
-           FROM ( VALUES ('active')
-               , ('idle')
-               , ('idle in transaction')
-               , ('idle in transaction (aborted)')
-               , ('fastpath function call')
-               , ('disabled')
-               ) AS states(state)
-           LEFT JOIN (
-               SELECT datname
-                   , state
-                   , usename
-                   , COALESCE(application_name, '') AS application_name
-                   , COUNT(*)
-                   , COALESCE(EXTRACT (EPOCH FROM (max(now() - xact_start))), 0) AS max_tx_secs
-               FROM pg_catalog.pg_stat_activity
-               GROUP BY datname, state, usename, application_name
-           ) sa ON states.state = sa.state
-           WHERE sa.usename IS NOT NULL
-      metrics:
-        - datname:
-            usage: "LABEL"
-            description: "Name of the database"
-        - usename:
-            usage: "LABEL"
-            description: "Name of the user"
-        - application_name:
-            usage: "LABEL"
-            description: "Name of the application"
-        - state:
-            usage: "LABEL"
-            description: "State of the backend"
-        - total:
-            usage: "GAUGE"
-            description: "Number of backends"
-        - max_tx_duration_seconds:
-            usage: "GAUGE"
-            description: "Maximum duration of a transaction in seconds"
-
-    backends_waiting:
-      query: |
-       SELECT count(*) AS total
-       FROM pg_catalog.pg_locks blocked_locks
-       JOIN pg_catalog.pg_locks blocking_locks
-         ON blocking_locks.locktype = blocked_locks.locktype
-         AND blocking_locks.database IS NOT DISTINCT FROM blocked_locks.database
-         AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
-         AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page
-         AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple
-         AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid
-         AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid
-         AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid
-         AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid
-         AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid
-         AND blocking_locks.pid != blocked_locks.pid
-       JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid
-       WHERE NOT blocked_locks.granted
-      metrics:
-        - total:
-            usage: "GAUGE"
-            description: "Total number of backends that are currently waiting on other queries"
-
-    pg_database:
-      query: |
-        SELECT datname
-          , pg_catalog.pg_database_size(datname) AS size_bytes
-          , pg_catalog.age(datfrozenxid) AS xid_age
-          , pg_catalog.mxid_age(datminmxid) AS mxid_age
-        FROM pg_catalog.pg_database
-        WHERE datallowconn
-      metrics:
-        - datname:
-            usage: "LABEL"
-            description: "Name of the database"
-        - size_bytes:
-            usage: "GAUGE"
-            description: "Disk space used by the database"
-        - xid_age:
-            usage: "GAUGE"
-            description: "Number of transactions from the frozen XID to the current one"
-        - mxid_age:
-            usage: "GAUGE"
-            description: "Number of multiple transactions (Multixact) from the frozen XID to the current one"
-
-    pg_postmaster:
-      query: |
-        SELECT EXTRACT(EPOCH FROM pg_postmaster_start_time) AS start_time
-        FROM pg_catalog.pg_postmaster_start_time()
-      metrics:
-        - start_time:
-            usage: "GAUGE"
-            description: "Time at which postgres started (based on epoch)"
-
-    pg_replication:
-      query: "SELECT CASE WHEN (
-                NOT pg_catalog.pg_is_in_recovery()
-                OR pg_catalog.pg_last_wal_receive_lsn() = pg_catalog.pg_last_wal_replay_lsn())
-              THEN 0
-              ELSE GREATEST (0,
-                EXTRACT(EPOCH FROM (now() - pg_catalog.pg_last_xact_replay_timestamp())))
-              END AS lag,
-              pg_catalog.pg_is_in_recovery() AS in_recovery,
-              EXISTS (TABLE pg_stat_wal_receiver) AS is_wal_receiver_up,
-              (SELECT count(*) FROM pg_catalog.pg_stat_replication) AS streaming_replicas"
-      metrics:
-        - lag:
-            usage: "GAUGE"
-            description: "Replication lag behind primary in seconds"
-        - in_recovery:
-            usage: "GAUGE"
-            description: "Whether the instance is in recovery"
-        - is_wal_receiver_up:
-            usage: "GAUGE"
-            description: "Whether the instance wal_receiver is up"
-        - streaming_replicas:
-            usage: "GAUGE"
-            description: "Number of streaming replicas connected to the instance"
-
-    pg_replication_slots:
-      query: |
-        SELECT slot_name,
-          slot_type,
-          database,
-          active,
-          (CASE pg_catalog.pg_is_in_recovery()
-            WHEN TRUE THEN pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_receive_lsn(), restart_lsn)
-            ELSE pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), restart_lsn)
-          END) as pg_wal_lsn_diff
-        FROM pg_catalog.pg_replication_slots
-        WHERE NOT temporary
-      metrics:
-        - slot_name:
-            usage: "LABEL"
-            description: "Name of the replication slot"
-        - slot_type:
-            usage: "LABEL"
-            description: "Type of the replication slot"
-        - database:
-            usage: "LABEL"
-            description: "Name of the database"
-        - active:
-            usage: "GAUGE"
-            description: "Flag indicating whether the slot is active"
-        - pg_wal_lsn_diff:
-            usage: "GAUGE"
-            description: "Replication lag in bytes"
-
-    pg_stat_archiver:
-      query: |
-        SELECT archived_count
-          , failed_count
-          , COALESCE(EXTRACT(EPOCH FROM (now() - last_archived_time)), -1) AS seconds_since_last_archival
-          , COALESCE(EXTRACT(EPOCH FROM (now() - last_failed_time)), -1) AS seconds_since_last_failure
-          , COALESCE(EXTRACT(EPOCH FROM last_archived_time), -1) AS last_archived_time
-          , COALESCE(EXTRACT(EPOCH FROM last_failed_time), -1) AS last_failed_time
-          , COALESCE(CAST(CAST('x'||pg_catalog.right(pg_catalog.split_part(last_archived_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_archived_wal_start_lsn
-          , COALESCE(CAST(CAST('x'||pg_catalog.right(pg_catalog.split_part(last_failed_wal, '.', 1), 16) AS pg_catalog.bit(64)) AS pg_catalog.int8), -1) AS last_failed_wal_start_lsn
-          , EXTRACT(EPOCH FROM stats_reset) AS stats_reset_time
-        FROM pg_catalog.pg_stat_archiver
-      metrics:
-        - archived_count:
-            usage: "COUNTER"
-            description: "Number of WAL files that have been successfully archived"
-        - failed_count:
-            usage: "COUNTER"
-            description: "Number of failed attempts for archiving WAL files"
-        - seconds_since_last_archival:
-            usage: "GAUGE"
-            description: "Seconds since the last successful archival operation"
-        - seconds_since_last_failure:
-            usage: "GAUGE"
-            description: "Seconds since the last failed archival operation"
-        - last_archived_time:
-            usage: "GAUGE"
-            description: "Epoch of the last time WAL archiving succeeded"
-        - last_failed_time:
-            usage: "GAUGE"
-            description: "Epoch of the last time WAL archiving failed"
-        - last_archived_wal_start_lsn:
-            usage: "GAUGE"
-            description: "Archived WAL start LSN"
-        - last_failed_wal_start_lsn:
-            usage: "GAUGE"
-            description: "Last failed WAL LSN"
-        - stats_reset_time:
-            usage: "GAUGE"
-            description: "Time at which these statistics were last reset"
-
-    pg_stat_bgwriter:
-      runonserver: "<17.0.0"
-      query: |
-        SELECT checkpoints_timed
-          , checkpoints_req
-          , checkpoint_write_time
-          , checkpoint_sync_time
-          , buffers_checkpoint
-          , buffers_clean
-          , maxwritten_clean
-          , buffers_backend
-          , buffers_backend_fsync
-          , buffers_alloc
-        FROM pg_catalog.pg_stat_bgwriter
-      metrics:
-        - checkpoints_timed:
-            usage: "COUNTER"
-            description: "Number of scheduled checkpoints that have been performed"
-        - checkpoints_req:
-            usage: "COUNTER"
-            description: "Number of requested checkpoints that have been performed"
-        - checkpoint_write_time:
-            usage: "COUNTER"
-            description: "Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds"
-        - checkpoint_sync_time:
-            usage: "COUNTER"
-            description: "Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds"
-        - buffers_checkpoint:
-            usage: "COUNTER"
-            description: "Number of buffers written during checkpoints"
[Diff truncated by flux-local]
--- HelmRelease: databases/cloudnative-pg ClusterRole: databases/cloudnative-pg

+++ HelmRelease: databases/cloudnative-pg ClusterRole: databases/cloudnative-pg

@@ -1,213 +0,0 @@

----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
-  name: cloudnative-pg
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-rules:
-- apiGroups:
-  - ''
-  resources:
-  - configmaps
-  - secrets
-  - services
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - ''
-  resources:
-  - configmaps/status
-  - secrets/status
-  verbs:
-  - get
-  - patch
-  - update
-- apiGroups:
-  - ''
-  resources:
-  - events
-  verbs:
-  - create
-  - patch
-- apiGroups:
-  - ''
-  resources:
-  - nodes
-  verbs:
-  - get
-  - list
-  - watch
-- apiGroups:
-  - ''
-  resources:
-  - persistentvolumeclaims
-  - pods
-  - pods/exec
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - watch
-- apiGroups:
-  - ''
-  resources:
-  - pods/status
-  verbs:
-  - get
-- apiGroups:
-  - ''
-  resources:
-  - serviceaccounts
-  verbs:
-  - create
-  - get
-  - list
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - admissionregistration.k8s.io
-  resources:
-  - mutatingwebhookconfigurations
-  - validatingwebhookconfigurations
-  verbs:
-  - get
-  - patch
-- apiGroups:
-  - apps
-  resources:
-  - deployments
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - batch
-  resources:
-  - jobs
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - watch
-- apiGroups:
-  - coordination.k8s.io
-  resources:
-  - leases
-  verbs:
-  - create
-  - get
-  - update
-- apiGroups:
-  - monitoring.coreos.com
-  resources:
-  - podmonitors
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - watch
-- apiGroups:
-  - policy
-  resources:
-  - poddisruptionbudgets
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - backups
-  - clusters
-  - poolers
-  - scheduledbackups
-  verbs:
-  - create
-  - delete
-  - get
-  - list
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - backups/status
-  - scheduledbackups/status
-  verbs:
-  - get
-  - patch
-  - update
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - clusterimagecatalogs
-  - imagecatalogs
-  verbs:
-  - get
-  - list
-  - watch
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - clusters/finalizers
-  - poolers/finalizers
-  verbs:
-  - update
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - clusters/status
-  - poolers/status
-  verbs:
-  - get
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - rbac.authorization.k8s.io
-  resources:
-  - rolebindings
-  - roles
-  verbs:
-  - create
-  - get
-  - list
-  - patch
-  - update
-  - watch
-- apiGroups:
-  - snapshot.storage.k8s.io
-  resources:
-  - volumesnapshots
-  verbs:
-  - create
-  - get
-  - list
-  - patch
-  - watch
-
--- HelmRelease: databases/cloudnative-pg ClusterRole: databases/cloudnative-pg-view

+++ HelmRelease: databases/cloudnative-pg ClusterRole: databases/cloudnative-pg-view

@@ -1,22 +0,0 @@

----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
-  name: cloudnative-pg-view
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-rules:
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - backups
-  - clusters
-  - poolers
-  - scheduledbackups
-  verbs:
-  - get
-  - list
-  - watch
-
--- HelmRelease: databases/cloudnative-pg ClusterRole: databases/cloudnative-pg-edit

+++ HelmRelease: databases/cloudnative-pg ClusterRole: databases/cloudnative-pg-edit

@@ -1,24 +0,0 @@

----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
-  name: cloudnative-pg-edit
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-rules:
-- apiGroups:
-  - postgresql.cnpg.io
-  resources:
-  - backups
-  - clusters
-  - poolers
-  - scheduledbackups
-  verbs:
-  - create
-  - delete
-  - deletecollection
-  - patch
-  - update
-
--- HelmRelease: databases/cloudnative-pg ClusterRoleBinding: databases/cloudnative-pg

+++ HelmRelease: databases/cloudnative-pg ClusterRoleBinding: databases/cloudnative-pg

@@ -1,18 +0,0 @@

----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
-  name: cloudnative-pg
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-roleRef:
-  apiGroup: rbac.authorization.k8s.io
-  kind: ClusterRole
-  name: cloudnative-pg
-subjects:
-- kind: ServiceAccount
-  name: cloudnative-pg
-  namespace: databases
-
--- HelmRelease: databases/cloudnative-pg Service: databases/cnpg-webhook-service

+++ HelmRelease: databases/cloudnative-pg Service: databases/cnpg-webhook-service

@@ -1,19 +0,0 @@

----
-apiVersion: v1
-kind: Service
-metadata:
-  name: cnpg-webhook-service
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-spec:
-  type: ClusterIP
-  ports:
-  - port: 443
-    targetPort: webhook-server
-    name: webhook-server
-  selector:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-
--- HelmRelease: databases/cloudnative-pg Deployment: databases/cloudnative-pg

+++ HelmRelease: databases/cloudnative-pg Deployment: databases/cloudnative-pg

@@ -1,91 +0,0 @@

----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
-  name: cloudnative-pg
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app.kubernetes.io/name: cloudnative-pg
-      app.kubernetes.io/instance: cloudnative-pg
-  template:
-    metadata:
-      labels:
-        app.kubernetes.io/name: cloudnative-pg
-        app.kubernetes.io/instance: cloudnative-pg
-    spec:
-      containers:
-      - args:
-        - controller
-        - --leader-elect
-        - --config-map-name=cnpg-controller-manager-config
-        - --webhook-port=9443
-        command:
-        - /manager
-        env:
-        - name: OPERATOR_IMAGE_NAME
-          value: ghcr.io/cloudnative-pg/cloudnative-pg:1.24.1
-        - name: OPERATOR_NAMESPACE
-          valueFrom:
-            fieldRef:
-              fieldPath: metadata.namespace
-        - name: MONITORING_QUERIES_CONFIGMAP
-          value: cnpg-default-monitoring
-        image: ghcr.io/cloudnative-pg/cloudnative-pg:1.24.1
-        imagePullPolicy: IfNotPresent
-        livenessProbe:
-          httpGet:
-            path: /readyz
-            port: 9443
-            scheme: HTTPS
-          initialDelaySeconds: 3
-        name: manager
-        ports:
-        - containerPort: 8080
-          name: metrics
-          protocol: TCP
-        - containerPort: 9443
-          name: webhook-server
-          protocol: TCP
-        readinessProbe:
-          httpGet:
-            path: /readyz
-            port: 9443
-            scheme: HTTPS
-          initialDelaySeconds: 3
-        resources: {}
-        securityContext:
-          allowPrivilegeEscalation: false
-          capabilities:
-            drop:
-            - ALL
-          readOnlyRootFilesystem: true
-          runAsGroup: 10001
-          runAsUser: 10001
-          seccompProfile:
-            type: RuntimeDefault
-        volumeMounts:
-        - mountPath: /controller
-          name: scratch-data
-        - mountPath: /run/secrets/cnpg.io/webhook
-          name: webhook-certificates
-      securityContext:
-        runAsNonRoot: true
-        seccompProfile:
-          type: RuntimeDefault
-      serviceAccountName: cloudnative-pg
-      terminationGracePeriodSeconds: 10
-      volumes:
-      - emptyDir: {}
-        name: scratch-data
-      - name: webhook-certificates
-        secret:
-          defaultMode: 420
-          optional: true
-          secretName: cnpg-webhook-cert
-
--- HelmRelease: databases/cloudnative-pg MutatingWebhookConfiguration: databases/cnpg-mutating-webhook-configuration

+++ HelmRelease: databases/cloudnative-pg MutatingWebhookConfiguration: databases/cnpg-mutating-webhook-configuration

@@ -1,74 +0,0 @@

----
-apiVersion: admissionregistration.k8s.io/v1
-kind: MutatingWebhookConfiguration
-metadata:
-  name: cnpg-mutating-webhook-configuration
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-webhooks:
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /mutate-postgresql-cnpg-io-v1-backup
-      port: 443
-  failurePolicy: Fail
-  name: mbackup.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - backups
-  sideEffects: None
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /mutate-postgresql-cnpg-io-v1-cluster
-      port: 443
-  failurePolicy: Fail
-  name: mcluster.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - clusters
-  sideEffects: None
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /mutate-postgresql-cnpg-io-v1-scheduledbackup
-      port: 443
-  failurePolicy: Fail
-  name: mscheduledbackup.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - scheduledbackups
-  sideEffects: None
-
--- HelmRelease: databases/cloudnative-pg ValidatingWebhookConfiguration: databases/cnpg-validating-webhook-configuration

+++ HelmRelease: databases/cloudnative-pg ValidatingWebhookConfiguration: databases/cnpg-validating-webhook-configuration

@@ -1,95 +0,0 @@

----
-apiVersion: admissionregistration.k8s.io/v1
-kind: ValidatingWebhookConfiguration
-metadata:
-  name: cnpg-validating-webhook-configuration
-  labels:
-    app.kubernetes.io/name: cloudnative-pg
-    app.kubernetes.io/instance: cloudnative-pg
-    app.kubernetes.io/managed-by: Helm
-webhooks:
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /validate-postgresql-cnpg-io-v1-backup
-      port: 443
-  failurePolicy: Fail
-  name: vbackup.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - backups
-  sideEffects: None
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /validate-postgresql-cnpg-io-v1-cluster
-      port: 443
-  failurePolicy: Fail
-  name: vcluster.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - clusters
-  sideEffects: None
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /validate-postgresql-cnpg-io-v1-scheduledbackup
-      port: 443
-  failurePolicy: Fail
-  name: vscheduledbackup.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - scheduledbackups
-  sideEffects: None
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: cnpg-webhook-service
-      namespace: databases
-      path: /validate-postgresql-cnpg-io-v1-pooler
-      port: 443
-  failurePolicy: Fail
-  name: vpooler.cnpg.io
-  rules:
-  - apiGroups:
-    - postgresql.cnpg.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - poolers
-  sideEffects: None
-

@GeckoSplinter GeckoSplinter merged commit cb13eb8 into main Nov 20, 2024
6 checks passed
@GeckoSplinter GeckoSplinter deleted the clean-pg branch November 20, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant