fix
This commit is contained in:
@@ -1,17 +1,31 @@
|
||||
locals {
|
||||
# postgresqls = merge(flatten([
|
||||
# for pg in var.postgresql: {
|
||||
# join("_",["LABEL_pg", pg.namespace, pg.name]) = join("|",["pg", pg.namespace, pg.name])
|
||||
# join("_",["SERVER_pg", pg.namespace, pg.name]) = join("|",["pg", pg.namespace, pg.name])
|
||||
# join("_",["ENGINE_pg", pg.namespace, pg.name]) = join("|",["pg", pg.namespace, pg.name])
|
||||
# }
|
||||
# ]))
|
||||
//marias = []
|
||||
//mongos = []
|
||||
//connections = join(",",concat(local.postgresqls, local.marias))
|
||||
connections = ""
|
||||
datas = {}
|
||||
secrets = {}
|
||||
pg_vars = merge([for pg in var.pg: {
|
||||
join("_",["LABEL_pg", pg.namespace, pg.name, pg.dbname]) = join("|",["pg", pg.namespace, pg.name, pg.dbname])
|
||||
join("_",["ENGINE_pg", pg.namespace, pg.name, pg.dbname]) = "postgres@dbgate-plugin-postgres"
|
||||
join("_",["SERVER_pg", pg.namespace, pg.name, pg.dbname]) = join(".",[pg.name, pg.namespace, "svc"])
|
||||
join("_",["PORT_pg", pg.namespace, pg.name, pg.dbname]) = "5432"
|
||||
join("_",["USER_pg", pg.namespace, pg.name, pg.dbname]) = pg.username
|
||||
}]...)
|
||||
pg_secrets = merge([for pg in var.pg: {
|
||||
join("_",["PASSWORD_pg", pg.namespace, pg.name, pg.dbname]) = join("|",["pg", pg.namespace, pg.name, pg.dbname])
|
||||
}]...)
|
||||
pg_conns = [for pg in var.pg: join("_",["pg", pg.namespace, pg.name, pg.dbname])]
|
||||
|
||||
maria_vars = merge([for m in var.maria: {
|
||||
join("_",["LABEL_maria", m.namespace, m.name]) = join("|",["maria", m.namespace, pg.name])
|
||||
join("_",["ENGINE_maria", m.namespace, m.name]) = "mysql@dbgate-plugin-mysql"
|
||||
join("_",["SERVER_maria", m.namespace, m.name]) = join(".",[m.name, m.namespace, "svc"])
|
||||
join("_",["PORT_maria", m.namespace, m.name]) = "3306"
|
||||
join("_",["USER_maria", m.namespace, m.name]) = m.username
|
||||
}]...)
|
||||
maria_secrets = merge([for m in var.maria: {
|
||||
join("_",["PASSWORD_maria", m.namespace, m.name]) = join("|",["maria", m.namespace, m.name, m.dbname])
|
||||
}]...)
|
||||
maria_conns = [for m in var.maria: join("_",["maria", m.namespace, m.name])]
|
||||
|
||||
connections = join(",",concat(local.pg_conns, local.maria_conns))
|
||||
connection_vars = merge(local.pg_vars, local.)
|
||||
connection_secrets = merge(local.pg_secrets)
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "dbgate-config" {
|
||||
@@ -22,7 +36,7 @@ resource "kubectl_manifest" "dbgate-config" {
|
||||
name: "${var.component}-${var.instance}"
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.common-labels)}
|
||||
data: ${jsonencode(local.datas)}
|
||||
data: ${jsonencode(local.connection_vars)}
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -31,5 +45,5 @@ resource "kubernetes_secret_v1" "dbgate-config-secret" {
|
||||
name = "${var.component}-${var.instance}"
|
||||
namespace = var.namespace
|
||||
}
|
||||
data = local.secrets
|
||||
data = local.connection_secrets
|
||||
}
|
||||
|
||||
@@ -11,92 +11,199 @@ options:
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
images:
|
||||
default:
|
||||
dbgate:
|
||||
pullPolicy: IfNotPresent
|
||||
registry: docker.io
|
||||
repository: dbgate/dbgate
|
||||
tag: 5.2.6-alpine
|
||||
examples:
|
||||
- dbgate:
|
||||
pullPolicy: IfNotPresent
|
||||
registry: docker.io
|
||||
repository: dbgate/dbgate
|
||||
tag: 5.2.6-alpine
|
||||
properties:
|
||||
dbgate:
|
||||
default:
|
||||
pullPolicy: IfNotPresent
|
||||
registry: docker.io
|
||||
repository: dbgate/dbgate
|
||||
tag: 5.2.6-alpine
|
||||
properties:
|
||||
pullPolicy:
|
||||
default: IfNotPresent
|
||||
enum:
|
||||
- Always
|
||||
- Never
|
||||
- IfNotPresent
|
||||
type: string
|
||||
registry:
|
||||
default: docker.io
|
||||
type: string
|
||||
repository:
|
||||
default: dbgate/dbgate
|
||||
type: string
|
||||
tag:
|
||||
default: 5.2.6-alpine
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
app-group:
|
||||
default: dev
|
||||
examples:
|
||||
- dev
|
||||
type: string
|
||||
storage:
|
||||
default:
|
||||
size: 1Gi
|
||||
accessMode: ReadWriteOnce
|
||||
type: Filesystem
|
||||
properties:
|
||||
type:
|
||||
enum:
|
||||
- Filesystem
|
||||
- Block
|
||||
type: string
|
||||
default: Filesystem
|
||||
accessMode:
|
||||
enum:
|
||||
- ReadWriteOnce
|
||||
- ReadOnlyMany
|
||||
- ReadWriteMany
|
||||
type: string
|
||||
default: ReadWriteOnce
|
||||
size:
|
||||
type: string
|
||||
default: 1Gi
|
||||
examples:
|
||||
- size: 1Gi
|
||||
accessMode: ReadWriteOnce
|
||||
type: Filesystem
|
||||
type: object
|
||||
mongo:
|
||||
default: []
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
namespace:
|
||||
type: string
|
||||
default: ''
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
dbname:
|
||||
type: string
|
||||
default: ''
|
||||
username:
|
||||
type: string
|
||||
default: ''
|
||||
secret:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
key:
|
||||
type: string
|
||||
default: ''
|
||||
examples:
|
||||
- []
|
||||
type: array
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
redis:
|
||||
default: []
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
namespace:
|
||||
type: string
|
||||
default: ''
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
secret:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
key:
|
||||
type: string
|
||||
default: ''
|
||||
examples:
|
||||
- []
|
||||
type: array
|
||||
pg:
|
||||
default: []
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
namespace:
|
||||
type: string
|
||||
default: ''
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
dbname:
|
||||
type: string
|
||||
default: ''
|
||||
username:
|
||||
type: string
|
||||
default: ''
|
||||
secret:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
key:
|
||||
type: string
|
||||
default: ''
|
||||
examples:
|
||||
- []
|
||||
type: array
|
||||
sub-domain:
|
||||
default: dbgate
|
||||
examples:
|
||||
- dbgate
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
sub-domain:
|
||||
default: dbgate
|
||||
examples:
|
||||
- dbgate
|
||||
type: string
|
||||
storage:
|
||||
images:
|
||||
default:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 1Gi
|
||||
type: Filesystem
|
||||
examples:
|
||||
- accessMode: ReadWriteOnce
|
||||
size: 1Gi
|
||||
type: Filesystem
|
||||
dbgate:
|
||||
registry: docker.io
|
||||
repository: dbgate/dbgate
|
||||
tag: 5.2.6-alpine
|
||||
pullPolicy: IfNotPresent
|
||||
properties:
|
||||
accessMode:
|
||||
default: ReadWriteOnce
|
||||
dbgate:
|
||||
properties:
|
||||
pullPolicy:
|
||||
enum:
|
||||
- ReadWriteOnce
|
||||
- ReadOnlyMany
|
||||
- ReadWriteMany
|
||||
- Always
|
||||
- Never
|
||||
- IfNotPresent
|
||||
type: string
|
||||
size:
|
||||
default: 1Gi
|
||||
default: IfNotPresent
|
||||
registry:
|
||||
type: string
|
||||
type:
|
||||
default: Filesystem
|
||||
enum:
|
||||
- Filesystem
|
||||
- Block
|
||||
default: docker.io
|
||||
repository:
|
||||
type: string
|
||||
default: dbgate/dbgate
|
||||
tag:
|
||||
type: string
|
||||
default: 5.2.6-alpine
|
||||
type: object
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
default:
|
||||
registry: docker.io
|
||||
repository: dbgate/dbgate
|
||||
tag: 5.2.6-alpine
|
||||
pullPolicy: IfNotPresent
|
||||
examples:
|
||||
- your_company.com
|
||||
- dbgate:
|
||||
registry: docker.io
|
||||
repository: dbgate/dbgate
|
||||
tag: 5.2.6-alpine
|
||||
pullPolicy: IfNotPresent
|
||||
type: object
|
||||
maria:
|
||||
default: []
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
namespace:
|
||||
type: string
|
||||
default: ''
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
username:
|
||||
type: string
|
||||
default: ''
|
||||
secret:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
default: ''
|
||||
key:
|
||||
type: string
|
||||
default: ''
|
||||
examples:
|
||||
- []
|
||||
type: array
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
|
||||
Reference in New Issue
Block a user