fix
This commit is contained in:
@@ -1,30 +1,86 @@
|
||||
locals {
|
||||
annotations = {
|
||||
"vynil.solidite.fr/meta" = "domain-ci"
|
||||
"vynil.solidite.fr/meta" = var.component
|
||||
"vynil.solidite.fr/name" = var.namespace
|
||||
"vynil.solidite.fr/domain" = var.domain_name
|
||||
"vynil.solidite.fr/issuer" = var.issuer
|
||||
"vynil.solidite.fr/ingress" = var.ingress_class
|
||||
}
|
||||
annotations_default = {
|
||||
"default.vynil.solidite.fr/sso_vynil" = var.sso_vynil
|
||||
"default.vynil.solidite.fr/domain_name" = var.domain_name
|
||||
"default.vynil.solidite.fr/timezone" = var.timezone
|
||||
"default.vynil.solidite.fr/language" = var.language
|
||||
"default.vynil.solidite.fr/domain" = var.domain
|
||||
"default.vynil.solidite.fr/issuer" = var.issuer
|
||||
"default.vynil.solidite.fr/ingress_class" = var.ingress_class
|
||||
"default.vynil.solidite.fr/app_group" = var.app_group
|
||||
"default.vynil.solidite.fr/backups.enable" = var.backups.enable
|
||||
"default.vynil.solidite.fr/backups.use_barman" = var.backups.use_barman
|
||||
"default.vynil.solidite.fr/backups.endpoint" = var.backups.endpoint
|
||||
"default.vynil.solidite.fr/backups.secret_name" = var.backups.secret_name
|
||||
"default.vynil.solidite.fr/backups.key_id_key" = var.backups.key_id_key
|
||||
"default.vynil.solidite.fr/backups.secret_key" = var.backups.secret_key
|
||||
"default.vynil.solidite.fr/backups.restic_key" = var.backups.restic_key
|
||||
"default.vynil.solidite.fr/storage.volume.accessMode" = var.storage.volume.accessMode
|
||||
"default.vynil.solidite.fr/storage.volume.class" = var.storage.volume.class
|
||||
}
|
||||
global = {
|
||||
"domain" = var.namespace
|
||||
"domain_name" = "admin.${var.domain_name}"
|
||||
"issuer" = var.issuer
|
||||
"ingress_class" = var.ingress_class
|
||||
"backups" = var.backups
|
||||
"app_group" = var.app_group
|
||||
"sso_vynil" = var.sso_vynil
|
||||
"domain_name" = var.domain_name
|
||||
"timezone" = var.timezone
|
||||
"language" = var.language
|
||||
"domain" = var.domain
|
||||
"issuer" = var.issuer
|
||||
"ingress_class" = var.ingress_class
|
||||
"app_group" = var.app_group
|
||||
}
|
||||
traefik = { for k, v in var.traefik : k => v if k!="enable" }
|
||||
dns = { for k, v in var.dns : k => v if k!="enable" }
|
||||
api = { for k, v in var.api : k => v if k!="enable" }
|
||||
okd = merge({"cluster-admin" = true}, { for k, v in var.okd : k => v if k!="enable" })
|
||||
gramo = merge({"cluster-admin" = true}, { for k, v in var.gramo : k => v if k!="enable" })
|
||||
global-backups = {
|
||||
"enable" = var.backups.enable
|
||||
"use_barman" = var.backups.use_barman
|
||||
"endpoint" = var.backups.endpoint
|
||||
"secret_name" = var.backups.secret_name
|
||||
"key_id_key" = var.backups.key_id_key
|
||||
"secret_key" = var.backups.secret_key
|
||||
"restic_key" = var.backups.restic_key
|
||||
}
|
||||
global-volume = {
|
||||
"accessMode" = var.storage.volume.accessMode
|
||||
"class" = var.storage.volume.class
|
||||
}
|
||||
traefik = merge(local.global,{ for k, v in var.traefik : k => v if !contains(["enable","storage","backups"],k) },{
|
||||
backups = merge(lookup(var.traefik, "backups", {}), local.global-backups)
|
||||
storage = merge({ for k, v in lookup(var.traefik, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||
volume = merge(lookup(lookup(var.traefik, "storage", {}), "volume", {}), local.global-volume)
|
||||
})
|
||||
})
|
||||
dns = merge(local.global,{ for k, v in var.dns : k => v if !contains(["enable","storage","backups"],k) },{
|
||||
backups = merge(lookup(var.dns, "backups", {}), local.global-backups)
|
||||
storage = merge({ for k, v in lookup(var.dns, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||
volume = merge(lookup(lookup(var.dns, "storage", {}), "volume", {}), local.global-volume)
|
||||
})
|
||||
})
|
||||
api = merge(local.global,{ for k, v in var.api : k => v if !contains(["enable","storage","backups"],k) },{
|
||||
backups = merge(lookup(var.api, "backups", {}), local.global-backups)
|
||||
storage = merge({ for k, v in lookup(var.api, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||
volume = merge(lookup(lookup(var.api, "storage", {}), "volume", {}), local.global-volume)
|
||||
})
|
||||
})
|
||||
okd = merge({"cluster-admin" = true}, local.global,{ for k, v in var.okd : k => v if !contains(["enable","storage","backups"],k) },{
|
||||
backups = merge(lookup(var.okd, "backups", {}), local.global-backups)
|
||||
storage = merge({ for k, v in lookup(var.okd, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||
volume = merge(lookup(lookup(var.okd, "storage", {}), "volume", {}), local.global-volume)
|
||||
})
|
||||
})
|
||||
gramo = merge({"cluster-admin" = true}, local.global,{ for k, v in var.gramo : k => v if !contains(["enable","storage","backups"],k) },{
|
||||
backups = merge(lookup(var.gramo, "backups", {}), local.global-backups)
|
||||
storage = merge({ for k, v in lookup(var.gramo, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||
volume = merge(lookup(lookup(var.gramo, "storage", {}), "volume", {}), local.global-volume)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
resource "kubernetes_namespace_v1" "infra-ns" {
|
||||
count = ( var.dns.enable || var.okd.enable || var.gramo.enable )? 1 : 0
|
||||
metadata {
|
||||
annotations = local.annotations
|
||||
annotations = merge(local.annotations, local.annotations_default)
|
||||
labels = merge(local.common-labels, local.annotations)
|
||||
name = "${var.namespace}-infra"
|
||||
}
|
||||
|
||||
@@ -6,6 +6,18 @@ metadata:
|
||||
name: domain-infra
|
||||
description: null
|
||||
options:
|
||||
dns:
|
||||
default:
|
||||
enable: false
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: share
|
||||
x-vynil-package: dns
|
||||
gramo:
|
||||
default:
|
||||
enable: false
|
||||
@@ -28,10 +40,10 @@ options:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
domain_name:
|
||||
default: your_company.com
|
||||
ingress_class:
|
||||
default: traefik
|
||||
examples:
|
||||
- your_company.com
|
||||
- traefik
|
||||
type: string
|
||||
distributions:
|
||||
default:
|
||||
@@ -48,6 +60,11 @@ options:
|
||||
default: domain
|
||||
type: string
|
||||
type: object
|
||||
domain_name:
|
||||
default: your-company.com
|
||||
examples:
|
||||
- your-company.com
|
||||
type: string
|
||||
traefik:
|
||||
default:
|
||||
enable: false
|
||||
@@ -65,18 +82,31 @@ options:
|
||||
type: object
|
||||
x-vynil-category: apps
|
||||
x-vynil-package: traefix-ui
|
||||
dns:
|
||||
default:
|
||||
enable: false
|
||||
app_group:
|
||||
default: infra
|
||||
examples:
|
||||
- enable: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
x-vynil-category: share
|
||||
x-vynil-package: dns
|
||||
- infra
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
timezone:
|
||||
default: Europe/Paris
|
||||
examples:
|
||||
- Europe/Paris
|
||||
type: string
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
language:
|
||||
default: fr_FR
|
||||
examples:
|
||||
- fr_FR
|
||||
type: string
|
||||
okd:
|
||||
default:
|
||||
enable: false
|
||||
@@ -89,24 +119,28 @@ options:
|
||||
type: object
|
||||
x-vynil-category: apps
|
||||
x-vynil-package: okd
|
||||
app_group:
|
||||
default: infra
|
||||
sso_vynil:
|
||||
default: true
|
||||
examples:
|
||||
- infra
|
||||
type: string
|
||||
- true
|
||||
type: boolean
|
||||
backups:
|
||||
default:
|
||||
enable: false
|
||||
endpoint: ''
|
||||
key-id-key: s3-id
|
||||
secret-key: s3-secret
|
||||
secret-name: backup-settings
|
||||
key_id_key: s3-id
|
||||
restic_key: bck-password
|
||||
secret_key: s3-secret
|
||||
secret_name: backup-settings
|
||||
use_barman: false
|
||||
examples:
|
||||
- enable: false
|
||||
endpoint: ''
|
||||
key-id-key: s3-id
|
||||
secret-key: s3-secret
|
||||
secret-name: backup-settings
|
||||
key_id_key: s3-id
|
||||
restic_key: bck-password
|
||||
secret_key: s3-secret
|
||||
secret_name: backup-settings
|
||||
use_barman: false
|
||||
properties:
|
||||
enable:
|
||||
default: false
|
||||
@@ -114,56 +148,45 @@ options:
|
||||
endpoint:
|
||||
default: ''
|
||||
type: string
|
||||
key-id-key:
|
||||
key_id_key:
|
||||
default: s3-id
|
||||
type: string
|
||||
secret-key:
|
||||
restic_key:
|
||||
default: bck-password
|
||||
type: string
|
||||
secret_key:
|
||||
default: s3-secret
|
||||
type: string
|
||||
secret-name:
|
||||
secret_name:
|
||||
default: backup-settings
|
||||
type: string
|
||||
use_barman:
|
||||
default: false
|
||||
type: boolean
|
||||
type: object
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
storage-classes:
|
||||
storage:
|
||||
default:
|
||||
BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
volume:
|
||||
accessMode: ReadWriteOnce
|
||||
class: ''
|
||||
examples:
|
||||
- BlockReadWriteMany: ''
|
||||
BlockReadWriteOnce: ''
|
||||
FilesystemReadWriteMany: ''
|
||||
FilesystemReadWriteOnce: ''
|
||||
- volume:
|
||||
accessMode: ReadWriteOnce
|
||||
class: ''
|
||||
properties:
|
||||
BlockReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
BlockReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteMany:
|
||||
default: ''
|
||||
type: string
|
||||
FilesystemReadWriteOnce:
|
||||
default: ''
|
||||
type: string
|
||||
volume:
|
||||
default:
|
||||
accessMode: ReadWriteOnce
|
||||
class: ''
|
||||
properties:
|
||||
accessMode:
|
||||
default: ReadWriteOnce
|
||||
type: string
|
||||
class:
|
||||
default: ''
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
ingress_class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
dependencies: []
|
||||
providers:
|
||||
kubernetes: true
|
||||
|
||||
Reference in New Issue
Block a user