fix
This commit is contained in:
@@ -23,14 +23,14 @@ locals {
|
||||
for station in local.sorted-station-names: "${var.domain}-devspaces-${station}"
|
||||
],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 stage in reverse(distinct(sort([for s in lookup(org, "stages", []): s.name]))): "${var.domain}-${org.name}-${stage}"
|
||||
]
|
||||
])
|
||||
)
|
||||
}, { for k, v in var.apps.okd : k => v if k!="enable" })
|
||||
dbgate = merge({
|
||||
"pg" = concat(
|
||||
flatten([for ds in local.sorted-datasets: [for db in ds.databases: {
|
||||
flatten([for ds in local.sorted-datasets: [for db in lookup(ds, "databases", []): {
|
||||
"name" = "${ds.name}-dataset-pg"
|
||||
"namespace" = ds.namespace
|
||||
"dbname" = db.name
|
||||
@@ -39,8 +39,8 @@ locals {
|
||||
"name" = "${ds.name}-dataset-pg-${db.name}"
|
||||
"key" = "POSGRESQL_PASSWORD"
|
||||
}
|
||||
}] 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:{
|
||||
}] if ds.engine=="pg"]),
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in lookup(org, "stages", []): flatten([for ds in org.datasets: [for db in lookup(ds, "databases", []):{
|
||||
"name" = "${ds.name}-dataset-pg"
|
||||
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||
"dbname" = db.name
|
||||
@@ -49,7 +49,7 @@ locals {
|
||||
"name" = "${ds.name}-dataset-pg-${db.name}"
|
||||
"key" = "POSGRESQL_PASSWORD"
|
||||
}
|
||||
}] if ds.engine=="pg" && ds.databases != null])]) if org.stages != null ]),
|
||||
}] if ds.engine=="pg"])])]),
|
||||
var.external-pgs
|
||||
)
|
||||
"maria" = concat(
|
||||
@@ -63,7 +63,7 @@ locals {
|
||||
"key" = "password"
|
||||
}
|
||||
} if ds.engine=="maria"]),
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: [for ds in org.datasets: {
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in lookup(org, "stages", []): [for ds in org.datasets: {
|
||||
"name" = "${ds.name}-dataset-maria"
|
||||
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||
"dbname" = ds.name
|
||||
@@ -72,7 +72,7 @@ locals {
|
||||
"name" = "${ds.name}-dataset-maria"
|
||||
"key" = "password"
|
||||
}
|
||||
} if ds.engine=="maria"]]) if org.stages != null]),
|
||||
} if ds.engine=="maria"]])]),
|
||||
var.external-marias
|
||||
)
|
||||
"mongo" = concat(
|
||||
@@ -86,7 +86,7 @@ locals {
|
||||
"key" = "password"
|
||||
}
|
||||
} if ds.engine=="mongo"]),
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: [for ds in org.datasets: {
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in lookup(org, "stages", []): [for ds in org.datasets: {
|
||||
"name" = "${ds.name}-dataset-mongo"
|
||||
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||
"dbname" = ds.name
|
||||
@@ -95,7 +95,7 @@ locals {
|
||||
"name" = "${ds.name}-dataset-mongo"
|
||||
"key" = "password"
|
||||
}
|
||||
} if ds.engine=="mongo"]]) if org.stages != null]),
|
||||
} if ds.engine=="mongo"]])]),
|
||||
var.external-mongos
|
||||
)
|
||||
"redis" = concat(
|
||||
@@ -103,10 +103,10 @@ locals {
|
||||
"name" = "${ds.name}-dataset-redis"
|
||||
"namespace" = ds.namespace
|
||||
} if ds.engine=="redis"]),
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: [for ds in org.datasets: {
|
||||
flatten([for org in local.sorted-organisations: flatten([for stage in lookup(org, "stages", []): [for ds in org.datasets: {
|
||||
"name" = "${ds.name}-dataset-redis"
|
||||
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||
} if ds.engine=="redis"]]) if org.stages != null]),
|
||||
} if ds.engine=="redis"]])]),
|
||||
var.external-redis
|
||||
)
|
||||
}, { for k, v in var.apps.dbgate : k => v if k!="enable" })
|
||||
|
||||
@@ -6,96 +6,47 @@ metadata:
|
||||
name: domain-devspaces
|
||||
description: null
|
||||
options:
|
||||
storage-classes:
|
||||
default:
|
||||
BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
organisations:
|
||||
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
|
||||
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
|
||||
endpoint: ''
|
||||
key-id-key: s3-id
|
||||
secret-key: s3-secret
|
||||
secret-name: backup-settings
|
||||
examples:
|
||||
- enable: false
|
||||
endpoint: ''
|
||||
key-id-key: s3-id
|
||||
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
|
||||
secret-key:
|
||||
default: s3-secret
|
||||
type: string
|
||||
secret-name:
|
||||
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
|
||||
- []
|
||||
items:
|
||||
properties:
|
||||
datasets:
|
||||
default: []
|
||||
items:
|
||||
properties:
|
||||
databases:
|
||||
default: []
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
default: db
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
engine:
|
||||
default: pg
|
||||
type: string
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
stages:
|
||||
default: []
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
default: prod
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: array
|
||||
images:
|
||||
default:
|
||||
codeserver:
|
||||
@@ -140,12 +91,15 @@ options:
|
||||
examples:
|
||||
- code
|
||||
type: string
|
||||
external-marias:
|
||||
external-pgs:
|
||||
default: []
|
||||
examples:
|
||||
- []
|
||||
items:
|
||||
properties:
|
||||
dbname:
|
||||
default: ''
|
||||
type: string
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
@@ -166,6 +120,36 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
backups:
|
||||
default:
|
||||
enable: false
|
||||
endpoint: ''
|
||||
key-id-key: s3-id
|
||||
secret-key: s3-secret
|
||||
secret-name: backup-settings
|
||||
examples:
|
||||
- enable: false
|
||||
endpoint: ''
|
||||
key-id-key: s3-id
|
||||
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
|
||||
secret-key:
|
||||
default: s3-secret
|
||||
type: string
|
||||
secret-name:
|
||||
default: backup-settings
|
||||
type: string
|
||||
type: object
|
||||
apps:
|
||||
default:
|
||||
dbgate:
|
||||
@@ -219,25 +203,31 @@ options:
|
||||
type: boolean
|
||||
type: object
|
||||
type: object
|
||||
external-redis:
|
||||
default: []
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- []
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
namespace:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
- your_company.com
|
||||
type: string
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
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
|
||||
stations:
|
||||
default: []
|
||||
examples:
|
||||
@@ -254,76 +244,11 @@ options:
|
||||
type: array
|
||||
type: object
|
||||
type: array
|
||||
external-pgs:
|
||||
default: []
|
||||
domain:
|
||||
default: your-company
|
||||
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
|
||||
organisations:
|
||||
default: []
|
||||
examples:
|
||||
- []
|
||||
items:
|
||||
properties:
|
||||
datasets:
|
||||
default: []
|
||||
items:
|
||||
properties:
|
||||
databases:
|
||||
default: []
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
default: db
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
engine:
|
||||
default: pg
|
||||
type: string
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
stages:
|
||||
default: []
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
default: prod
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
type: array
|
||||
- your-company
|
||||
type: string
|
||||
external-mongos:
|
||||
default: []
|
||||
examples:
|
||||
@@ -353,6 +278,81 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
app-group:
|
||||
default: dev
|
||||
examples:
|
||||
- dev
|
||||
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
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
storage-classes:
|
||||
default:
|
||||
BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
examples:
|
||||
- BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
properties:
|
||||
BlockReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
BlockReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
external-redis:
|
||||
default: []
|
||||
examples:
|
||||
- []
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
default: ''
|
||||
type: string
|
||||
namespace:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
dependencies: []
|
||||
providers:
|
||||
kubernetes: true
|
||||
|
||||
@@ -2,7 +2,10 @@ locals {
|
||||
sorted-organisation-names = reverse(distinct(sort([for org in var.organisations: org.name])))
|
||||
sorted-organisations = flatten([
|
||||
for name in local.sorted-organisation-names: [
|
||||
for org in var.organisations: org if org.name == name
|
||||
for org in var.organisations: merge({
|
||||
"stages" = []
|
||||
"datasets" = []
|
||||
}, org) if org.name == name
|
||||
]
|
||||
])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user