diff --git a/apps/woodpecker/config_server.tf b/apps/woodpecker/config_server.tf index 1a57af2..48059ba 100644 --- a/apps/woodpecker/config_server.tf +++ b/apps/woodpecker/config_server.tf @@ -15,3 +15,19 @@ resource "kubectl_manifest" "server_config" { WOODPECKER_MAX_PIPELINE_TIMEOUT: "${var.timeouts.max}" EOF } +resource "kubectl_manifest" "server_start" { + yaml_body = <<-EOF + apiVersion: v1 + kind: ConfigMap + metadata: + name: "${var.instance}-${var.component}-server-start" + namespace: "${var.namespace}" + labels: ${jsonencode(local.common-labels)} + data: + "start.sh": |- + #!/bin/ash + cp /etc/local-ca/ca.crt /usr/local/share/ca-certificates/ + update-ca-certificates + /bin/woodpecker-server "$@" + EOF +} diff --git a/apps/woodpecker/datas.tf b/apps/woodpecker/datas.tf index a2b49eb..3092251 100644 --- a/apps/woodpecker/datas.tf +++ b/apps/woodpecker/datas.tf @@ -157,6 +157,7 @@ data "kustomization_overlay" "data" { - name: server image: "${var.images.server.registry}/${var.images.server.repository}:${var.images.server.tag}" imagePullPolicy: "${var.images.server.pull_policy}" + command: "/usr/local/bin/start.sh" env: - name: WOODPECKER_ADMIN value: "${var.admin-users}" @@ -171,6 +172,22 @@ data "kustomization_overlay" "data" { name: "${var.component}-${var.instance}-gitea" - configMapRef: name: "${var.instance}-${var.component}-server" + volumeMounts: + - name: certs + mountPath: /etc/local-ca + readOnly: true + - name: config + mountPath: "/usr/local/bin/start.sh" + subPath: "start.sh" + volumes: + - name: config + configMap: + name: "${var.instance}-${var.component}-server-start" + defaultMode: 0777 + - name: certs + secret: + secretName: "${var.instance}-cert" + defaultMode: 0444 volumeClaimTemplates: - metadata: name: data diff --git a/apps/woodpecker/index.yaml b/apps/woodpecker/index.yaml index de7c04b..48d30d5 100644 --- a/apps/woodpecker/index.yaml +++ b/apps/woodpecker/index.yaml @@ -6,31 +6,101 @@ metadata: name: woodpecker description: null options: - domain_name: - default: your_company.com + ingress_class: + default: traefik examples: - - your_company.com + - traefik type: string - sub_domain: - default: ci + storage: + default: + agent: + size: 10Gi + volume: + accessMode: ReadWriteOnce + class: '' + size: 10Gi + type: Filesystem + description: Configure this app storage examples: - - ci + - agent: + size: 10Gi + volume: + accessMode: ReadWriteOnce + class: '' + size: 10Gi + type: Filesystem + properties: + agent: + default: + size: 10Gi + properties: + size: + default: 10Gi + type: string + type: object + 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 + timeouts: + default: + default: '60' + max: '120' + examples: + - default: '60' + max: '120' + properties: + default: + default: '60' + type: string + max: + default: '120' + type: string + type: object + admin-users: + default: woodpecker,admin + examples: + - woodpecker,admin type: string 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 - app_group: - default: dev - examples: - - dev - type: string images: default: agent: @@ -128,85 +198,15 @@ options: type: string type: object type: object - storage: - default: - agent: - size: 10Gi - volume: - accessMode: ReadWriteOnce - class: '' - size: 10Gi - type: Filesystem - description: Configure this app storage + sub_domain: + default: ci examples: - - agent: - size: 10Gi - volume: - accessMode: ReadWriteOnce - class: '' - size: 10Gi - type: Filesystem - properties: - agent: - default: - size: 10Gi - properties: - size: - default: 10Gi - type: string - type: object - 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 - timeouts: - default: - default: '60' - max: '120' - examples: - - default: '60' - max: '120' - properties: - default: - default: '60' - type: string - max: - default: '120' - type: string - type: object - ingress_class: - default: traefik - examples: - - traefik + - ci type: string - admin-users: - default: woodpecker,admin + app_group: + default: dev examples: - - woodpecker,admin + - dev type: string dependencies: - dist: null @@ -220,6 +220,7 @@ providers: authentik: true kubectl: true postgresql: null + mysql: null restapi: null http: null gitea: true