diff --git a/;wq b/;wq new file mode 100644 index 0000000..3ba430b --- /dev/null +++ b/;wq @@ -0,0 +1,19 @@ +--- +ext-database: + templates: + - | + --- + apiVersion: kinda.rocks/v1beta1 + kind: Database + metadata: + name: "{{ .Values.name }}" + spec: + secretName: "{{ .Values.name }}-creds" + instance: "{{ .Values.instance }}" + deletionProtected: false + backup: + enable: false + cron: 0 0 * * * + {{ if .Values.templates }} + check: check + {{- end }} diff --git a/badhouseplants/helmfile.yaml b/badhouseplants/helmfile.yaml index 479557f..450d7b0 100644 --- a/badhouseplants/helmfile.yaml +++ b/badhouseplants/helmfile.yaml @@ -104,7 +104,7 @@ releases: - <<: *woodpecker-ci installed: true - namespace: woodpecker + namespace: woodpecker-ci createNamespace: true bases: diff --git a/badhouseplants/values/values.woodpecker-ci.yaml b/badhouseplants/values/values.woodpecker-ci.yaml index 736abf2..5fa52b5 100644 --- a/badhouseplants/values/values.woodpecker-ci.yaml +++ b/badhouseplants/values/values.woodpecker-ci.yaml @@ -11,24 +11,35 @@ istio: hostname: ci.badhouseplants.net service: woodpecker-ci-server port: 80 +ext-database: + enabled: true + name: woodpecker-postgres16 + instance: postgres16 + credentials: + WOODPECKER_DATABASE_DATASOURCE: "postgres://{{ .Username }}:{{ .Password }}@{{ .Hostname }}:{{ .Port }}/{{ .Database }}?sslmode=disable" server: enabled: true env: WOODPECKER_GITEA: true WOODPECKER_GITEA_URL: https://git.badhouseplants.net + WOODPECKER_DATABASE_DRIVER: postgres WOODPECKER_GITEA_CLIENT: ab5e4687-a476-4668-9fbc-288d54095634 WOODPECKER_OPEN: true WOODPECKER_ADMIN: "woodpecker,allanger" WOODPECKER_HOST: "https://ci.badhouseplants.net" WOODPECKER_ESCALATE: true - extraSecretNamesForEnvFrom: [] + WOODPECKER_BACKEND_K8S_NAMESPACE: woodpecker-ci + WOODPECKER_BACKEND_K8S_STORAGE_CLASS: microk8s-hostpath + extraSecretNamesForEnvFrom: + - woodpecker-postgres16-creds agent: enabled: true extraSecretNamesForEnvFrom: [] env: WOODPECKER_SERVER: woodpecker-ci-server:9000 - WOODPECKER_BACKEND_K8S_VOLUME_SIZE: 1Gi - WOODPECKER_BACKEND_K8S_STORAGE_CLASS: + WOODPECKER_BACKEND_K8S_VOLUME_SIZE: 3Gi + WOODPECKER_BACKEND_K8S_NAMESPACE: woodpecker-ci + WOODPECKER_BACKEND_K8S_STORAGE_CLASS: microk8s-hostpath serviceAccount: create: true rbac: diff --git a/common/values.database.yaml b/common/values.database.yaml index 9680113..d5d0221 100644 --- a/common/values.database.yaml +++ b/common/values.database.yaml @@ -14,3 +14,12 @@ ext-database: backup: enable: false cron: 0 0 * * * + {{- if .Values.credentials }} + credentials: + templates: + {{- range $key, $value := .Values.credentials }} + - name: {{ $key }} + template: {{ $value }} + secret: true + {{- end }} + {{- end }} diff --git a/releases.yaml b/releases.yaml index 9860b3a..9ea207e 100644 --- a/releases.yaml +++ b/releases.yaml @@ -235,6 +235,7 @@ templates: chart: woodpecker/woodpecker version: 1.0.1 inherit: + - template: ext-database - template: default-env-values - template: default-env-secrets - template: ext-istio-resource