fix
This commit is contained in:
@@ -1,32 +1,62 @@
|
|||||||
locals {
|
locals {
|
||||||
annotations = {
|
annotations = {
|
||||||
"vynil.solidite.fr/meta" = var.component
|
"vynil.solidite.fr/meta" = var.component
|
||||||
"vynil.solidite.fr/name" = "${var.namespace}-auth"
|
"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" = 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
|
||||||
|
"issuer" = var.issuer
|
||||||
|
"ingress_class" = var.ingress_class
|
||||||
|
"app_group" = var.app_group
|
||||||
}
|
}
|
||||||
default-mode = var.storage-classes.FilesystemReadWriteMany!=""?"ReadWriteMany":"ReadWriteOnce"
|
global-backups = {
|
||||||
nextcloud = { for k, v in var.nextcloud : k => v if contains(["enable"],k) }
|
"enable" = var.backups.enable
|
||||||
nextcloud-storage = {
|
"use_barman" = var.backups.use_barman
|
||||||
"storage" = {
|
"endpoint" = var.backups.endpoint
|
||||||
"size" = lookup(lookup(local.nextcloud, "storage",{}), "size", "10Gi")
|
"secret_name" = var.backups.secret_name
|
||||||
"accessMode" = lookup(lookup(local.nextcloud, "storage",{}), "accessMode", local.default-mode)
|
"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
|
||||||
|
}
|
||||||
|
nextcloud = merge(local.global,{ for k, v in var.nextcloud : k => v if !contains(["enable","storage","backups"],k) },{
|
||||||
|
backups = merge(lookup(var.nextcloud, "backups", {}), local.global-backups)
|
||||||
|
storage = merge({ for k, v in lookup(var.nextcloud, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||||
|
volume = merge(lookup(lookup(var.nextcloud, "storage", {}), "volume", {}), local.global-volume)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "kubernetes_namespace_v1" "files-ns" {
|
resource "kubernetes_namespace_v1" "files-ns" {
|
||||||
count = var.nextcloud.enable ? 1 : 0
|
count = var.nextcloud.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}-files"
|
name = "${var.namespace}-files"
|
||||||
}
|
}
|
||||||
@@ -46,6 +76,6 @@ resource "kubectl_manifest" "nextcloud" {
|
|||||||
distrib: "${var.distributions.domain}"
|
distrib: "${var.distributions.domain}"
|
||||||
category: "apps"
|
category: "apps"
|
||||||
component: "nextcloud"
|
component: "nextcloud"
|
||||||
options: ${jsonencode(merge(local.global, local.nextcloud-storage, local.nextcloud))}
|
options: ${jsonencode(local.nextcloud)}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,41 +6,64 @@ metadata:
|
|||||||
name: domain-apps
|
name: domain-apps
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
storage-classes:
|
sso_vynil:
|
||||||
|
default: true
|
||||||
|
examples:
|
||||||
|
- true
|
||||||
|
type: boolean
|
||||||
|
storage:
|
||||||
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
|
||||||
domain_name:
|
issuer:
|
||||||
default: your_company.com
|
default: letsencrypt-prod
|
||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
|
domain:
|
||||||
|
default: your-company
|
||||||
|
examples:
|
||||||
|
- your-company
|
||||||
type: string
|
type: string
|
||||||
ingress_class:
|
ingress_class:
|
||||||
default: traefik
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
|
app_group:
|
||||||
|
default: infra
|
||||||
|
examples:
|
||||||
|
- infra
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
default: Europe/Paris
|
||||||
|
examples:
|
||||||
|
- Europe/Paris
|
||||||
|
type: string
|
||||||
|
language:
|
||||||
|
default: fr_FR
|
||||||
|
examples:
|
||||||
|
- fr_FR
|
||||||
|
type: string
|
||||||
distributions:
|
distributions:
|
||||||
default:
|
default:
|
||||||
core: core
|
core: core
|
||||||
@@ -56,6 +79,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
|
||||||
nextcloud:
|
nextcloud:
|
||||||
default:
|
default:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -72,15 +100,19 @@ options:
|
|||||||
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
|
||||||
@@ -88,26 +120,22 @@ 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
|
||||||
domain:
|
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
issuer:
|
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
|
|||||||
@@ -2,24 +2,61 @@ locals {
|
|||||||
annotations = {
|
annotations = {
|
||||||
"vynil.solidite.fr/meta" = var.component
|
"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" = 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
|
||||||
|
"issuer" = var.issuer
|
||||||
|
"ingress_class" = var.ingress_class
|
||||||
|
"app_group" = var.app_group
|
||||||
}
|
}
|
||||||
wildduck = { for k, v in var.wildduck : 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
|
||||||
|
}
|
||||||
|
wildduck = merge(local.global,{ for k, v in var.wildduck : k => v if !contains(["enable","storage","backups"],k) },{
|
||||||
|
backups = merge(lookup(var.wildduck, "backups", {}), local.global-backups)
|
||||||
|
storage = merge({ for k, v in lookup(var.wildduck, "storage", {}) : k => v if !contains(["volume"],k) }, {
|
||||||
|
volume = merge(lookup(lookup(var.wildduck, "storage", {}), "volume", {}), local.global-volume)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "kubernetes_namespace_v1" "mail-ns" {
|
resource "kubernetes_namespace_v1" "mail-ns" {
|
||||||
count = ( var.wildduck.enable )? 1 : 0
|
count = ( var.wildduck.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}-mail"
|
name = "${var.namespace}-mail"
|
||||||
}
|
}
|
||||||
@@ -39,6 +76,6 @@ resource "kubectl_manifest" "wildduck" {
|
|||||||
distrib: "${var.distributions.domain}"
|
distrib: "${var.distributions.domain}"
|
||||||
category: "share"
|
category: "share"
|
||||||
component: "wildduck"
|
component: "wildduck"
|
||||||
options: ${jsonencode(merge(local.global, local.wildduck))}
|
options: ${jsonencode(local.wildduck)}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,81 +6,59 @@ metadata:
|
|||||||
name: domain-mail
|
name: domain-mail
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
backups:
|
storage:
|
||||||
default:
|
default:
|
||||||
enable: false
|
volume:
|
||||||
endpoint: ''
|
accessMode: ReadWriteOnce
|
||||||
key-id-key: s3-id
|
class: ''
|
||||||
secret-key: s3-secret
|
|
||||||
secret-name: backup-settings
|
|
||||||
examples:
|
examples:
|
||||||
- enable: false
|
- volume:
|
||||||
endpoint: ''
|
accessMode: ReadWriteOnce
|
||||||
key-id-key: s3-id
|
class: ''
|
||||||
secret-key: s3-secret
|
|
||||||
secret-name: backup-settings
|
|
||||||
properties:
|
properties:
|
||||||
enable:
|
volume:
|
||||||
default: false
|
default:
|
||||||
type: boolean
|
accessMode: ReadWriteOnce
|
||||||
endpoint:
|
class: ''
|
||||||
default: ''
|
properties:
|
||||||
type: string
|
accessMode:
|
||||||
key-id-key:
|
default: ReadWriteOnce
|
||||||
default: s3-id
|
type: string
|
||||||
type: string
|
class:
|
||||||
secret-key:
|
default: ''
|
||||||
default: s3-secret
|
type: string
|
||||||
type: string
|
type: object
|
||||||
secret-name:
|
|
||||||
default: backup-settings
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
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
|
type: object
|
||||||
ingress_class:
|
ingress_class:
|
||||||
default: traefik
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
|
domain_name:
|
||||||
|
default: your-company.com
|
||||||
|
examples:
|
||||||
|
- your-company.com
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
default: Europe/Paris
|
||||||
|
examples:
|
||||||
|
- Europe/Paris
|
||||||
|
type: string
|
||||||
|
sso_vynil:
|
||||||
|
default: true
|
||||||
|
examples:
|
||||||
|
- true
|
||||||
|
type: boolean
|
||||||
|
language:
|
||||||
|
default: fr_FR
|
||||||
|
examples:
|
||||||
|
- fr_FR
|
||||||
|
type: string
|
||||||
issuer:
|
issuer:
|
||||||
default: letsencrypt-prod
|
default: letsencrypt-prod
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- letsencrypt-prod
|
||||||
type: string
|
type: string
|
||||||
domain_name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
domain:
|
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
distributions:
|
distributions:
|
||||||
default:
|
default:
|
||||||
core: core
|
core: core
|
||||||
@@ -96,6 +74,51 @@ options:
|
|||||||
default: domain
|
default: domain
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
app_group:
|
||||||
|
default: infra
|
||||||
|
examples:
|
||||||
|
- infra
|
||||||
|
type: string
|
||||||
|
backups:
|
||||||
|
default:
|
||||||
|
enable: false
|
||||||
|
endpoint: ''
|
||||||
|
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
|
||||||
|
restic_key: bck-password
|
||||||
|
secret_key: s3-secret
|
||||||
|
secret_name: backup-settings
|
||||||
|
use_barman: false
|
||||||
|
properties:
|
||||||
|
enable:
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
endpoint:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
key_id_key:
|
||||||
|
default: s3-id
|
||||||
|
type: string
|
||||||
|
restic_key:
|
||||||
|
default: bck-password
|
||||||
|
type: string
|
||||||
|
secret_key:
|
||||||
|
default: s3-secret
|
||||||
|
type: string
|
||||||
|
secret_name:
|
||||||
|
default: backup-settings
|
||||||
|
type: string
|
||||||
|
use_barman:
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
type: object
|
||||||
wildduck:
|
wildduck:
|
||||||
default:
|
default:
|
||||||
enable: true
|
enable: true
|
||||||
@@ -106,6 +129,11 @@ options:
|
|||||||
default: true
|
default: true
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
|
domain:
|
||||||
|
default: your-company
|
||||||
|
examples:
|
||||||
|
- your-company
|
||||||
|
type: string
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
|
|||||||
Reference in New Issue
Block a user