diff --git a/apps/dbgate/configs.tf b/apps/dbgate/configs.tf index bd5adac..9629f20 100644 --- a/apps/dbgate/configs.tf +++ b/apps/dbgate/configs.tf @@ -32,7 +32,7 @@ locals { join("_",["PORT_redis", m.namespace, m.name]) = "6379" }]...) redis-privs = [for m in var.redis: merge({secret = lookup(m,"secret",{})},m) if contains(keys(m),"secret")] - redis_secrets = merge([for index, m in var.redis-privs: { + redis_secrets = merge([for index, m in local.redis-privs: { join("_",["PASSWORD_redis", m.namespace, m.name]) = data.kubernetes_secret_v1.redis[index].data[lookup(m.secret,"key", "password")] }]...) redis_conns = [for m in var.redis: join("_",["redis", m.namespace, m.name])] @@ -95,9 +95,9 @@ data "kubernetes_secret_v1" "mongos" { } } data "kubernetes_secret_v1" "redis" { - count = length(var.redis-privs) + count = length(local.redis-privs) metadata { - name = "${lookup(var.redis-privs[count.index].secret, "name", var.redis-privs[count.index].name)}" - namespace = "${var.redis-privs[count.index].namespace}" + name = "${lookup(local.redis-privs[count.index].secret, "name", local.redis-privs[count.index].name)}" + namespace = "${local.redis-privs[count.index].namespace}" } } diff --git a/apps/dbgate/index.yaml b/apps/dbgate/index.yaml index ec3d9f2..d7308c0 100644 --- a/apps/dbgate/index.yaml +++ b/apps/dbgate/index.yaml @@ -6,108 +6,25 @@ metadata: name: dbgate description: null options: - ingress-class: - default: traefik - examples: - - traefik - type: string - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - pg: + redis: default: [] examples: - [] items: properties: - dbname: - default: '' - type: string name: default: '' type: string namespace: default: '' type: string - secret: - properties: - key: - default: '' - type: string - name: - default: '' - type: string - type: object - username: - default: '' - type: string type: object type: array - issuer: - default: letsencrypt-prod + app-group: + default: dev examples: - - letsencrypt-prod + - dev type: string - mongo: - default: [] - examples: - - [] - items: - properties: - dbname: - default: '' - type: string - name: - default: '' - type: string - namespace: - default: '' - type: string - secret: - properties: - key: - default: '' - type: string - name: - default: '' - type: string - type: object - username: - default: '' - type: string - type: object - type: array - maria: - default: [] - examples: - - [] - items: - properties: - dbname: - default: '' - type: string - name: - default: '' - type: string - namespace: - default: '' - type: string - secret: - properties: - key: - default: '' - type: string - name: - default: '' - type: string - type: object - username: - default: '' - type: string - type: object - type: array images: default: dbgate: @@ -152,20 +69,78 @@ options: examples: - dbgate type: string - use-oauth: - default: false + domain-name: + default: your_company.com examples: - - false - type: boolean + - your_company.com + type: string domain: default: your-company examples: - your-company type: string - app-group: - default: dev + maria: + default: [] examples: - - dev + - [] + items: + properties: + dbname: + default: '' + type: string + name: + default: '' + type: string + namespace: + default: '' + type: string + secret: + properties: + key: + default: '' + type: string + name: + default: '' + type: string + type: object + username: + default: '' + type: string + type: object + type: array + mongo: + default: [] + examples: + - [] + items: + properties: + dbname: + default: '' + type: string + name: + default: '' + type: string + namespace: + default: '' + type: string + secret: + properties: + key: + default: '' + type: string + name: + default: '' + type: string + type: object + username: + default: '' + type: string + type: object + type: array + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod type: string storage: default: @@ -194,18 +169,43 @@ options: - Block type: string type: object - redis: + ingress-class: + default: traefik + examples: + - traefik + type: string + use-oauth: + default: false + examples: + - false + type: boolean + pg: default: [] examples: - [] items: properties: + dbname: + default: '' + type: string name: default: '' type: string namespace: default: '' type: string + secret: + properties: + key: + default: '' + type: string + name: + default: '' + type: string + type: object + username: + default: '' + type: string type: object type: array dependencies: