From 55cb27f5f81ade14e3f4a1183fe913b569affc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Tue, 12 Mar 2024 17:40:56 +0100 Subject: [PATCH] fix --- share/dataset-pg/databases.tf | 2 +- share/dataset-pg/index.yaml | 229 +++++++++++++++++---------------- share/dataset-pg/postgresql.tf | 1 + 3 files changed, 117 insertions(+), 115 deletions(-) diff --git a/share/dataset-pg/databases.tf b/share/dataset-pg/databases.tf index b443e9f..5306f98 100644 --- a/share/dataset-pg/databases.tf +++ b/share/dataset-pg/databases.tf @@ -62,7 +62,7 @@ data "kubernetes_secret_v1" "password_get" { } resource "postgresql_role" "owner" { - depends_on = [ time_sleep.wait_pg_ready, kubectl_manifest.prj_pg, data.kubernetes_secret_v1.postgresql_password ] + depends_on = [ time_sleep.wait_pg_ready, kubectl_manifest.prj_pg, kubectl_manifest.db_secret, data.kubernetes_secret_v1.postgresql_password ] count = length(local.sorted-dbs) name = "${local.sorted-dbs[count.index].name}" login = true diff --git a/share/dataset-pg/index.yaml b/share/dataset-pg/index.yaml index cd03ad3..115a8af 100644 --- a/share/dataset-pg/index.yaml +++ b/share/dataset-pg/index.yaml @@ -6,74 +6,6 @@ metadata: name: dataset-pg description: null options: - backups: - default: - enable: false - endpoint: '' - key_id_key: s3-id - retention: - db: 30d - schedule: - db: 0 3 * * * - secret_key: s3-secret - secret_name: backup-settings - examples: - - enable: false - endpoint: '' - key_id_key: s3-id - retention: - db: 30d - schedule: - db: 0 3 * * * - secret_key: s3-secret - secret_name: backup-settings - properties: - enable: - default: false - type: boolean - endpoint: - default: '' - type: string - key_id_key: - default: s3-id - type: string - retention: - default: - db: 30d - properties: - db: - default: 30d - type: string - type: object - schedule: - default: - db: 0 3 * * * - properties: - db: - default: 0 3 * * * - type: string - type: object - secret_key: - default: s3-secret - type: string - secret_name: - default: backup-settings - type: string - type: object - databases: - default: [] - items: - properties: - name: - default: db - type: string - type: object - type: array - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string storage: default: postgres: @@ -91,16 +23,50 @@ options: type: string type: object type: object - app_group: - default: api - examples: - - api - type: string domain_name: default: your_company.com examples: - your_company.com type: string + images: + default: + postgresql: + registry: ghcr.io + repository: cloudnative-pg/postgresql + tag: 15.3 + examples: + - postgresql: + registry: ghcr.io + repository: cloudnative-pg/postgresql + tag: 15.3 + properties: + postgresql: + default: + registry: ghcr.io + repository: cloudnative-pg/postgresql + tag: 15.3 + properties: + registry: + default: ghcr.io + type: string + repository: + default: cloudnative-pg/postgresql + type: string + tag: + default: 15.3 + type: number + type: object + type: object + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod + type: string + app_group: + default: api + examples: + - api + type: string postgres: default: replicas: 1 @@ -116,25 +82,6 @@ options: examples: - traefik type: string - roles: - default: [] - items: - properties: - name: - default: alt-account - type: string - type: object - type: array - domain: - default: your-company - examples: - - your-company - type: string - sub_domain: - default: dataset-pg - examples: - - dataset-pg - type: string extentions: default: directus: @@ -316,34 +263,87 @@ options: type: object type: object type: object - images: - default: - postgresql: - registry: ghcr.io - repository: cloudnative-pg/postgresql - tag: 15.3 + databases: + default: [] + items: + properties: + name: + default: db + type: string + type: object + type: array + domain: + default: your-company examples: - - postgresql: - registry: ghcr.io - repository: cloudnative-pg/postgresql - tag: 15.3 + - your-company + type: string + roles: + default: [] + items: + properties: + name: + default: alt-account + type: string + type: object + type: array + sub_domain: + default: dataset-pg + examples: + - dataset-pg + type: string + backups: + default: + enable: false + endpoint: '' + key_id_key: s3-id + retention: + db: 30d + schedule: + db: 0 3 * * * + secret_key: s3-secret + secret_name: backup-settings + examples: + - enable: false + endpoint: '' + key_id_key: s3-id + retention: + db: 30d + schedule: + db: 0 3 * * * + secret_key: s3-secret + secret_name: backup-settings properties: - postgresql: + enable: + default: false + type: boolean + endpoint: + default: '' + type: string + key_id_key: + default: s3-id + type: string + retention: default: - registry: ghcr.io - repository: cloudnative-pg/postgresql - tag: 15.3 + db: 30d properties: - registry: - default: ghcr.io + db: + default: 30d type: string - repository: - default: cloudnative-pg/postgresql - type: string - tag: - default: 15.3 - type: number type: object + schedule: + default: + db: 0 3 * * * + properties: + db: + default: 0 3 * * * + type: string + type: object + secret_key: + default: s3-secret + type: string + secret_name: + default: backup-settings + type: string type: object dependencies: - dist: null @@ -360,6 +360,7 @@ providers: authentik: true kubectl: true postgresql: true + mysql: null restapi: null http: null gitea: null diff --git a/share/dataset-pg/postgresql.tf b/share/dataset-pg/postgresql.tf index 6b66636..ebd2f56 100644 --- a/share/dataset-pg/postgresql.tf +++ b/share/dataset-pg/postgresql.tf @@ -23,6 +23,7 @@ resource "kubectl_manifest" "prj_pg" { size: "${var.storage.postgres.size}" monitoring: enablePodMonitor: true + enableSuperuserAccess: true bootstrap: initdb: database: "${var.instance}"