This commit is contained in:
2023-10-29 08:53:39 +01:00
parent 1ca64229ed
commit 47a6fc61fa
3 changed files with 84 additions and 40 deletions

View File

@@ -13,7 +13,6 @@ locals {
data "kustomization_overlay" "data" { data "kustomization_overlay" "data" {
namespace = var.namespace namespace = var.namespace
common_labels = local.common-labels common_labels = local.common-labels
depends_on = [kubectl_manifest.server_config, kubectl_manifest.prj_secret, kubernetes_secret_v1.oauth2-client-gitea]
resources = [for file in fileset(path.module, "*.yaml"): file if file != "index.yaml"] resources = [for file in fileset(path.module, "*.yaml"): file if file != "index.yaml"]
patches { patches {
target { target {

View File

@@ -6,11 +6,36 @@ metadata:
name: woodpecker name: woodpecker
description: null description: null
options: options:
issuer: domain-name:
default: letsencrypt-prod default: your_company.com
examples: examples:
- letsencrypt-prod - your_company.com
type: string type: string
domain:
default: your-company
examples:
- your-company
type: string
storage-agent:
default:
size: 10Gi
storageClass: ''
writeMany: 'false'
examples:
- size: 10Gi
storageClass: ''
writeMany: 'false'
properties:
size:
default: 10Gi
type: string
storageClass:
default: ''
type: string
writeMany:
default: 'false'
type: string
type: object
storage-server: storage-server:
default: default:
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
@@ -30,15 +55,10 @@ options:
default: 10Gi default: 10Gi
type: string type: string
type: object type: object
ingress-class: issuer:
default: traefik default: letsencrypt-prod
examples: examples:
- traefik - letsencrypt-prod
type: string
sub-domain:
default: ci
examples:
- ci
type: string type: string
images: images:
default: default:
@@ -137,35 +157,10 @@ options:
type: string type: string
type: object type: object
type: object type: object
domain-name: sub-domain:
default: your_company.com default: ci
examples: examples:
- your_company.com - ci
type: string
storage-agent:
default:
size: 10Gi
storageClass: ''
writeMany: 'false'
examples:
- size: 10Gi
storageClass: ''
writeMany: 'false'
properties:
size:
default: 10Gi
type: string
storageClass:
default: ''
type: string
writeMany:
default: 'false'
type: string
type: object
domain:
default: your-company
examples:
- your-company
type: string type: string
timeouts: timeouts:
default: default:
@@ -182,6 +177,11 @@ options:
default: '120' default: '120'
type: string type: string
type: object type: object
ingress-class:
default: traefik
examples:
- traefik
type: string
dependencies: dependencies:
- dist: null - dist: null
category: apps category: apps

View File

@@ -0,0 +1,45 @@
# first loop through resources in ids_prio[0]
resource "kustomization_resource" "pre" {
for_each = data.kustomization_overlay.data.ids_prio[0]
manifest = (
contains(["_/Secret"], regex("(?P<group_kind>.*/.*)/.*/.*", each.value)["group_kind"])
? sensitive(data.kustomization_overlay.data.manifests[each.value])
: data.kustomization_overlay.data.manifests[each.value]
)
}
# then loop through resources in ids_prio[1]
# and set an explicit depends_on on kustomization_resource.pre
# wait 2 minutes for any deployment or daemonset to become ready
resource "kustomization_resource" "main" {
for_each = data.kustomization_overlay.data.ids_prio[1]
manifest = (
contains(["_/Secret"], regex("(?P<group_kind>.*/.*)/.*/.*", each.value)["group_kind"])
? sensitive(data.kustomization_overlay.data.manifests[each.value])
: data.kustomization_overlay.data.manifests[each.value]
)
wait = true
timeouts {
create = "5m"
update = "5m"
}
depends_on = [kustomization_resource.pre, kubectl_manifest.server_config, kubectl_manifest.prj_secret, kubernetes_secret_v1.oauth2-client-gitea]
}
# finally, loop through resources in ids_prio[2]
# and set an explicit depends_on on kustomization_resource.main
resource "kustomization_resource" "post" {
for_each = data.kustomization_overlay.data.ids_prio[2]
manifest = (
contains(["_/Secret"], regex("(?P<group_kind>.*/.*)/.*/.*", each.value)["group_kind"])
? sensitive(data.kustomization_overlay.data.manifests[each.value])
: data.kustomization_overlay.data.manifests[each.value]
)
depends_on = [kustomization_resource.main]
}