fix
This commit is contained in:
@@ -14,19 +14,102 @@ locals {
|
|||||||
"backups" = var.backups
|
"backups" = var.backups
|
||||||
"app-group" = var.app-group
|
"app-group" = var.app-group
|
||||||
}
|
}
|
||||||
global-apps = merge(local.global, {"domain-name" = "devtools.${var.domain-name}"})
|
global-apps = merge(local.global, {
|
||||||
dev-ns = concat([
|
"domain-name" = "devtools.${var.domain-name}"
|
||||||
|
"app-group" = "dev"
|
||||||
|
})
|
||||||
|
okd = merge({
|
||||||
|
"namespaces" = concat([
|
||||||
for station in local.sorted-station-names: "${var.domain}-devspaces-${station}"
|
for station in local.sorted-station-names: "${var.domain}-devspaces-${station}"
|
||||||
],flatten([
|
],flatten([
|
||||||
for org in local.sorted-organisations:[
|
for org in local.sorted-organisations:[
|
||||||
for stage in reverse(distinct(sort([for s in org.stages: s.name]))): "${var.domain}-${org.name}-${stage}"
|
for stage in reverse(distinct(sort([for s in org.stages: s.name]))): "${var.domain}-${org.name}-${stage}"
|
||||||
]
|
]
|
||||||
]))
|
])
|
||||||
okd = merge({"namespaces" = local.dev-ns}, { for k, v in var.apps.okd : k => v if k!="enable" })
|
)
|
||||||
dbgate = { for k, v in var.apps.dbgate : k => v if k!="enable" }
|
}, { for k, v in var.apps.okd : k => v if k!="enable" })
|
||||||
# dbgate_pgs = flatten([for i in local.sorted-datasets: [
|
dbgate = merge({
|
||||||
# for db in
|
"pg" = concat(
|
||||||
# ] if i.engine=="pg" && i])
|
flatten([for ds in local.sorted-datasets: [for db in ds.databases: {
|
||||||
|
"name" = "${ds.name}-dataset-pg"
|
||||||
|
"namespace" = ds.namespace
|
||||||
|
"dbname" = db.name
|
||||||
|
"username" = db.name
|
||||||
|
"secret" = {
|
||||||
|
"name" = "${ds.name}-dataset-pg-${db.name}"
|
||||||
|
"key" = "POSGRESQL_PASSWORD"
|
||||||
|
}
|
||||||
|
}] if ds.engine=="pg" && length(i.databases)>0]),
|
||||||
|
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}"
|
||||||
|
"dbname" = db.name
|
||||||
|
"username" = db.name
|
||||||
|
"secret" = {
|
||||||
|
"name" = "${ds.name}-dataset-pg-${db.name}"
|
||||||
|
"key" = "POSGRESQL_PASSWORD"
|
||||||
|
}
|
||||||
|
] if ds.engine=="pg" && length(ds.databases)>0])])]),
|
||||||
|
var.external-pgs
|
||||||
|
)
|
||||||
|
"maria" = concat(
|
||||||
|
flatten([for ds in local.sorted-datasets: {
|
||||||
|
"name" = "${ds.name}-dataset-maria"
|
||||||
|
"namespace" = ds.namespace
|
||||||
|
"dbname" = ds.name
|
||||||
|
"username" = ds.name
|
||||||
|
"secret" = {
|
||||||
|
"name" = "${ds.name}-dataset-maria"
|
||||||
|
"key" = "password"
|
||||||
|
}
|
||||||
|
} if ds.engine=="maria"]),
|
||||||
|
flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: [for ds in org.datasets: {
|
||||||
|
"name" = "${ds.name}-dataset-maria"
|
||||||
|
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||||
|
"dbname" = ds.name
|
||||||
|
"username" = ds.name
|
||||||
|
"secret" = {
|
||||||
|
"name" = "${ds.name}-dataset-maria"
|
||||||
|
"key" = "password"
|
||||||
|
}
|
||||||
|
} if ds.engine=="maria"]])]),
|
||||||
|
var.external-marias
|
||||||
|
)
|
||||||
|
"mongo" = concat(
|
||||||
|
flatten([for ds in local.sorted-datasets: {
|
||||||
|
"name" = "${ds.name}-dataset-mongo"
|
||||||
|
"namespace" = ds.namespace
|
||||||
|
"dbname" = ds.name
|
||||||
|
"username" = ds.name
|
||||||
|
"secret" = {
|
||||||
|
"name" = "${ds.name}-dataset-mongo"
|
||||||
|
"key" = "password"
|
||||||
|
}
|
||||||
|
} if ds.engine=="mongo"]),
|
||||||
|
flatten([for org in local.sorted-organisations: flatten([for stage in org.stages: [for ds in org.datasets: {
|
||||||
|
"name" = "${ds.name}-dataset-mongo"
|
||||||
|
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||||
|
"dbname" = ds.name
|
||||||
|
"username" = ds.name
|
||||||
|
"secret" = {
|
||||||
|
"name" = "${ds.name}-dataset-mongo"
|
||||||
|
"key" = "password"
|
||||||
|
}
|
||||||
|
} if ds.engine=="mongo"]])]),
|
||||||
|
var.external-mongos
|
||||||
|
)
|
||||||
|
"redis" = concat(
|
||||||
|
flatten([for ds in local.sorted-datasets: {
|
||||||
|
"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: {
|
||||||
|
"name" = "${ds.name}-dataset-redis"
|
||||||
|
"namespace" = "${var.domain}-${org.name}-${stage.name}"
|
||||||
|
} if ds.engine=="redis"]])]),
|
||||||
|
var.external-redis
|
||||||
|
)
|
||||||
|
}, { for k, v in var.apps.dbgate : k => v if k!="enable" })
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "kubernetes_namespace_v1" "apps-ns" {
|
resource "kubernetes_namespace_v1" "apps-ns" {
|
||||||
|
|||||||
@@ -6,16 +6,94 @@ metadata:
|
|||||||
name: domain-devspaces
|
name: domain-devspaces
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
domain:
|
domain:
|
||||||
default: your-company
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
- your-company
|
- your-company
|
||||||
type: string
|
type: string
|
||||||
|
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
|
||||||
|
external-pgs:
|
||||||
|
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
|
||||||
|
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
|
||||||
backups:
|
backups:
|
||||||
default:
|
default:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -46,6 +124,11 @@ options:
|
|||||||
default: backup-settings
|
default: backup-settings
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
app-group:
|
||||||
|
default: dev
|
||||||
|
examples:
|
||||||
|
- dev
|
||||||
|
type: string
|
||||||
apps:
|
apps:
|
||||||
default:
|
default:
|
||||||
dbgate:
|
dbgate:
|
||||||
@@ -99,98 +182,64 @@ options:
|
|||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
stations-sub-domain:
|
issuer:
|
||||||
default: code
|
default: letsencrypt-prod
|
||||||
examples:
|
examples:
|
||||||
- code
|
- letsencrypt-prod
|
||||||
type: string
|
|
||||||
external-databases:
|
|
||||||
default: []
|
|
||||||
examples:
|
|
||||||
- []
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
engine:
|
|
||||||
default: postgres
|
|
||||||
enum:
|
|
||||||
- postgres
|
|
||||||
- mongo
|
|
||||||
- redis
|
|
||||||
- maria
|
|
||||||
- rabbit
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
namespace:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
secret:
|
|
||||||
default:
|
|
||||||
name: default
|
|
||||||
namespace: default
|
|
||||||
pass-key: password
|
|
||||||
user-key: username
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
default: default
|
|
||||||
type: string
|
|
||||||
namespace:
|
|
||||||
default: default
|
|
||||||
type: string
|
|
||||||
pass-key:
|
|
||||||
default: password
|
|
||||||
type: string
|
|
||||||
user-key:
|
|
||||||
default: username
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
app-group:
|
|
||||||
default: dev
|
|
||||||
examples:
|
|
||||||
- dev
|
|
||||||
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
|
|
||||||
stations:
|
|
||||||
default: []
|
|
||||||
examples:
|
|
||||||
- []
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
default: ''
|
|
||||||
type: string
|
type: string
|
||||||
organisations:
|
organisations:
|
||||||
default: []
|
default: []
|
||||||
|
examples:
|
||||||
|
- []
|
||||||
items:
|
items:
|
||||||
|
properties:
|
||||||
|
datasets:
|
||||||
|
default: []
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
databases:
|
||||||
|
default: []
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
default: db
|
||||||
type: string
|
type: string
|
||||||
|
type: object
|
||||||
type: array
|
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
|
||||||
|
external-redis:
|
||||||
|
default: []
|
||||||
|
examples:
|
||||||
|
- []
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
images:
|
images:
|
||||||
@@ -232,40 +281,50 @@ options:
|
|||||||
type: number
|
type: number
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
issuer:
|
external-marias:
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
|
||||||
organisations:
|
|
||||||
default: []
|
default: []
|
||||||
examples:
|
examples:
|
||||||
- []
|
- []
|
||||||
items:
|
items:
|
||||||
properties:
|
properties:
|
||||||
datasets:
|
name:
|
||||||
default: []
|
default: ''
|
||||||
items:
|
type: string
|
||||||
|
namespace:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
secret:
|
||||||
properties:
|
properties:
|
||||||
engine:
|
key:
|
||||||
default: pg
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
username:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
type: array
|
type: array
|
||||||
name:
|
domain-name:
|
||||||
default: ''
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
type: string
|
type: string
|
||||||
stages:
|
stations:
|
||||||
default: []
|
default: []
|
||||||
|
examples:
|
||||||
|
- []
|
||||||
items:
|
items:
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
default: prod
|
default: ''
|
||||||
|
type: string
|
||||||
|
organisations:
|
||||||
|
default: []
|
||||||
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
@@ -289,6 +348,11 @@ options:
|
|||||||
default: domain
|
default: domain
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
stations-sub-domain:
|
||||||
|
default: code
|
||||||
|
examples:
|
||||||
|
- code
|
||||||
|
type: string
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
|
|||||||
Reference in New Issue
Block a user