diff --git a/apps/gitea/datas.tf b/apps/gitea/datas.tf index e48a084..23db30d 100644 --- a/apps/gitea/datas.tf +++ b/apps/gitea/datas.tf @@ -9,6 +9,17 @@ locals { "app.kubernetes.io/managed-by" = "vynil" "app.kubernetes.io/instance" = var.instance } + pvc_spec = merge({ + "accessModes" = [var.storage.volume.accessMode] + "volumeMode" = var.storage.volume.type + "resources" = { + "requests" = { + "storage" = "${var.storage.volume.size}" + } + } + }, var.storage.volume.class != "" ?{ + "storageClassName" = var.storage.volume.class + }:{}) removePatch = <<-EOF - op: remove path: /spec/loadBalancerIP @@ -152,13 +163,7 @@ data "kustomization_overlay" "data" { name: gitea-shared-storage annotations: k8up.io/backup: "true" - spec: - accessModes: - - "${var.storage.volume.accessMode}" - volumeMode: Filesystem - resources: - requests: - storage: "${var.storage.volume.size}" + spec: ${jsonencode(local.pvc_spec)} EOF } patches { diff --git a/apps/gitea/index.yaml b/apps/gitea/index.yaml index effa18a..ac05e9b 100644 --- a/apps/gitea/index.yaml +++ b/apps/gitea/index.yaml @@ -9,33 +9,6 @@ metadata: A painless self-hosted Git service. Gitea is a community managed lightweight code hosting solution written in Go. It is published under the MIT license. options: - disable-registration: - default: true - examples: - - true - type: boolean - redis: - default: - exporter: - enabled: true - examples: - - exporter: - enabled: true - properties: - exporter: - default: - enabled: true - properties: - enabled: - default: true - type: boolean - type: object - type: object - theme: - default: gitea-modern - examples: - - gitea-modern - type: string storage: default: postgres: @@ -44,6 +17,7 @@ options: size: 2Gi volume: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem description: Configure this app storage @@ -54,6 +28,7 @@ options: size: 2Gi volume: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem properties: @@ -76,6 +51,7 @@ options: volume: default: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem properties: @@ -86,6 +62,9 @@ options: - ReadOnlyMany - ReadWriteMany type: string + class: + default: '' + type: string size: default: 10Gi type: string @@ -102,147 +81,33 @@ options: examples: - dev type: string - postgres: - default: - replicas: 1 - examples: - - replicas: 1 - properties: - replicas: - default: 1 - type: integer - type: object domain: default: your-company examples: - your-company type: string - ssh-sub_domain: - default: git + redis: + default: + exporter: + enabled: true examples: - - git + - exporter: + enabled: true + properties: + exporter: + default: + enabled: true + properties: + enabled: + default: true + type: boolean + type: object + type: object + default-branch: + default: main + examples: + - main type: string - backups: - default: - enable: false - endpoint: '' - key_id_key: s3-id - restic_key: bck-password - retention: - db: 30d - keepDaily: 14 - keepMonthly: 12 - keepWeekly: 6 - keepYearly: 12 - schedule: - backup: 10 3 * * * - check: 10 5 * * 1 - db: 10 3 * * * - prune: 10 1 * * 0 - secret_key: s3-secret - secret_name: backup-settings - use-barman: false - examples: - - enable: false - endpoint: '' - key_id_key: s3-id - restic_key: bck-password - retention: - db: 30d - keepDaily: 14 - keepMonthly: 12 - keepWeekly: 6 - keepYearly: 12 - schedule: - backup: 10 3 * * * - check: 10 5 * * 1 - db: 10 3 * * * - prune: 10 1 * * 0 - 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 - retention: - default: - db: 30d - keepDaily: 14 - keepMonthly: 12 - keepWeekly: 6 - keepYearly: 12 - properties: - db: - default: 30d - type: string - keepDaily: - default: 14 - type: integer - keepMonthly: - default: 12 - type: integer - keepWeekly: - default: 6 - type: integer - keepYearly: - default: 12 - type: integer - type: object - schedule: - default: - backup: 10 3 * * * - check: 10 5 * * 1 - db: 10 3 * * * - prune: 10 1 * * 0 - properties: - backup: - default: 10 3 * * * - type: string - check: - default: 10 5 * * 1 - type: string - db: - default: 10 3 * * * - type: string - prune: - default: 10 1 * * 0 - type: string - type: object - secret_key: - default: s3-secret - type: string - secret_name: - default: backup-settings - type: string - use-barman: - default: false - type: boolean - type: object - admin: - default: - email: git-admin@git.your_company.com - name: gitea_admin - examples: - - email: git-admin@git.your_company.com - name: gitea_admin - properties: - email: - default: git-admin@git.your_company.com - type: string - name: - default: gitea_admin - type: string - type: object webhook: default: allowed-hosts: private @@ -258,25 +123,45 @@ options: default: false type: boolean type: object - release: - default: 8.3.0 + ingress_class: + default: traefik examples: - - 8.3.0 + - traefik + type: string + postgres: + default: + replicas: 1 + examples: + - replicas: 1 + properties: + replicas: + default: 1 + type: integer + type: object + ssh-sub_domain: + default: git + examples: + - git + type: string + theme: + default: gitea-modern + examples: + - gitea-modern + type: string + timezone: + default: Europe/Paris + examples: + - Europe/Paris type: string ssh-port: default: 2222 examples: - 2222 type: integer - replicas: - default: 1 + sub_domain: + default: git examples: - - 1 - type: integer - default-branch: - default: main - examples: - - main + - git type: string images: default: @@ -414,6 +299,16 @@ options: examples: - your_company.com type: string + disable-registration: + default: true + examples: + - true + type: boolean + replicas: + default: 1 + examples: + - 1 + type: integer load-balancer: default: ip: '' @@ -424,21 +319,11 @@ options: default: '' type: string type: object - sub_domain: - default: git - examples: - - git - type: string issuer: default: letsencrypt-prod examples: - letsencrypt-prod type: string - ingress_class: - default: traefik - examples: - - traefik - type: string push-create: default: org: 'true' @@ -459,10 +344,131 @@ options: default: 'true' type: string type: object - timezone: - default: Europe/Paris + admin: + default: + email: git-admin@git.your_company.com + name: gitea_admin examples: - - Europe/Paris + - email: git-admin@git.your_company.com + name: gitea_admin + properties: + email: + default: git-admin@git.your_company.com + type: string + name: + default: gitea_admin + type: string + type: object + backups: + default: + enable: false + endpoint: '' + key_id_key: s3-id + restic_key: bck-password + retention: + db: 30d + keepDaily: 14 + keepMonthly: 12 + keepWeekly: 6 + keepYearly: 12 + schedule: + backup: 10 3 * * * + check: 10 5 * * 1 + db: 10 3 * * * + prune: 10 1 * * 0 + secret_key: s3-secret + secret_name: backup-settings + use_barman: false + examples: + - enable: false + endpoint: '' + key_id_key: s3-id + restic_key: bck-password + retention: + db: 30d + keepDaily: 14 + keepMonthly: 12 + keepWeekly: 6 + keepYearly: 12 + schedule: + backup: 10 3 * * * + check: 10 5 * * 1 + db: 10 3 * * * + prune: 10 1 * * 0 + 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 + retention: + default: + db: 30d + keepDaily: 14 + keepMonthly: 12 + keepWeekly: 6 + keepYearly: 12 + properties: + db: + default: 30d + type: string + keepDaily: + default: 14 + type: integer + keepMonthly: + default: 12 + type: integer + keepWeekly: + default: 6 + type: integer + keepYearly: + default: 12 + type: integer + type: object + schedule: + default: + backup: 10 3 * * * + check: 10 5 * * 1 + db: 10 3 * * * + prune: 10 1 * * 0 + properties: + backup: + default: 10 3 * * * + type: string + check: + default: 10 5 * * 1 + type: string + db: + default: 10 3 * * * + type: string + prune: + default: 10 1 * * 0 + type: string + type: object + secret_key: + default: s3-secret + type: string + secret_name: + default: backup-settings + type: string + use_barman: + default: false + type: boolean + type: object + release: + default: 8.3.0 + examples: + - 8.3.0 type: string dependencies: - dist: null diff --git a/apps/nextcloud/datas.tf b/apps/nextcloud/datas.tf index 2ba27ae..abe3e6c 100644 --- a/apps/nextcloud/datas.tf +++ b/apps/nextcloud/datas.tf @@ -10,6 +10,17 @@ locals { "app.kubernetes.io/name" = var.component "app.kubernetes.io/instance" = var.instance } + pvc_spec = merge({ + "accessModes" = [var.storage.volume.accessMode] + "volumeMode" = var.storage.volume.type + "resources" = { + "requests" = { + "storage" = "${var.storage.volume.size}" + } + } + }, var.storage.volume.class != "" ?{ + "storageClassName" = var.storage.volume.class + }:{}) nextcloud-labels = merge(local.common-labels, { }) } @@ -180,12 +191,7 @@ data "kustomization_overlay" "data" { name: nextcloud-nextcloud annotations: k8up.io/backup: "true" - spec: - accessModes: - - "${var.storage.volume.accessMode}" - resources: - requests: - storage: "${var.storage.volume.size}" + spec: ${jsonencode(local.pvc_spec)} EOF } patches { @@ -204,18 +210,4 @@ data "kustomization_overlay" "data" { targetCPUUtilizationPercentage: ${var.hpa.avg-cpu} EOF } - patches { - target { - kind = "PersistentVolumeClaim" - name = "nextcloud-nextcloud" - } - patch = <<-EOF - kind: PersistentVolumeClaim - apiVersion: v1 - metadata: - name: nextcloud-nextcloud - annotations: - k8up.io/backup: "true" - EOF - } } diff --git a/apps/nextcloud/index.yaml b/apps/nextcloud/index.yaml index 39c4eae..3f95289 100644 --- a/apps/nextcloud/index.yaml +++ b/apps/nextcloud/index.yaml @@ -6,6 +6,154 @@ metadata: name: nextcloud description: null options: + redis: + default: + exporter: + enabled: true + examples: + - exporter: + enabled: true + properties: + exporter: + default: + enabled: true + properties: + enabled: + default: true + type: boolean + type: object + type: object + backups: + default: + enable: false + endpoint: '' + key_id_key: s3-id + restic_key: bck-password + retention: + db: 30d + keepDaily: 14 + keepMonthly: 12 + keepWeekly: 6 + keepYearly: 12 + schedule: + backup: 30 3 * * * + check: 30 5 * * 1 + db: 30 3 * * * + prune: 30 1 * * 0 + secret_key: s3-secret + secret_name: backup-settings + use_barman: false + examples: + - enable: false + endpoint: '' + key_id_key: s3-id + restic_key: bck-password + retention: + db: 30d + keepDaily: 14 + keepMonthly: 12 + keepWeekly: 6 + keepYearly: 12 + schedule: + backup: 30 3 * * * + check: 30 5 * * 1 + db: 30 3 * * * + prune: 30 1 * * 0 + 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 + retention: + default: + db: 30d + keepDaily: 14 + keepMonthly: 12 + keepWeekly: 6 + keepYearly: 12 + properties: + db: + default: 30d + type: string + keepDaily: + default: 14 + type: integer + keepMonthly: + default: 12 + type: integer + keepWeekly: + default: 6 + type: integer + keepYearly: + default: 12 + type: integer + type: object + schedule: + default: + backup: 30 3 * * * + check: 30 5 * * 1 + db: 30 3 * * * + prune: 30 1 * * 0 + properties: + backup: + default: 30 3 * * * + type: string + check: + default: 30 5 * * 1 + type: string + db: + default: 30 3 * * * + type: string + prune: + default: 30 1 * * 0 + type: string + type: object + secret_key: + default: s3-secret + type: string + secret_name: + default: backup-settings + type: string + use_barman: + default: false + type: boolean + type: object + openid-name: + default: vynil + examples: + - vynil + type: string + admin: + default: + name: nextcloud_admin + examples: + - name: nextcloud_admin + properties: + name: + default: nextcloud_admin + type: string + type: object + domain_name: + default: your_company.com + examples: + - your_company.com + type: string + ingress_class: + default: traefik + examples: + - traefik + type: string images: default: collabora: @@ -261,137 +409,31 @@ options: type: string type: object type: object - openid-name: - default: vynil + issuer: + default: letsencrypt-prod examples: - - vynil + - letsencrypt-prod type: string - postgres: + hpa: default: - replicas: 1 + avg-cpu: 50 + max-replicas: 5 + min-replicas: 1 examples: - - replicas: 1 + - avg-cpu: 50 + max-replicas: 5 + min-replicas: 1 properties: - replicas: + avg-cpu: + default: 50 + type: integer + max-replicas: + default: 5 + type: integer + min-replicas: default: 1 type: integer type: object - sub_domain: - default: files - examples: - - files - type: string - ingress_class: - default: traefik - examples: - - traefik - type: string - backups: - default: - enable: false - endpoint: '' - key_id_key: s3-id - restic_key: bck-password - retention: - db: 30d - keepDaily: 14 - keepMonthly: 12 - keepWeekly: 6 - keepYearly: 12 - schedule: - backup: 30 3 * * * - check: 30 5 * * 1 - db: 30 3 * * * - prune: 30 1 * * 0 - secret_key: s3-secret - secret_name: backup-settings - use_barman: false - examples: - - enable: false - endpoint: '' - key_id_key: s3-id - restic_key: bck-password - retention: - db: 30d - keepDaily: 14 - keepMonthly: 12 - keepWeekly: 6 - keepYearly: 12 - schedule: - backup: 30 3 * * * - check: 30 5 * * 1 - db: 30 3 * * * - prune: 30 1 * * 0 - 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 - retention: - default: - db: 30d - keepDaily: 14 - keepMonthly: 12 - keepWeekly: 6 - keepYearly: 12 - properties: - db: - default: 30d - type: string - keepDaily: - default: 14 - type: integer - keepMonthly: - default: 12 - type: integer - keepWeekly: - default: 6 - type: integer - keepYearly: - default: 12 - type: integer - type: object - schedule: - default: - backup: 30 3 * * * - check: 30 5 * * 1 - db: 30 3 * * * - prune: 30 1 * * 0 - properties: - backup: - default: 30 3 * * * - type: string - check: - default: 30 5 * * 1 - type: string - db: - default: 30 3 * * * - type: string - prune: - default: 30 1 * * 0 - type: string - type: object - secret_key: - default: s3-secret - type: string - secret_name: - default: backup-settings - type: string - use_barman: - default: false - type: boolean - type: object storage: default: postgres: @@ -400,6 +442,7 @@ options: size: 2Gi volume: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem description: Configure this app storage @@ -410,6 +453,7 @@ options: size: 2Gi volume: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem properties: @@ -432,6 +476,7 @@ options: volume: default: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem properties: @@ -442,84 +487,22 @@ options: - ReadOnlyMany - ReadWriteMany type: string + class: + default: '' + type: string size: default: 10Gi type: string type: default: Filesystem - enum: - - Filesystem - - Block type: string type: object type: object - redis: - default: - exporter: - enabled: true - examples: - - exporter: - enabled: true - properties: - exporter: - default: - enabled: true - properties: - enabled: - default: true - type: boolean - type: object - type: object - admin: - default: - name: nextcloud_admin - examples: - - name: nextcloud_admin - properties: - name: - default: nextcloud_admin - type: string - type: object app_group: default: '' examples: - '' type: string - hpa: - default: - avg-cpu: 50 - max-replicas: 5 - min-replicas: 1 - examples: - - avg-cpu: 50 - max-replicas: 5 - min-replicas: 1 - properties: - avg-cpu: - default: 50 - type: integer - max-replicas: - default: 5 - type: integer - min-replicas: - default: 1 - type: integer - type: object - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - domain_name: - default: your_company.com - examples: - - your_company.com - type: string - domain: - default: your-company - examples: - - your-company - type: string apps: default: audioplayer: false @@ -610,6 +593,26 @@ options: default: true type: boolean type: object + domain: + default: your-company + examples: + - your-company + type: string + sub_domain: + default: files + examples: + - files + type: string + postgres: + default: + replicas: 1 + examples: + - replicas: 1 + properties: + replicas: + default: 1 + type: integer + type: object dependencies: - dist: null category: share diff --git a/monitor/grafana/datas.tf b/monitor/grafana/datas.tf index 97a0d6e..591b91d 100644 --- a/monitor/grafana/datas.tf +++ b/monitor/grafana/datas.tf @@ -9,8 +9,20 @@ locals { "app.kubernetes.io/managed-by" = "vynil" "app.kubernetes.io/instance" = var.instance } + pvc_spec = merge({ + "accessModes" = [var.storage.volume.accessMode] + "volumeMode" = var.storage.volume.type + "resources" = { + "requests" = { + "storage" = "${var.storage.volume.size}" + } + } + }, var.storage.volume.class != "" ?{ + "storageClassName" = var.storage.volume.class + }:{}) } + data "kubernetes_secret_v1" "authentik" { metadata { name = "authentik" @@ -56,13 +68,7 @@ data "kustomization_overlay" "data" { name: grafana annotations: k8up.io/backup: "true" - spec: - accessModes: - - "${var.storage.volume.accessMode}" - volumeMode: Filesystem - resources: - requests: - storage: "${var.storage.volume.size}" + spec: ${jsonencode(local.pvc_spec)} EOF } patches { diff --git a/monitor/grafana/index.yaml b/monitor/grafana/index.yaml index b58e03b..8044cea 100644 --- a/monitor/grafana/index.yaml +++ b/monitor/grafana/index.yaml @@ -6,11 +6,84 @@ metadata: name: grafana description: null options: + storage: + default: + volume: + accessMode: ReadWriteOnce + class: '' + size: 10Gi + type: Filesystem + description: Configure this app storage + examples: + - volume: + accessMode: ReadWriteOnce + class: '' + size: 10Gi + type: Filesystem + properties: + volume: + default: + accessMode: ReadWriteOnce + class: '' + size: 10Gi + type: Filesystem + properties: + accessMode: + default: ReadWriteOnce + enum: + - ReadWriteOnce + - ReadOnlyMany + - ReadWriteMany + type: string + class: + default: '' + type: string + size: + default: 10Gi + type: string + type: + default: Filesystem + enum: + - Filesystem + - Block + type: string + type: object + type: object + ingress_class: + default: traefik + examples: + - traefik + type: string + sub_domain: + default: grafana + examples: + - grafana + type: string + 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: + - your_company.com + type: string + app_group: + default: monitor + examples: + - monitor + type: string + admin_name: + default: grafana_admin + examples: + - grafana_admin + type: string images: default: busybox: @@ -108,73 +181,6 @@ options: type: string type: object type: object - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - sub_domain: - default: grafana - examples: - - grafana - type: string - storage: - default: - volume: - accessMode: ReadWriteOnce - size: 10Gi - type: Filesystem - description: Configure this app storage - examples: - - volume: - accessMode: ReadWriteOnce - size: 10Gi - type: Filesystem - properties: - volume: - default: - accessMode: ReadWriteOnce - size: 10Gi - type: Filesystem - properties: - accessMode: - default: ReadWriteOnce - enum: - - ReadWriteOnce - - ReadOnlyMany - - ReadWriteMany - type: string - size: - default: 10Gi - type: string - type: - default: Filesystem - enum: - - Filesystem - - Block - type: string - type: object - type: object - app_group: - default: monitor - examples: - - monitor - type: string - domain_name: - default: your_company.com - examples: - - your_company.com - type: string - admin_name: - default: grafana_admin - examples: - - grafana_admin - type: string - ingress_class: - default: traefik - examples: - - traefik - type: string dependencies: [] providers: kubernetes: true diff --git a/monitor/loki/datas.tf b/monitor/loki/datas.tf index fe6f132..32c9304 100644 --- a/monitor/loki/datas.tf +++ b/monitor/loki/datas.tf @@ -7,6 +7,17 @@ locals { "app.kubernetes.io/managed-by" = "vynil" "app.kubernetes.io/instance" = var.instance } + pvc_spec = merge({ + "accessModes" = [var.storage.volume.accessMode] + "volumeMode" = var.storage.volume.type + "resources" = { + "requests" = { + "storage" = "${var.storage.volume.size}" + } + } + }, var.storage.volume.class != "" ?{ + "storageClassName" = var.storage.volume.class + }:{}) rb-patch = <<-EOF - op: replace path: /subjects/0/namespace @@ -58,13 +69,7 @@ data "kustomization_overlay" "data" { name: storage annotations: k8up.io/backup: "true" - spec: - accessModes: - - "${var.storage.volume.accessMode}" - volumeMode: Filesystem - resources: - requests: - storage: "${var.storage.volume.size}" + spec: ${jsonencode(local.pvc_spec)} EOF } } diff --git a/monitor/loki/index.yaml b/monitor/loki/index.yaml index d91ceed..d2d558b 100644 --- a/monitor/loki/index.yaml +++ b/monitor/loki/index.yaml @@ -10,18 +10,21 @@ options: default: volume: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem description: Configure this app storage examples: - volume: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem properties: volume: default: accessMode: ReadWriteOnce + class: '' size: 10Gi type: Filesystem properties: @@ -32,6 +35,9 @@ options: - ReadOnlyMany - ReadWriteMany type: string + class: + default: '' + type: string size: default: 10Gi type: string