847 lines
32 KiB
YAML
847 lines
32 KiB
YAML
---
|
|
# Source: vaultwarden/charts/vaultwarden/templates/common.yaml
|
|
---
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: vaultwarden-data
|
|
labels:
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: vaultwarden
|
|
helm.sh/chart: vaultwarden-4.4.0
|
|
annotations:
|
|
helm.sh/resource-policy: keep
|
|
namespace: vaultwarden
|
|
spec:
|
|
accessModes:
|
|
- "ReadWriteOnce"
|
|
resources:
|
|
requests:
|
|
storage: "5Gi"
|
|
storageClassName: "ceph-block"
|
|
---
|
|
# Source: vaultwarden/charts/vaultwarden/templates/common.yaml
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: vaultwarden
|
|
app.kubernetes.io/service: vaultwarden
|
|
helm.sh/chart: vaultwarden-4.4.0
|
|
namespace: vaultwarden
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 80
|
|
targetPort: 80
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/name: vaultwarden
|
|
---
|
|
# Source: vaultwarden/charts/cloudflared/templates/common.yaml
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: vaultwarden-cloudflared
|
|
labels:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: cloudflared
|
|
app.kubernetes.io/version: 2025.10.0
|
|
helm.sh/chart: cloudflared-1.23.0
|
|
namespace: vaultwarden
|
|
spec:
|
|
revisionHistoryLimit: 3
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/name: cloudflared
|
|
app.kubernetes.io/instance: vaultwarden
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/name: cloudflared
|
|
spec:
|
|
enableServiceLinks: false
|
|
serviceAccountName: default
|
|
automountServiceAccountToken: true
|
|
hostIPC: false
|
|
hostNetwork: false
|
|
hostPID: false
|
|
dnsPolicy: ClusterFirst
|
|
containers:
|
|
- args:
|
|
- tunnel
|
|
- --protocol
|
|
- http2
|
|
- --no-autoupdate
|
|
- run
|
|
- --token
|
|
- $(CF_MANAGED_TUNNEL_TOKEN)
|
|
env:
|
|
- name: CF_MANAGED_TUNNEL_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: cf-tunnel-token
|
|
name: vaultwarden-cloudflared-secret
|
|
image: cloudflare/cloudflared:2025.11.1
|
|
imagePullPolicy: IfNotPresent
|
|
name: main
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 128Mi
|
|
---
|
|
# Source: vaultwarden/charts/vaultwarden/templates/common.yaml
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: vaultwarden
|
|
helm.sh/chart: vaultwarden-4.4.0
|
|
namespace: vaultwarden
|
|
spec:
|
|
revisionHistoryLimit: 3
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/name: vaultwarden
|
|
app.kubernetes.io/instance: vaultwarden
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/controller: main
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/name: vaultwarden
|
|
spec:
|
|
enableServiceLinks: false
|
|
serviceAccountName: default
|
|
automountServiceAccountToken: true
|
|
hostIPC: false
|
|
hostNetwork: false
|
|
hostPID: false
|
|
dnsPolicy: ClusterFirst
|
|
containers:
|
|
- env:
|
|
- name: DOMAIN
|
|
value: https://passwords.alexlebens.dev
|
|
- name: SIGNUPS_ALLOWED
|
|
value: "false"
|
|
- name: INVITATIONS_ALLOWED
|
|
value: "false"
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: uri
|
|
name: vaultwarden-postgresql-17-cluster-app
|
|
image: vaultwarden/server:1.34.3
|
|
imagePullPolicy: IfNotPresent
|
|
name: main
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 128Mi
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: config
|
|
volumes:
|
|
- name: config
|
|
persistentVolumeClaim:
|
|
claimName: vaultwarden-data
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/cluster.yaml
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
kind: Cluster
|
|
metadata:
|
|
name: vaultwarden-postgresql-17-cluster
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
instances: 3
|
|
imageName: "ghcr.io/cloudnative-pg/postgresql:17.7-standard-trixie"
|
|
imagePullPolicy: IfNotPresent
|
|
postgresUID: 26
|
|
postgresGID: 26
|
|
plugins:
|
|
- name: barman-cloud.cloudnative-pg.io
|
|
enabled: true
|
|
isWALArchiver: false
|
|
parameters:
|
|
barmanObjectName: "vaultwarden-postgresql-17-external-backup"
|
|
serverName: "vaultwarden-postgresql-17-backup-1"
|
|
- name: barman-cloud.cloudnative-pg.io
|
|
enabled: true
|
|
isWALArchiver: true
|
|
parameters:
|
|
barmanObjectName: "vaultwarden-postgresql-17-garage-local-backup"
|
|
serverName: "vaultwarden-postgresql-17-backup-1"
|
|
|
|
externalClusters:
|
|
- name: recovery
|
|
plugin:
|
|
name: barman-cloud.cloudnative-pg.io
|
|
parameters:
|
|
barmanObjectName: "vaultwarden-postgresql-17-recovery"
|
|
serverName: vaultwarden-postgresql-17-backup-1
|
|
|
|
storage:
|
|
size: 10Gi
|
|
storageClass: local-path
|
|
walStorage:
|
|
size: 2Gi
|
|
storageClass: local-path
|
|
resources:
|
|
limits:
|
|
hugepages-2Mi: 256Mi
|
|
requests:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
|
|
affinity:
|
|
enablePodAntiAffinity: true
|
|
topologyKey: kubernetes.io/hostname
|
|
|
|
primaryUpdateMethod: switchover
|
|
primaryUpdateStrategy: unsupervised
|
|
logLevel: info
|
|
enableSuperuserAccess: false
|
|
enablePDB: true
|
|
|
|
postgresql:
|
|
parameters:
|
|
hot_standby_feedback: "on"
|
|
max_slot_wal_keep_size: 2000MB
|
|
shared_buffers: 128MB
|
|
|
|
monitoring:
|
|
enablePodMonitor: true
|
|
disableDefaultQueries: false
|
|
|
|
|
|
bootstrap:
|
|
recovery:
|
|
|
|
database: app
|
|
|
|
source: vaultwarden-postgresql-17-backup-1
|
|
|
|
externalClusters:
|
|
- name: vaultwarden-postgresql-17-backup-1
|
|
plugin:
|
|
name: barman-cloud.cloudnative-pg.io
|
|
enabled: true
|
|
isWALArchiver: false
|
|
parameters:
|
|
barmanObjectName: "vaultwarden-postgresql-17-recovery"
|
|
serverName: vaultwarden-postgresql-17-backup-1
|
|
---
|
|
# Source: vaultwarden/templates/external-secret.yaml
|
|
apiVersion: external-secrets.io/v1
|
|
kind: ExternalSecret
|
|
metadata:
|
|
name: vaultwarden-cloudflared-secret
|
|
namespace: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/name: vaultwarden-cloudflared-secret
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
spec:
|
|
secretStoreRef:
|
|
kind: ClusterSecretStore
|
|
name: vault
|
|
data:
|
|
- secretKey: cf-tunnel-token
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /cloudflare/tunnels/vaultwarden
|
|
metadataPolicy: None
|
|
property: token
|
|
---
|
|
# Source: vaultwarden/templates/external-secret.yaml
|
|
apiVersion: external-secrets.io/v1
|
|
kind: ExternalSecret
|
|
metadata:
|
|
name: vaultwarden-data-backup-secret
|
|
namespace: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/name: vaultwarden-data-backup-secret
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
spec:
|
|
secretStoreRef:
|
|
kind: ClusterSecretStore
|
|
name: vault
|
|
target:
|
|
template:
|
|
mergePolicy: Merge
|
|
engineVersion: v2
|
|
data:
|
|
RESTIC_REPOSITORY: "{{ .BUCKET_ENDPOINT }}/vaultwarden/vaultwarden-data"
|
|
data:
|
|
- secretKey: BUCKET_ENDPOINT
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /cl01tl/volsync/restic/config
|
|
metadataPolicy: None
|
|
property: S3_BUCKET_ENDPOINT
|
|
- secretKey: RESTIC_PASSWORD
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /cl01tl/volsync/restic/config
|
|
metadataPolicy: None
|
|
property: RESTIC_PASSWORD
|
|
- secretKey: AWS_DEFAULT_REGION
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /cl01tl/volsync/restic/config
|
|
metadataPolicy: None
|
|
property: AWS_DEFAULT_REGION
|
|
- secretKey: AWS_ACCESS_KEY_ID
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /digital-ocean/home-infra/volsync-backups
|
|
metadataPolicy: None
|
|
property: access_key
|
|
- secretKey: AWS_SECRET_ACCESS_KEY
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /digital-ocean/home-infra/volsync-backups
|
|
metadataPolicy: None
|
|
property: secret_key
|
|
---
|
|
# Source: vaultwarden/templates/external-secret.yaml
|
|
apiVersion: external-secrets.io/v1
|
|
kind: ExternalSecret
|
|
metadata:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret
|
|
namespace: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17-cluster-backup-secret
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
spec:
|
|
secretStoreRef:
|
|
kind: ClusterSecretStore
|
|
name: vault
|
|
data:
|
|
- secretKey: ACCESS_KEY_ID
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /digital-ocean/home-infra/postgres-backups
|
|
metadataPolicy: None
|
|
property: access
|
|
- secretKey: ACCESS_SECRET_KEY
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /digital-ocean/home-infra/postgres-backups
|
|
metadataPolicy: None
|
|
property: secret
|
|
---
|
|
# Source: vaultwarden/templates/external-secret.yaml
|
|
apiVersion: external-secrets.io/v1
|
|
kind: ExternalSecret
|
|
metadata:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
namespace: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
spec:
|
|
secretStoreRef:
|
|
kind: ClusterSecretStore
|
|
name: vault
|
|
data:
|
|
- secretKey: ACCESS_KEY_ID
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /garage/home-infra/postgres-backups
|
|
metadataPolicy: None
|
|
property: ACCESS_KEY_ID
|
|
- secretKey: ACCESS_SECRET_KEY
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /garage/home-infra/postgres-backups
|
|
metadataPolicy: None
|
|
property: ACCESS_SECRET_KEY
|
|
- secretKey: ACCESS_REGION
|
|
remoteRef:
|
|
conversionStrategy: Default
|
|
decodingStrategy: None
|
|
key: /garage/home-infra/postgres-backups
|
|
metadataPolicy: None
|
|
property: ACCESS_REGION
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/object-store.yaml
|
|
apiVersion: barmancloud.cnpg.io/v1
|
|
kind: ObjectStore
|
|
metadata:
|
|
name: "vaultwarden-postgresql-17-external-backup"
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
retentionPolicy: 30d
|
|
configuration:
|
|
destinationPath: s3://postgres-backups-ce540ddf106d186bbddca68a/cl01tl/vaultwarden/vaultwarden-postgresql-17-cluster
|
|
endpointURL: https://nyc3.digitaloceanspaces.com
|
|
s3Credentials:
|
|
accessKeyId:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret
|
|
key: ACCESS_KEY_ID
|
|
secretAccessKey:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret
|
|
key: ACCESS_SECRET_KEY
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/object-store.yaml
|
|
apiVersion: barmancloud.cnpg.io/v1
|
|
kind: ObjectStore
|
|
metadata:
|
|
name: "vaultwarden-postgresql-17-garage-local-backup"
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
retentionPolicy: 3d
|
|
configuration:
|
|
destinationPath: s3://postgres-backups/cl01tl/vaultwarden/vaultwarden-postgresql-17-cluster
|
|
endpointURL: http://garage-main.garage:3900
|
|
s3Credentials:
|
|
accessKeyId:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
key: ACCESS_KEY_ID
|
|
secretAccessKey:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
key: ACCESS_SECRET_KEY
|
|
region:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
key: ACCESS_REGION
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/object-store.yaml
|
|
apiVersion: barmancloud.cnpg.io/v1
|
|
kind: ObjectStore
|
|
metadata:
|
|
name: "vaultwarden-postgresql-17-recovery"
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
configuration:
|
|
destinationPath: s3://postgres-backups/cl01tl/vaultwarden/vaultwarden-postgresql-17-cluster
|
|
endpointURL: http://garage-main.garage:3900
|
|
wal:
|
|
compression: snappy
|
|
maxParallel: 1
|
|
data:
|
|
compression: snappy
|
|
jobs: 1
|
|
s3Credentials:
|
|
accessKeyId:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
key: ACCESS_KEY_ID
|
|
secretAccessKey:
|
|
name: vaultwarden-postgresql-17-cluster-backup-secret-garage
|
|
key: ACCESS_SECRET_KEY
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/prometheus-rule.yaml
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: PrometheusRule
|
|
metadata:
|
|
name: vaultwarden-postgresql-17-alert-rules
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
groups:
|
|
- name: cloudnative-pg/vaultwarden-postgresql-17
|
|
rules:
|
|
- alert: CNPGClusterBackendsWaitingWarning
|
|
annotations:
|
|
summary: CNPG Cluster a backend is waiting for longer than 5 minutes.
|
|
description: |-
|
|
Pod {{ $labels.pod }}
|
|
has been waiting for longer than 5 minutes
|
|
expr: |
|
|
cnpg_backends_waiting_total > 300
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterDatabaseDeadlockConflictsWarning
|
|
annotations:
|
|
summary: CNPG Cluster has over 10 deadlock conflicts.
|
|
description: |-
|
|
There are over 10 deadlock conflicts in
|
|
{{ $labels.pod }}
|
|
expr: |
|
|
cnpg_pg_stat_database_deadlocks > 10
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterHACritical
|
|
annotations:
|
|
summary: CNPG Cluster has no standby replicas!
|
|
description: |-
|
|
CloudNativePG Cluster "{{`{{`}} $labels.job {{`}}`}}" has no ready standby replicas. Your cluster at a severe
|
|
risk of data loss and downtime if the primary instance fails.
|
|
|
|
The primary instance is still online and able to serve queries, although connections to the `-ro` endpoint
|
|
will fail. The `-r` endpoint os operating at reduced capacity and all traffic is being served by the main.
|
|
|
|
This can happen during a normal fail-over or automated minor version upgrades in a cluster with 2 or less
|
|
instances. The replaced instance may need some time to catch-up with the cluster primary instance.
|
|
|
|
This alarm will be always trigger if your cluster is configured to run with only 1 instance. In this
|
|
case you may want to silence it.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHACritical.md
|
|
expr: |
|
|
max by (job) (cnpg_pg_replication_streaming_replicas{namespace="vaultwarden"} - cnpg_pg_replication_is_wal_receiver_up{namespace="vaultwarden"}) < 1
|
|
for: 5m
|
|
labels:
|
|
severity: critical
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterHAWarning
|
|
annotations:
|
|
summary: CNPG Cluster less than 2 standby replicas.
|
|
description: |-
|
|
CloudNativePG Cluster "{{`{{`}} $labels.job {{`}}`}}" has only {{`{{`}} $value {{`}}`}} standby replicas, putting
|
|
your cluster at risk if another instance fails. The cluster is still able to operate normally, although
|
|
the `-ro` and `-r` endpoints operate at reduced capacity.
|
|
|
|
This can happen during a normal fail-over or automated minor version upgrades. The replaced instance may
|
|
need some time to catch-up with the cluster primary instance.
|
|
|
|
This alarm will be constantly triggered if your cluster is configured to run with less than 3 instances.
|
|
In this case you may want to silence it.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHAWarning.md
|
|
expr: |
|
|
max by (job) (cnpg_pg_replication_streaming_replicas{namespace="vaultwarden"} - cnpg_pg_replication_is_wal_receiver_up{namespace="vaultwarden"}) < 2
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterHighConnectionsCritical
|
|
annotations:
|
|
summary: CNPG Instance maximum number of connections critical!
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" instance {{`{{`}} $labels.pod {{`}}`}} is using {{`{{`}} $value {{`}}`}}% of
|
|
the maximum number of connections.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHighConnectionsCritical.md
|
|
expr: |
|
|
sum by (pod) (cnpg_backends_total{namespace="vaultwarden", pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) / max by (pod) (cnpg_pg_settings_setting{name="max_connections", namespace="vaultwarden", pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) * 100 > 95
|
|
for: 5m
|
|
labels:
|
|
severity: critical
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterHighConnectionsWarning
|
|
annotations:
|
|
summary: CNPG Instance is approaching the maximum number of connections.
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" instance {{`{{`}} $labels.pod {{`}}`}} is using {{`{{`}} $value {{`}}`}}% of
|
|
the maximum number of connections.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHighConnectionsWarning.md
|
|
expr: |
|
|
sum by (pod) (cnpg_backends_total{namespace="vaultwarden", pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) / max by (pod) (cnpg_pg_settings_setting{name="max_connections", namespace="vaultwarden", pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) * 100 > 80
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterHighReplicationLag
|
|
annotations:
|
|
summary: CNPG Cluster high replication lag
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" is experiencing a high replication lag of
|
|
{{`{{`}} $value {{`}}`}}ms.
|
|
|
|
High replication lag indicates network issues, busy instances, slow queries or suboptimal configuration.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHighReplicationLag.md
|
|
expr: |
|
|
max(cnpg_pg_replication_lag{namespace="vaultwarden",pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) * 1000 > 1000
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterInstancesOnSameNode
|
|
annotations:
|
|
summary: CNPG Cluster instances are located on the same node.
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" has {{`{{`}} $value {{`}}`}}
|
|
instances on the same node {{`{{`}} $labels.node {{`}}`}}.
|
|
|
|
A failure or scheduled downtime of a single node will lead to a potential service disruption and/or data loss.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterInstancesOnSameNode.md
|
|
expr: |
|
|
count by (node) (kube_pod_info{namespace="vaultwarden", pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) > 1
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterLongRunningTransactionWarning
|
|
annotations:
|
|
summary: CNPG Cluster query is taking longer than 5 minutes.
|
|
description: |-
|
|
CloudNativePG Cluster Pod {{ $labels.pod }}
|
|
is taking more than 5 minutes (300 seconds) for a query.
|
|
expr: |-
|
|
cnpg_backends_max_tx_duration_seconds > 300
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterLowDiskSpaceCritical
|
|
annotations:
|
|
summary: CNPG Instance is running out of disk space!
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" is running extremely low on disk space. Check attached PVCs!
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterLowDiskSpaceCritical.md
|
|
expr: |
|
|
max(max by(persistentvolumeclaim) (1 - kubelet_volume_stats_available_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"} / kubelet_volume_stats_capacity_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"})) > 0.9 OR
|
|
max(max by(persistentvolumeclaim) (1 - kubelet_volume_stats_available_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-wal"} / kubelet_volume_stats_capacity_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-wal"})) > 0.9 OR
|
|
max(sum by (namespace,persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-tbs.*"})
|
|
/
|
|
sum by (namespace,persistentvolumeclaim) (kubelet_volume_stats_capacity_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-tbs.*"})
|
|
*
|
|
on(namespace, persistentvolumeclaim) group_left(volume)
|
|
kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}
|
|
) > 0.9
|
|
for: 5m
|
|
labels:
|
|
severity: critical
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterLowDiskSpaceWarning
|
|
annotations:
|
|
summary: CNPG Instance is running out of disk space.
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" is running low on disk space. Check attached PVCs.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterLowDiskSpaceWarning.md
|
|
expr: |
|
|
max(max by(persistentvolumeclaim) (1 - kubelet_volume_stats_available_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"} / kubelet_volume_stats_capacity_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"})) > 0.7 OR
|
|
max(max by(persistentvolumeclaim) (1 - kubelet_volume_stats_available_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-wal"} / kubelet_volume_stats_capacity_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-wal"})) > 0.7 OR
|
|
max(sum by (namespace,persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-tbs.*"})
|
|
/
|
|
sum by (namespace,persistentvolumeclaim) (kubelet_volume_stats_capacity_bytes{namespace="vaultwarden", persistentvolumeclaim=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$-tbs.*"})
|
|
*
|
|
on(namespace, persistentvolumeclaim) group_left(volume)
|
|
kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}
|
|
) > 0.7
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterOffline
|
|
annotations:
|
|
summary: CNPG Cluster has no running instances!
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" has no ready instances.
|
|
|
|
Having an offline cluster means your applications will not be able to access the database, leading to
|
|
potential service disruption and/or data loss.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterOffline.md
|
|
expr: |
|
|
(count(cnpg_collector_up{namespace="vaultwarden",pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"}) OR on() vector(0)) == 0
|
|
for: 5m
|
|
labels:
|
|
severity: critical
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterPGDatabaseXidAgeWarning
|
|
annotations:
|
|
summary: CNPG Cluster has a number of transactions from the frozen XID to the current one.
|
|
description: |-
|
|
Over 300,000,000 transactions from frozen xid
|
|
on pod {{ $labels.pod }}
|
|
expr: |
|
|
cnpg_pg_database_xid_age > 300000000
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterPGReplicationWarning
|
|
annotations:
|
|
summary: CNPG Cluster standby is lagging behind the primary.
|
|
description: |-
|
|
Standby is lagging behind by over 300 seconds (5 minutes)
|
|
expr: |
|
|
cnpg_pg_replication_lag > 300
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterReplicaFailingReplicationWarning
|
|
annotations:
|
|
summary: CNPG Cluster has a replica is failing to replicate.
|
|
description: |-
|
|
Replica {{ $labels.pod }}
|
|
is failing to replicate
|
|
expr: |
|
|
cnpg_pg_replication_in_recovery > cnpg_pg_replication_is_wal_receiver_up
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
- alert: CNPGClusterZoneSpreadWarning
|
|
annotations:
|
|
summary: CNPG Cluster instances in the same zone.
|
|
description: |-
|
|
CloudNativePG Cluster "vaultwarden/vaultwarden-postgresql-17-cluster" has instances in the same availability zone.
|
|
|
|
A disaster in one availability zone will lead to a potential service disruption and/or data loss.
|
|
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterZoneSpreadWarning.md
|
|
expr: |
|
|
3 > count(count by (label_topology_kubernetes_io_zone) (kube_pod_info{namespace="vaultwarden", pod=~"vaultwarden-postgresql-17-cluster-([1-9][0-9]*)$"} * on(node,instance) group_left(label_topology_kubernetes_io_zone) kube_node_labels)) < 3
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
namespace: vaultwarden
|
|
cnpg_cluster: vaultwarden-postgresql-17-cluster
|
|
---
|
|
# Source: vaultwarden/templates/replication-source.yaml
|
|
apiVersion: volsync.backube/v1alpha1
|
|
kind: ReplicationSource
|
|
metadata:
|
|
name: vaultwarden-data-backup-source
|
|
namespace: vaultwarden
|
|
labels:
|
|
app.kubernetes.io/name: vaultwarden-data-backup-source
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
spec:
|
|
sourcePVC: vaultwarden-data
|
|
trigger:
|
|
schedule: 0 4 * * *
|
|
restic:
|
|
pruneIntervalDays: 7
|
|
repository: vaultwarden-data-backup-secret
|
|
retain:
|
|
hourly: 1
|
|
daily: 3
|
|
weekly: 2
|
|
monthly: 2
|
|
yearly: 4
|
|
copyMethod: Snapshot
|
|
storageClassName: ceph-block
|
|
volumeSnapshotClassName: ceph-blockpool-snapshot
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/scheduled-backup.yaml
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
kind: ScheduledBackup
|
|
metadata:
|
|
name: "vaultwarden-postgresql-17-daily-backup-scheduled-backup"
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
immediate: false
|
|
suspend: false
|
|
schedule: "0 0 0 * * *"
|
|
backupOwnerReference: self
|
|
cluster:
|
|
name: vaultwarden-postgresql-17-cluster
|
|
method: plugin
|
|
pluginConfiguration:
|
|
name: barman-cloud.cloudnative-pg.io
|
|
parameters:
|
|
barmanObjectName: "vaultwarden-postgresql-17-external-backup"
|
|
---
|
|
# Source: vaultwarden/charts/postgres-17-cluster/templates/scheduled-backup.yaml
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
kind: ScheduledBackup
|
|
metadata:
|
|
name: "vaultwarden-postgresql-17-live-backup-scheduled-backup"
|
|
namespace: vaultwarden
|
|
labels:
|
|
helm.sh/chart: postgres-17-cluster-6.16.0
|
|
app.kubernetes.io/name: vaultwarden-postgresql-17
|
|
app.kubernetes.io/instance: vaultwarden
|
|
app.kubernetes.io/part-of: vaultwarden
|
|
app.kubernetes.io/version: "6.16.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
spec:
|
|
immediate: true
|
|
suspend: false
|
|
schedule: "0 0 0 * * *"
|
|
backupOwnerReference: self
|
|
cluster:
|
|
name: vaultwarden-postgresql-17-cluster
|
|
method: plugin
|
|
pluginConfiguration:
|
|
name: barman-cloud.cloudnative-pg.io
|
|
parameters:
|
|
barmanObjectName: "vaultwarden-postgresql-17-garage-local-backup"
|