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