From 5dc3b65dba2ed1cbe050839f229998565eb0a090 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 19 Jun 2023 08:30:27 +0200 Subject: [PATCH] Added WPC self-registration --- .gitlab-ci.yml | 2 +- Chart/Chart.yaml | 2 +- Chart/templates/externalsecret.yaml | 3 +++ Chart/templates/job.yaml | 23 +++++++++++++++++++++++ Chart/values.yaml | 4 ++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Chart/templates/job.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ed9b1b..22f04bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - HELM_CHART_VERSION: "0.6.7" + HELM_CHART_VERSION: "0.6.8" stages: - deploy diff --git a/Chart/Chart.yaml b/Chart/Chart.yaml index 2af1ba0..2b99ae2 100644 --- a/Chart/Chart.yaml +++ b/Chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: wordyne description: Helm chart for deploying pre-built website containers to kubernetes clusters type: application -version: "0.5.3" +version: "0.6.8" appVersion: "6.2.2" diff --git a/Chart/templates/externalsecret.yaml b/Chart/templates/externalsecret.yaml index 2f164a2..6dc53cb 100644 --- a/Chart/templates/externalsecret.yaml +++ b/Chart/templates/externalsecret.yaml @@ -29,6 +29,9 @@ spec: - secretKey: SMTP_HOST remoteRef: key: secret/SMTP-HOST + - secretKey: WPC_REGISTRATION_SECRET + remoteRef: + key: secret/WPC-REGISTRATION-SECRET --- apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret diff --git a/Chart/templates/job.yaml b/Chart/templates/job.yaml new file mode 100644 index 0000000..f76e87e --- /dev/null +++ b/Chart/templates/job.yaml @@ -0,0 +1,23 @@ +{{- if -not .Values.site.skipWPCRegistration | default "false" }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "..fullname" . }}-wpc-reg + labels: + {{- include "..labels" . | nindent 4 }} + cloudyne.systems/component: site +spec: + template: + spec: + containers: + - name: register-wpc + image: cloudyne.azurecr.io/register-wpc:latest + command: ["python3", "/app/register-wpc.py"] + restartPolicy: Never + imagePullSecrets: + - name: pull-secret + envFrom: + - configMapRef: + name: {{ include "..fullname" . }}-env + backoffLimit: 4 +{{- end }} \ No newline at end of file diff --git a/Chart/values.yaml b/Chart/values.yaml index d639c42..2a8ea83 100644 --- a/Chart/values.yaml +++ b/Chart/values.yaml @@ -49,6 +49,10 @@ storage: # Default: - # container: "company-tld" + # Skip WPC Auto-registration + # Default: false + # skipWPCRegistration: false + # WP Content Folders wpContent: - uploads