From 4c33e34f4532bf20ba2856c046bc1b7760ae7587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Fri, 14 Jul 2023 12:53:52 +0200 Subject: [PATCH] Fix --- apps/{k8s-ui => k8s-api}/datas.tf | 0 apps/{k8s-ui => k8s-api}/index.yaml | 12 ++--- apps/{k8s-ui => k8s-api}/ingress.tf | 0 meta/domain-auth/apps.tf | 6 +-- meta/domain-auth/index.yaml | 53 ++++++++++++------- meta/domain-ci/apps.tf | 2 +- meta/domain-ci/index.yaml | 35 +++++++++---- meta/domain-erp/apps.tf | 2 +- meta/domain-erp/index.yaml | 45 ++++++++++------ meta/domain-infra/apps.tf | 8 +-- meta/domain-infra/index.yaml | 81 +++++++++++++++++------------ meta/domain/index.yaml | 79 ++++++++++++++++------------ meta/domain/installs.tf | 9 ++-- 13 files changed, 204 insertions(+), 128 deletions(-) rename apps/{k8s-ui => k8s-api}/datas.tf (100%) rename apps/{k8s-ui => k8s-api}/index.yaml (97%) rename apps/{k8s-ui => k8s-api}/ingress.tf (100%) diff --git a/apps/k8s-ui/datas.tf b/apps/k8s-api/datas.tf similarity index 100% rename from apps/k8s-ui/datas.tf rename to apps/k8s-api/datas.tf diff --git a/apps/k8s-ui/index.yaml b/apps/k8s-api/index.yaml similarity index 97% rename from apps/k8s-ui/index.yaml rename to apps/k8s-api/index.yaml index 43d2fab..4a0e46b 100644 --- a/apps/k8s-ui/index.yaml +++ b/apps/k8s-api/index.yaml @@ -3,9 +3,14 @@ apiVersion: vinyl.solidite.fr/v1beta1 kind: Component category: apps metadata: - name: k8s-ui + name: k8s-api description: Access to the kubernetes api options: + sub-domain: + default: api + examples: + - api + type: string domain-name: default: your_company.com examples: @@ -16,11 +21,6 @@ options: examples: - letsencrypt-prod type: string - sub-domain: - default: api - examples: - - api - type: string ingress-class: default: traefik examples: diff --git a/apps/k8s-ui/ingress.tf b/apps/k8s-api/ingress.tf similarity index 100% rename from apps/k8s-ui/ingress.tf rename to apps/k8s-api/ingress.tf diff --git a/meta/domain-auth/apps.tf b/meta/domain-auth/apps.tf index 328915d..8c1cd5f 100644 --- a/meta/domain-auth/apps.tf +++ b/meta/domain-auth/apps.tf @@ -37,7 +37,7 @@ resource "kubectl_manifest" "authentik" { namespace: "${var.namespace}-auth" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "share" component: "authentik" options: ${jsonencode(merge(local.global, local.authentik))} @@ -55,7 +55,7 @@ resource "kubectl_manifest" "authentik-ldap" { namespace: "${var.namespace}-auth" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "share" component: "authentik-ldap" options: ${jsonencode(merge(local.global, local.authentik-ldap))} @@ -73,7 +73,7 @@ resource "kubectl_manifest" "authentik-forward" { namespace: "${var.namespace}-auth" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "share" component: "authentik-forward" options: ${jsonencode(merge(local.global, local.authentik-forward))} diff --git a/meta/domain-auth/index.yaml b/meta/domain-auth/index.yaml index 03640d8..4df3845 100644 --- a/meta/domain-auth/index.yaml +++ b/meta/domain-auth/index.yaml @@ -6,31 +6,26 @@ metadata: name: domain-auth description: null options: - authentik-ldap: - default: - enable: false - examples: - - enable: false - properties: - enable: - default: false - type: boolean - type: object issuer: default: letsencrypt-prod examples: - letsencrypt-prod type: string - domain-name: - default: your_company.com + distributions: + default: + core: core + domain: domain examples: - - your_company.com - type: string - ingress-class: - default: traefik - examples: - - traefik - type: string + - core: core + domain: domain + properties: + core: + default: core + type: string + domain: + default: domain + type: string + type: object authentik: default: enable: true @@ -41,6 +36,21 @@ options: default: true type: boolean type: object + authentik-ldap: + default: + enable: false + examples: + - enable: false + properties: + enable: + default: false + type: boolean + type: object + domain-name: + default: your_company.com + examples: + - your_company.com + type: string authentik-forward: default: enable: false @@ -51,6 +61,11 @@ options: default: false type: boolean type: object + ingress-class: + default: traefik + examples: + - traefik + type: string domain: default: your-company examples: diff --git a/meta/domain-ci/apps.tf b/meta/domain-ci/apps.tf index ff500a5..035a40c 100644 --- a/meta/domain-ci/apps.tf +++ b/meta/domain-ci/apps.tf @@ -35,7 +35,7 @@ resource "kubectl_manifest" "gitea" { namespace: "${var.namespace}-ci" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "apps" component: "gitea" options: ${jsonencode(merge(local.global, local.gitea))} diff --git a/meta/domain-ci/index.yaml b/meta/domain-ci/index.yaml index 4042c81..25ceb5f 100644 --- a/meta/domain-ci/index.yaml +++ b/meta/domain-ci/index.yaml @@ -6,16 +6,6 @@ metadata: name: domain-ci description: null options: - gitea: - default: - enable: true - examples: - - enable: true - properties: - enable: - default: true - type: boolean - type: object domain-name: default: your_company.com examples: @@ -36,6 +26,31 @@ options: examples: - traefik type: string + distributions: + default: + core: core + domain: domain + examples: + - core: core + domain: domain + properties: + core: + default: core + type: string + domain: + default: domain + type: string + type: object + gitea: + default: + enable: true + examples: + - enable: true + properties: + enable: + default: true + type: boolean + type: object dependencies: [] providers: kubernetes: true diff --git a/meta/domain-erp/apps.tf b/meta/domain-erp/apps.tf index e8f2e4e..476a1ab 100644 --- a/meta/domain-erp/apps.tf +++ b/meta/domain-erp/apps.tf @@ -35,7 +35,7 @@ resource "kubectl_manifest" "dolibarr" { namespace: "${kubernetes_namespace_v1.erp-ns[0].metadata[0].name}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "apps" component: "dolibarr" options: ${jsonencode(merge(local.global, local.dolibarr))} diff --git a/meta/domain-erp/index.yaml b/meta/domain-erp/index.yaml index dc0d882..ddcaa39 100644 --- a/meta/domain-erp/index.yaml +++ b/meta/domain-erp/index.yaml @@ -6,21 +6,6 @@ metadata: name: domain-erp description: null options: - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - dolibarr: - default: - enable: true - examples: - - enable: true - properties: - enable: - default: true - type: boolean - type: object ingress-class: default: traefik examples: @@ -31,11 +16,41 @@ options: examples: - your-company type: string + distributions: + default: + core: core + domain: domain + examples: + - core: core + domain: domain + properties: + core: + default: core + type: string + domain: + default: domain + type: string + type: object + dolibarr: + default: + enable: true + examples: + - enable: true + properties: + enable: + default: true + type: boolean + type: object issuer: default: letsencrypt-prod examples: - letsencrypt-prod type: string + domain-name: + default: your_company.com + examples: + - your_company.com + type: string dependencies: [] providers: kubernetes: true diff --git a/meta/domain-infra/apps.tf b/meta/domain-infra/apps.tf index 9471a4e..21ac901 100644 --- a/meta/domain-infra/apps.tf +++ b/meta/domain-infra/apps.tf @@ -37,7 +37,7 @@ resource "kubectl_manifest" "dns" { namespace: "${kubernetes_namespace_v1.infra-ns.name}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "share" component: "dns" options: ${jsonencode(merge(local.global, local.dns))} @@ -55,7 +55,7 @@ resource "kubectl_manifest" "traefik" { namespace: "${var.traefik.namespace}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "apps" component: "traefik-ui" options: ${jsonencode(merge(local.global, local.traefik))} @@ -72,9 +72,9 @@ resource "kubectl_manifest" "traefik" { namespace: "default" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "apps" - component: "k8s-ui" + component: "k8s-api" options: ${jsonencode(merge(local.global, local.api))} EOF } diff --git a/meta/domain-infra/index.yaml b/meta/domain-infra/index.yaml index 0822f83..e247b52 100644 --- a/meta/domain-infra/index.yaml +++ b/meta/domain-infra/index.yaml @@ -6,16 +6,61 @@ metadata: name: domain-infra description: null options: - ingress-class: - default: traefik + distributions: + default: + core: core + domain: domain examples: - - traefik + - core: core + domain: domain + properties: + core: + default: core + type: string + domain: + default: domain + type: string + type: object + api: + default: + enable: false + examples: + - enable: false + properties: + enable: + default: false + type: boolean + type: object + domain: + default: your-company + examples: + - your-company + type: string + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod type: string domain-name: default: your_company.com examples: - your_company.com type: string + dns: + default: + enable: false + examples: + - enable: false + properties: + enable: + default: false + type: boolean + type: object + ingress-class: + default: traefik + examples: + - traefik + type: string traefik: default: enable: false @@ -31,36 +76,6 @@ options: default: traefik type: string type: object - domain: - default: your-company - examples: - - your-company - type: string - api: - default: - enable: false - examples: - - enable: false - properties: - enable: - default: false - type: boolean - type: object - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - dns: - default: - enable: false - examples: - - enable: false - properties: - enable: - default: false - type: boolean - type: object dependencies: [] providers: kubernetes: true diff --git a/meta/domain/index.yaml b/meta/domain/index.yaml index 1a2b2c9..9114985 100644 --- a/meta/domain/index.yaml +++ b/meta/domain/index.yaml @@ -16,27 +16,30 @@ options: default: true type: boolean type: object - ci: - default: - enable: false - gitea: - enable: true + ingress-class: + default: traefik examples: - - enable: false - gitea: - enable: true + - traefik + type: string + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + distributions: + default: + core: core + domain: domain + examples: + - core: core + domain: domain properties: - enable: - default: false - type: boolean - gitea: - default: - enable: true - properties: - enable: - default: true - type: boolean - type: object + core: + default: core + type: string + domain: + default: domain + type: string type: object erp: default: @@ -60,11 +63,33 @@ options: default: false type: boolean type: object - domain-name: - default: your_company.com + issuer: + default: letsencrypt-prod examples: - - your_company.com + - letsencrypt-prod type: string + ci: + default: + enable: false + gitea: + enable: true + examples: + - enable: false + gitea: + enable: true + properties: + enable: + default: false + type: boolean + gitea: + default: + enable: true + properties: + enable: + default: true + type: boolean + type: object + type: object infra: default: enable: false @@ -87,16 +112,6 @@ options: type: boolean type: object type: object - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - ingress-class: - default: traefik - examples: - - traefik - type: string dependencies: [] providers: kubernetes: null diff --git a/meta/domain/installs.tf b/meta/domain/installs.tf index 4113eba..3c1b0ee 100644 --- a/meta/domain/installs.tf +++ b/meta/domain/installs.tf @@ -4,6 +4,7 @@ locals { "domain-name" = var.domain-name "issuer" = var.issuer "ingress-class" = var.ingress-class + "distributions" = var.distributions } annotations = { "vynil.solidite.fr/meta" = "domain" @@ -42,7 +43,7 @@ resource "kubectl_manifest" "auth" { namespace: "${var.namespace}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "meta" component: "domain-auth" options: ${jsonencode(merge(merge(local.global, local.auth), local.added-auth))} @@ -58,7 +59,7 @@ resource "kubectl_manifest" "infra" { namespace: "${var.namespace}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "meta" component: "domain-infra" options: ${jsonencode(merge(local.global, local.infra))} @@ -74,7 +75,7 @@ resource "kubectl_manifest" "ci" { namespace: "${var.namespace}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "meta" component: "domain-ci" options: ${jsonencode(merge(local.global, local.ci))} @@ -90,7 +91,7 @@ resource "kubectl_manifest" "erp" { namespace: "${var.namespace}" labels: ${jsonencode(local.common-labels)} spec: - distrib: "core" + distrib: "${var.distributions.domain}" category: "meta" component: "domain-erp" options: ${jsonencode(merge(local.global, local.erp))}