diff --git a/meta/domain-apps/index.yaml b/meta/domain-apps/index.yaml index 316eaed..80b023e 100644 --- a/meta/domain-apps/index.yaml +++ b/meta/domain-apps/index.yaml @@ -6,6 +6,46 @@ metadata: name: domain-apps description: null options: + nextcloud: + default: + enable: false + examples: + - enable: false + properties: + enable: + default: false + type: boolean + type: object + ingress-class: + default: traefik + examples: + - traefik + type: string + 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 distributions: default: core: core @@ -21,26 +61,6 @@ options: default: domain type: string type: object - nextcloud: - default: - enable: false - examples: - - enable: false - properties: - enable: - default: false - type: boolean - type: object - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - domain: - default: your-company - examples: - - your-company - type: string domain-name: default: your_company.com examples: @@ -76,35 +96,15 @@ options: default: backup-settings type: string type: object - storage-classes: - default: - BlockReadWriteMany: '' - BlockReadWriteOnce: '' - FilesystemReadWriteMany: '' - FilesystemReadWriteOnce: '' + issuer: + default: letsencrypt-prod examples: - - BlockReadWriteMany: '' - BlockReadWriteOnce: '' - FilesystemReadWriteMany: '' - FilesystemReadWriteOnce: '' - properties: - BlockReadWriteMany: - default: '' - type: string - BlockReadWriteOnce: - default: '' - type: string - FilesystemReadWriteMany: - default: '' - type: string - FilesystemReadWriteOnce: - default: '' - type: string - type: object - ingress-class: - default: traefik + - letsencrypt-prod + type: string + domain: + default: your-company examples: - - traefik + - your-company type: string dependencies: [] providers: diff --git a/meta/domain-ci/apps.tf b/meta/domain-ci/apps.tf index 1c3e0e9..4e76dd9 100644 --- a/meta/domain-ci/apps.tf +++ b/meta/domain-ci/apps.tf @@ -13,17 +13,24 @@ locals { "ingress-class" = var.ingress-class "backups" = var.backups } + default-mode = var.storage-classes.FilesystemReadWriteMany!=""?"ReadWriteMany":"ReadWriteOnce" gitea = { for k, v in var.gitea : k => v if contains(["enable","storage-server","storage-agent"],k) } + gitea-storage = { + "volume" = { + "size" = lookup(lookup(local.gitea, "volume",{}), "size", "20Gi") + "accessMode" = lookup(lookup(local.gitea, "volume",{}), "accessMode", local.default-mode) + } + } woodpecker = { for k, v in var.woodpecker : k => v if k!="enable" } woodpecker-storage = merge({ "storage-server" = { - "size" = "10Gi" - "accessMode" = var.storage-classes.FilesystemReadWriteMany!=""?"ReadWriteMany":"ReadWriteOnce" + "size" = lookup(lookup(local.woodpecker, "storage-server",{}), "size", "10Gi") + "accessMode" = lookup(lookup(local.woodpecker, "storage-server",{}), "accessMode", local.default-mode) } "storage-agent" = { - "size" = "10Gi" - "writeMany" = var.storage-classes.FilesystemReadWriteMany!=""?"true":"false" - "storageClass" = var.storage-classes.FilesystemReadWriteMany!=""?var.storage-classes.FilesystemReadWriteMany:var.storage-classes.FilesystemReadWriteOnce + "size" = lookup(lookup(local.woodpecker, "storage-agent",{}), "size", "10Gi") + "writeMany" = lookup(lookup(local.woodpecker, "storage-agent",{}), "writeMany", var.storage-classes.FilesystemReadWriteMany!=""?"true":"false") + "storageClass" = lookup(lookup(local.woodpecker, "storage-agent",{}), "storageClass", var.storage-classes.FilesystemReadWriteMany!=""?var.storage-classes.FilesystemReadWriteMany:var.storage-classes.FilesystemReadWriteOnce) } }, { for k, v in var.woodpecker : k => v if contains(["storage-server","storage-agent"],k) }) } @@ -51,7 +58,7 @@ resource "kubectl_manifest" "gitea" { distrib: "${var.distributions.domain}" category: "apps" component: "gitea" - options: ${jsonencode(merge(local.global, local.gitea))} + options: ${jsonencode(merge(local.global, local.gitea-storage, local.gitea))} EOF } diff --git a/meta/domain-ci/index.yaml b/meta/domain-ci/index.yaml index 3c0eb6c..cef046b 100644 --- a/meta/domain-ci/index.yaml +++ b/meta/domain-ci/index.yaml @@ -6,46 +6,6 @@ metadata: name: domain-ci description: null options: - domain: - default: your-company - examples: - - your-company - type: string - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - 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 - woodpecker: - default: - enable: false - examples: - - enable: false - properties: - enable: - default: false - type: boolean - type: object - ingress-class: - default: traefik - examples: - - traefik - type: string storage-classes: default: BlockReadWriteMany: '' @@ -71,21 +31,21 @@ options: default: '' type: string type: object - gitea: - default: - enable: true - examples: - - enable: true - properties: - enable: - default: true - type: boolean - type: object domain-name: default: your_company.com examples: - your_company.com type: string + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod + type: string + ingress-class: + default: traefik + examples: + - traefik + type: string backups: default: enable: false @@ -116,6 +76,46 @@ options: default: backup-settings type: string type: object + domain: + default: your-company + examples: + - your-company + type: string + gitea: + default: + enable: true + examples: + - enable: true + properties: + enable: + default: true + type: boolean + type: object + woodpecker: + default: + enable: false + examples: + - enable: false + properties: + enable: + default: false + type: boolean + type: object + distributions: + default: + core: core + domain: domain + examples: + - core: core + domain: domain + properties: + core: + default: core + type: string + domain: + default: domain + type: string + type: object dependencies: [] providers: kubernetes: true @@ -124,4 +124,5 @@ providers: postgresql: null restapi: null http: null + gitea: null tfaddtype: null diff --git a/meta/domain-devspaces/index.yaml b/meta/domain-devspaces/index.yaml index 0f2c17d..cb542a0 100644 --- a/meta/domain-devspaces/index.yaml +++ b/meta/domain-devspaces/index.yaml @@ -6,11 +6,82 @@ metadata: name: domain-devspaces description: null options: - domain: - default: your-company + app-group: + default: dev examples: - - your-company + - dev type: string + 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 + haveGitea: + default: false + examples: + - false + type: boolean + organisations: + default: [] + examples: + - [] + items: + properties: + datasets: + default: [] + items: + properties: + databases: + default: [] + items: + properties: + name: + default: db + type: string + type: object + type: array + engine: + default: pg + type: string + name: + default: '' + type: string + type: object + type: array + name: + default: '' + type: string + stages: + default: [] + items: + properties: + name: + default: prod + type: string + type: object + type: array + type: object + type: array external-redis: default: [] examples: @@ -25,6 +96,41 @@ options: type: string type: object type: array + domain: + default: your-company + examples: + - your-company + type: string + backups: + default: + enable: false + endpoint: '' + key-id-key: s3-id + secret-key: s3-secret + secret-name: backup-settings + examples: + - enable: false + endpoint: '' + key-id-key: s3-id + secret-key: s3-secret + secret-name: backup-settings + properties: + enable: + default: false + type: boolean + endpoint: + default: '' + type: string + key-id-key: + default: s3-id + type: string + secret-key: + default: s3-secret + type: string + secret-name: + default: backup-settings + type: string + type: object apps: default: dbgate: @@ -78,86 +184,6 @@ options: type: boolean type: object type: object - external-marias: - default: [] - examples: - - [] - items: - properties: - name: - default: '' - type: string - namespace: - default: '' - type: string - secret: - properties: - key: - default: '' - type: string - name: - default: '' - type: string - type: object - username: - default: '' - type: string - type: object - type: array - 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 - external-mongos: - default: [] - examples: - - [] - items: - properties: - dbname: - default: '' - type: string - name: - default: '' - type: string - namespace: - default: '' - type: string - secret: - properties: - key: - default: '' - type: string - name: - default: '' - type: string - type: object - username: - default: '' - type: string - type: object - type: array stations: default: [] examples: @@ -174,57 +200,6 @@ options: type: array type: object type: array - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - organisations: - default: [] - examples: - - [] - items: - properties: - datasets: - default: [] - items: - properties: - databases: - default: [] - items: - properties: - name: - default: db - type: string - type: object - type: array - engine: - default: pg - type: string - name: - default: '' - type: string - type: object - type: array - name: - default: '' - type: string - stages: - default: [] - items: - properties: - name: - default: prod - type: string - type: object - type: array - type: object - type: array - app-group: - default: dev - examples: - - dev - type: string images: default: codeserver: @@ -264,7 +239,33 @@ options: type: number type: object type: object - external-pgs: + external-marias: + default: [] + examples: + - [] + items: + properties: + name: + default: '' + type: string + namespace: + default: '' + type: string + secret: + properties: + key: + default: '' + type: string + name: + default: '' + type: string + type: object + username: + default: '' + type: string + type: object + type: array + external-mongos: default: [] examples: - [] @@ -298,41 +299,45 @@ options: examples: - traefik type: string - stations-sub-domain: - default: code + domain-name: + default: your_company.com examples: - - code + - your_company.com type: string - backups: - default: - enable: false - endpoint: '' - key-id-key: s3-id - secret-key: s3-secret - secret-name: backup-settings + external-pgs: + default: [] examples: - - enable: false - endpoint: '' - key-id-key: s3-id - secret-key: s3-secret - secret-name: backup-settings - properties: - enable: - default: false - type: boolean - endpoint: - default: '' - type: string - key-id-key: - default: s3-id - type: string - secret-key: - default: s3-secret - type: string - secret-name: - default: backup-settings - type: string - type: object + - [] + items: + properties: + dbname: + default: '' + type: string + name: + default: '' + type: string + namespace: + default: '' + type: string + secret: + properties: + key: + default: '' + type: string + name: + default: '' + type: string + type: object + username: + default: '' + type: string + type: object + type: array + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod + type: string distributions: default: core: core @@ -348,16 +353,11 @@ options: default: domain type: string type: object - domain-name: - default: your_company.com + stations-sub-domain: + default: code examples: - - your_company.com + - code type: string - haveGitea: - default: false - examples: - - false - type: boolean dependencies: [] providers: kubernetes: true diff --git a/meta/domain-erp/apps.tf b/meta/domain-erp/apps.tf index 274305f..f2f9e28 100644 --- a/meta/domain-erp/apps.tf +++ b/meta/domain-erp/apps.tf @@ -13,11 +13,12 @@ locals { "ingress-class" = var.ingress-class "backups" = var.backups } + default-mode = var.storage-classes.FilesystemReadWriteMany!=""?"ReadWriteMany":"ReadWriteOnce" dolibarr = { for k, v in var.dolibarr : k => v if contains(["enable","storage"],k) } doli-storage = merge({ "storage" = { - "size" = "10Gi" - "accessMode" = var.storage-classes.FilesystemReadWriteMany!=""?"ReadWriteMany":"ReadWriteOnce" + "size" = lookup(lookup(local.dolibarr, "storage",{}), "size", "10Gi") + "accessMode" = lookup(lookup(local.dolibarr, "storage",{}), "accessMode", local.default-mode) "type" = "Filesystem" } }, { for k, v in var.dolibarr : k => v if k=="storage" }) diff --git a/meta/domain-erp/index.yaml b/meta/domain-erp/index.yaml index 9c3ce0c..b21d004 100644 --- a/meta/domain-erp/index.yaml +++ b/meta/domain-erp/index.yaml @@ -11,21 +11,6 @@ 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 backups: default: enable: false @@ -56,11 +41,46 @@ options: default: backup-settings type: string type: object + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod + type: string ingress-class: default: traefik 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 + dolibarr: + default: + enable: true + examples: + - enable: true + properties: + enable: + default: true + type: boolean + type: object storage-classes: default: BlockReadWriteMany: '' @@ -86,26 +106,6 @@ options: default: '' type: string type: object - dolibarr: - default: - enable: true - examples: - - enable: true - properties: - enable: - default: true - type: boolean - type: object - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string dependencies: [] providers: kubernetes: true @@ -114,4 +114,5 @@ providers: postgresql: null restapi: null http: null + gitea: null tfaddtype: null diff --git a/meta/domain/index.yaml b/meta/domain/index.yaml index 0e7cc40..c5b9a5b 100644 --- a/meta/domain/index.yaml +++ b/meta/domain/index.yaml @@ -6,6 +6,38 @@ metadata: name: domain description: null options: + devspaces: + default: + enable: false + examples: + - enable: false + properties: + enable: + default: false + type: boolean + type: object + infra: + default: + enable: false + traefik: + enable: false + examples: + - enable: false + traefik: + enable: false + properties: + enable: + default: false + type: boolean + traefik: + default: + enable: false + properties: + enable: + default: false + type: boolean + type: object + type: object distributions: default: core: core @@ -21,6 +53,156 @@ options: default: domain 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 + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + apps: + default: + enable: false + nextcloud: + enable: true + examples: + - enable: false + nextcloud: + enable: true + properties: + enable: + default: false + type: boolean + nextcloud: + default: + enable: true + properties: + enable: + default: true + type: boolean + type: object + type: object + mail: + default: + enable: false + wildduck: + enable: true + examples: + - enable: false + wildduck: + enable: true + properties: + enable: + default: false + type: boolean + wildduck: + default: + enable: true + properties: + enable: + default: true + type: boolean + type: object + type: object + issuer: + default: letsencrypt-prod + examples: + - 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 + ingress-class: + default: traefik + examples: + - traefik + type: string + auth: + default: + authentik: + enable: true + enable: true + examples: + - authentik: + enable: true + enable: true + properties: + authentik: + default: + enable: true + properties: + enable: + default: true + type: boolean + type: object + enable: + default: true + type: boolean + type: object + erp: + default: + dolibarr: + enable: true + enable: false + examples: + - dolibarr: + enable: true + enable: false + properties: + dolibarr: + default: + enable: true + properties: + enable: + default: true + type: boolean + type: object + enable: + default: false + type: boolean + type: object backups: default: enable: false @@ -51,188 +233,6 @@ options: default: backup-settings type: string type: object - erp: - default: - dolibarr: - enable: true - enable: false - examples: - - dolibarr: - enable: true - enable: false - properties: - dolibarr: - default: - enable: true - properties: - enable: - default: true - type: boolean - type: object - enable: - default: false - type: boolean - type: object - ingress-class: - default: traefik - examples: - - traefik - 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 - apps: - default: - enable: false - nextcloud: - enable: true - examples: - - enable: false - nextcloud: - enable: true - properties: - enable: - default: false - type: boolean - nextcloud: - default: - enable: true - properties: - enable: - default: true - type: boolean - type: object - type: object - devspaces: - default: - enable: false - examples: - - enable: false - properties: - enable: - default: false - type: boolean - type: object - mail: - default: - enable: false - wildduck: - enable: true - examples: - - enable: false - wildduck: - enable: true - properties: - enable: - default: false - type: boolean - wildduck: - default: - enable: true - properties: - enable: - default: true - type: boolean - type: object - type: object - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - 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 - infra: - default: - enable: false - traefik: - enable: false - examples: - - enable: false - traefik: - enable: false - properties: - enable: - default: false - type: boolean - traefik: - default: - enable: false - properties: - enable: - default: false - type: boolean - type: object - type: object - auth: - default: - authentik: - enable: true - enable: true - examples: - - authentik: - enable: true - enable: true - properties: - authentik: - default: - enable: true - properties: - enable: - default: true - type: boolean - type: object - enable: - default: true - type: boolean - type: object dependencies: [] providers: kubernetes: null diff --git a/meta/domain/installs.tf b/meta/domain/installs.tf index bc01cd8..cd94d74 100644 --- a/meta/domain/installs.tf +++ b/meta/domain/installs.tf @@ -118,6 +118,7 @@ locals { "name" = "nextcloud-nextcloud-redis" "namespace" = "${var.namespace}-files" }]:[], lookup(var.devspaces, "external-redis", [])) + "haveGitea" = var.ci.enable && var.ci.gitea.enable } }