From f26d17fe79aa4f504c8d1ffa3aec196bdff1a05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Sun, 15 Oct 2023 13:33:55 +0200 Subject: [PATCH] fix --- meta/domain-devspaces/apps.tf | 12 +- meta/domain-devspaces/index.yaml | 332 ++++++++++++------------- meta/domain-devspaces/organisations.tf | 1 + 3 files changed, 173 insertions(+), 172 deletions(-) diff --git a/meta/domain-devspaces/apps.tf b/meta/domain-devspaces/apps.tf index 18a4c6b..12083b8 100644 --- a/meta/domain-devspaces/apps.tf +++ b/meta/domain-devspaces/apps.tf @@ -24,7 +24,7 @@ locals { ],flatten([ for org in local.sorted-organisations:[ for stage in reverse(distinct(sort([for s in org.stages: s.name]))): "${var.domain}-${org.name}-${stage}" - ] + ] if org.stages != null ]) ) }, { for k, v in var.apps.okd : k => v if k!="enable" }) @@ -39,7 +39,7 @@ locals { "name" = "${ds.name}-dataset-pg-${db.name}" "key" = "POSGRESQL_PASSWORD" } - }] if ds.engine=="pg" && length(ds.databases)>0]), + }] if ds.engine=="pg" && ds.databases != null]), flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: flatten([for ds in org.datasets: [for db in ds.databases:{ "name" = "${ds.name}-dataset-pg" "namespace" = "${var.domain}-${org.name}-${stage.name}" @@ -49,7 +49,7 @@ locals { "name" = "${ds.name}-dataset-pg-${db.name}" "key" = "POSGRESQL_PASSWORD" } - }] if ds.engine=="pg" && length(ds.databases)>0])])]), + }] if ds.engine=="pg" && ds.databases != null])]) if org.stages != null ]), var.external-pgs ) "maria" = concat( @@ -72,7 +72,7 @@ locals { "name" = "${ds.name}-dataset-maria" "key" = "password" } - } if ds.engine=="maria"]])]), + } if ds.engine=="maria"]]) if org.stages != null]), var.external-marias ) "mongo" = concat( @@ -95,7 +95,7 @@ locals { "name" = "${ds.name}-dataset-mongo" "key" = "password" } - } if ds.engine=="mongo"]])]), + } if ds.engine=="mongo"]]) if org.stages != null]), var.external-mongos ) "redis" = concat( @@ -106,7 +106,7 @@ locals { flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: [for ds in org.datasets: { "name" = "${ds.name}-dataset-redis" "namespace" = "${var.domain}-${org.name}-${stage.name}" - } if ds.engine=="redis"]])]), + } if ds.engine=="redis"]]) if org.stages != null]), var.external-redis ) }, { for k, v in var.apps.dbgate : k => v if k!="enable" }) diff --git a/meta/domain-devspaces/index.yaml b/meta/domain-devspaces/index.yaml index 97bc74e..10e08f6 100644 --- a/meta/domain-devspaces/index.yaml +++ b/meta/domain-devspaces/index.yaml @@ -6,16 +6,46 @@ metadata: name: domain-devspaces description: null options: - ingress-class: - default: traefik + storage-classes: + default: + BlockReadWriteMany: '' + BlockReadWriteOnce: '' + FilesystemReadWriteMany: '' + FilesystemReadWriteOnce: '' examples: - - traefik - type: string + - BlockReadWriteMany: '' + BlockReadWriteOnce: '' + FilesystemReadWriteMany: '' + FilesystemReadWriteOnce: '' + properties: + BlockReadWriteMany: + default: '' + type: string + BlockReadWriteOnce: + default: '' + type: string + FilesystemReadWriteMany: + default: '' + type: string + FilesystemReadWriteOnce: + default: '' + type: string + type: object app-group: default: dev examples: - dev type: string + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + domain: + default: your-company + examples: + - your-company + type: string backups: default: enable: false @@ -46,11 +76,96 @@ options: default: backup-settings type: string type: object + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod + type: string + distributions: + default: + core: core + domain: domain + examples: + - core: core + domain: domain + properties: + core: + default: core + type: string + domain: + default: domain + type: string + type: object + images: + default: + codeserver: + pullPolicy: IfNotPresent + registry: docker.io + repository: sebt3/code-server + tag: 4.15 + examples: + - codeserver: + pullPolicy: IfNotPresent + registry: docker.io + repository: sebt3/code-server + tag: 4.15 + properties: + codeserver: + default: + pullPolicy: IfNotPresent + registry: docker.io + repository: sebt3/code-server + tag: 4.15 + properties: + pullPolicy: + default: IfNotPresent + enum: + - Always + - Never + - IfNotPresent + type: string + registry: + default: docker.io + type: string + repository: + default: sebt3/code-server + type: string + tag: + default: 4.15 + type: number + type: object + type: object stations-sub-domain: default: code examples: - code type: string + external-marias: + default: [] + examples: + - [] + items: + properties: + 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 apps: default: dbgate: @@ -104,119 +219,41 @@ options: type: boolean type: object type: object - external-mongos: + external-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 - distributions: - default: - core: core - domain: domain + ingress-class: + default: traefik examples: - - core: core - domain: domain - properties: - core: - default: core - type: string - domain: - default: domain - type: string - type: object - domain-name: - default: your_company.com - examples: - - your_company.com + - traefik type: string - storage-classes: - default: - BlockReadWriteMany: '' - BlockReadWriteOnce: '' - FilesystemReadWriteMany: '' - FilesystemReadWriteOnce: '' + stations: + default: [] examples: - - BlockReadWriteMany: '' - BlockReadWriteOnce: '' - FilesystemReadWriteMany: '' - FilesystemReadWriteOnce: '' - properties: - BlockReadWriteMany: - default: '' - type: string - BlockReadWriteOnce: - default: '' - type: string - FilesystemReadWriteMany: - default: '' - type: string - FilesystemReadWriteOnce: - default: '' - type: string - type: object - images: - default: - codeserver: - pullPolicy: IfNotPresent - registry: docker.io - repository: sebt3/code-server - tag: 4.15 - examples: - - codeserver: - pullPolicy: IfNotPresent - registry: docker.io - repository: sebt3/code-server - tag: 4.15 - properties: - codeserver: - default: - pullPolicy: IfNotPresent - registry: docker.io - repository: sebt3/code-server - tag: 4.15 - properties: - pullPolicy: - default: IfNotPresent - enum: - - Always - - Never - - IfNotPresent + - [] + items: + properties: + name: + default: '' + type: string + organisations: + default: [] + items: type: string - registry: - default: docker.io - type: string - repository: - default: sebt3/code-server - type: string - tag: - default: 4.15 - type: number - type: object - type: object + type: array + type: object + type: array external-pgs: default: [] examples: @@ -246,72 +283,6 @@ options: type: string type: object type: array - stations: - default: [] - examples: - - [] - items: - properties: - name: - default: '' - type: string - organisations: - default: [] - items: - type: string - type: array - type: object - type: array - external-marias: - default: [] - examples: - - [] - items: - properties: - 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 - domain: - default: your-company - examples: - - your-company - type: string - external-redis: - default: [] - examples: - - [] - items: - properties: - name: - default: '' - type: string - namespace: - default: '' - type: string - type: object - type: array - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string organisations: default: [] examples: @@ -353,6 +324,35 @@ options: type: array type: object type: array + external-mongos: + 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: [] providers: kubernetes: true diff --git a/meta/domain-devspaces/organisations.tf b/meta/domain-devspaces/organisations.tf index e74e4d6..aa39af5 100644 --- a/meta/domain-devspaces/organisations.tf +++ b/meta/domain-devspaces/organisations.tf @@ -22,6 +22,7 @@ resource "kubectl_manifest" "organisations" { component: "organisation" options: ${jsonencode(merge( local.global, + { "stages" = []}, { for k, v in local.sorted-organisations[count.index] : k => v if !contains(["name","organisations"], k) } ))} EOF