From 791b9f73bf86f5cbaefb05998d22ad758bbb6da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Fri, 26 Jan 2024 14:00:04 +0100 Subject: [PATCH] fix --- share/dataset-pg/databases.tf | 3 - share/dataset-pg/index.yaml | 136 +++++++++++++++++----------------- share/dataset-pg/roles.tf | 1 + 3 files changed, 69 insertions(+), 71 deletions(-) diff --git a/share/dataset-pg/databases.tf b/share/dataset-pg/databases.tf index 7246d66..517858b 100644 --- a/share/dataset-pg/databases.tf +++ b/share/dataset-pg/databases.tf @@ -16,9 +16,6 @@ locals { pg_username = data.kubernetes_secret_v1.postgresql_password.data["username"] pg_password = data.kubernetes_secret_v1.postgresql_password.data["password"] pg_host = "${var.instance}-${var.component}-rw.${var.namespace}.svc" - pg-username = data.kubernetes_secret_v1.postgresql_password.data["username"] - pg-password = data.kubernetes_secret_v1.postgresql_password.data["password"] - pg-host = "${var.instance}-${var.component}-rw.${var.namespace}.svc" sorted-db-name = reverse(distinct(sort([ for db in var.databases: db.name diff --git a/share/dataset-pg/index.yaml b/share/dataset-pg/index.yaml index 8cca8be..51255de 100644 --- a/share/dataset-pg/index.yaml +++ b/share/dataset-pg/index.yaml @@ -6,16 +6,50 @@ metadata: name: dataset-pg description: null options: - app_group: - default: api + images: + default: + postgresql: + registry: ghcr.io + repository: cloudnative-pg/postgresql + tag: 15.3 examples: - - api - type: string - domain: - default: your-company + - 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 + ingress_class: + default: traefik examples: - - your-company + - traefik type: string + postgres: + default: + replicas: 1 + examples: + - replicas: 1 + properties: + replicas: + default: 1 + type: integer + type: object storage: default: postgres: @@ -33,16 +67,31 @@ options: type: string type: object type: object - domain_name: - default: your_company.com + sub-domain: + default: dataset-pg examples: - - your_company.com + - dataset-pg type: string issuer: default: letsencrypt-prod examples: - letsencrypt-prod type: string + domain_name: + default: your_company.com + examples: + - your_company.com + type: string + app_group: + default: api + examples: + - api + type: string + domain: + default: your-company + examples: + - your-company + type: string extentions: default: directus: @@ -224,6 +273,15 @@ options: type: object type: object type: object + databases: + default: [] + items: + properties: + name: + default: db + type: string + type: object + type: array roles: default: [] items: @@ -233,16 +291,6 @@ options: type: string type: object type: array - postgres: - default: - replicas: 1 - examples: - - replicas: 1 - properties: - replicas: - default: 1 - type: integer - type: object backups: default: enable: false @@ -297,54 +345,6 @@ options: default: backup-settings type: string type: object - 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 - sub-domain: - default: dataset-pg - examples: - - dataset-pg - type: string - databases: - default: [] - items: - properties: - name: - default: db - type: string - type: object - type: array - ingress_class: - default: traefik - examples: - - traefik - type: string dependencies: - dist: null category: dbo diff --git a/share/dataset-pg/roles.tf b/share/dataset-pg/roles.tf index dbf0657..63269cf 100644 --- a/share/dataset-pg/roles.tf +++ b/share/dataset-pg/roles.tf @@ -12,6 +12,7 @@ locals { } resource "kubectl_manifest" "db_secret_role" { + depends_on = [ data.kubernetes_secret_v1.postgresql_password ] ignore_fields = ["metadata.annotations"] count = length(local.sorted-roles) yaml_body = <<-EOF