feat(storage): migrate 38 NFS PVCs to proxmox-lvm (Wave 2)
Add proxmox-lvm PVCs with pvc-autoresizer annotations for all remaining single-pod app data services. Deployments updated to use new block storage PVCs. Old NFS modules retained for rollback. Services: affine, changedetection, diun, excalidraw, f1-stream, hackmd, isponsorblocktv, matrix, n8n, send, grampsweb, health, onlyoffice, owntracks, paperless-ngx, privatebin, resume, speedtest, stirling-pdf, tandoor, rybbit (clickhouse), tor-proxy (torrserver), whisper+piper, frigate (config), ollama (ui), servarr (prowlarr/listenarr/qbittorrent), aiostreams, freshrss (extensions), meshcentral (data+files), openclaw (data+home+ openlobster), technitium, mailserver (data+roundcube html+enigma), dbaas (pgadmin). Strategy set to Recreate where needed for RWO volumes.
This commit is contained in:
parent
3dccbca95b
commit
cb8a808700
36 changed files with 1166 additions and 50 deletions
|
|
@ -208,7 +208,7 @@ resource "helm_release" "mysql_cluster" {
|
|||
matchExpressions = [{
|
||||
key = "kubernetes.io/hostname"
|
||||
operator = "NotIn"
|
||||
values = ["k8s-node1", "k8s-node2"]
|
||||
values = ["k8s-node1"]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
|
@ -305,6 +305,28 @@ module "nfs_pgadmin" {
|
|||
nfs_path = "/mnt/main/postgresql/pgadmin"
|
||||
}
|
||||
|
||||
resource "kubernetes_persistent_volume_claim" "pgadmin_proxmox" {
|
||||
wait_until_bound = false
|
||||
metadata {
|
||||
name = "dbaas-pgadmin-proxmox"
|
||||
namespace = kubernetes_namespace.dbaas.metadata[0].name
|
||||
annotations = {
|
||||
"resize.topolvm.io/threshold" = "80%"
|
||||
"resize.topolvm.io/increase" = "100%"
|
||||
"resize.topolvm.io/storage_limit" = "5Gi"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
access_modes = ["ReadWriteOnce"]
|
||||
storage_class_name = "proxmox-lvm"
|
||||
resources {
|
||||
requests = {
|
||||
storage = "1Gi"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module "nfs_postgresql_backup" {
|
||||
source = "../../../../modules/kubernetes/nfs_volume"
|
||||
name = "dbaas-postgresql-backup"
|
||||
|
|
@ -988,6 +1010,9 @@ resource "kubernetes_deployment" "pgadmin" {
|
|||
}
|
||||
}
|
||||
spec {
|
||||
strategy {
|
||||
type = "Recreate"
|
||||
}
|
||||
selector {
|
||||
match_labels = {
|
||||
app = "pgadmin"
|
||||
|
|
@ -1038,7 +1063,7 @@ resource "kubernetes_deployment" "pgadmin" {
|
|||
# name = "pgadmin-config"
|
||||
# }
|
||||
persistent_volume_claim {
|
||||
claim_name = module.nfs_pgadmin.claim_name
|
||||
claim_name = kubernetes_persistent_volume_claim.pgadmin_proxmox.metadata[0].name
|
||||
}
|
||||
}
|
||||
dns_config {
|
||||
|
|
@ -1116,7 +1141,7 @@ resource "kubernetes_cron_job_v1" "postgresql-backup" {
|
|||
_wb0=$(awk '/^write_bytes/{print $2}' /proc/$$/io 2>/dev/null || echo 0)
|
||||
|
||||
export now=$(date +"%Y_%m_%d_%H_%M")
|
||||
PGPASSWORD=$PGPASSWORD pg_dumpall -h postgresql.dbaas -U postgres | gzip -9 > /backup/dump_$now.sql.gz
|
||||
PGPASSWORD=$PGPASSWORD pg_dumpall -h pg-cluster-rw.dbaas -U postgres | gzip -9 > /backup/dump_$now.sql.gz
|
||||
|
||||
# Rotate — 14 day retention
|
||||
cd /backup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue