From 2c5c05556a0c858a58b657988b76369f769c1b19 Mon Sep 17 00:00:00 2001 From: Tim Collins Date: Mon, 28 Jun 2021 16:06:52 +0100 Subject: [PATCH 1/4] Allow for init containers --- charts/sorry-cypress/Chart.yaml | 2 +- charts/sorry-cypress/README.md | 3 +++ .../templates/deployment-api.yml | 6 ++++- .../templates/deployment-dashboard.yml | 6 ++++- .../templates/deployment-director.yml | 4 ++++ charts/sorry-cypress/values.yaml | 22 +++++++++++++++++++ 6 files changed, 40 insertions(+), 3 deletions(-) diff --git a/charts/sorry-cypress/Chart.yaml b/charts/sorry-cypress/Chart.yaml index 6d907dc..669bc7e 100644 --- a/charts/sorry-cypress/Chart.yaml +++ b/charts/sorry-cypress/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: sorry-cypress description: A Helm chart for Sorry Cypress type: application -version: 1.0.2 +version: 1.0.3 appVersion: 1.0.3 home: https://sorry-cypress.dev/ sources: diff --git a/charts/sorry-cypress/README.md b/charts/sorry-cypress/README.md index 141cf4a..43bf4c9 100644 --- a/charts/sorry-cypress/README.md +++ b/charts/sorry-cypress/README.md @@ -86,6 +86,7 @@ https://sorry-cypress.dev/api#configuration | `api.ingress.hosts[0].host` | Hostname to the service installation | `api.chart-example.local` | | `api.ingress.hosts[0].path` | Root path to the service installation | `/` | | `api.ingress.tls` | Ingress secrets for TLS certificates | `[]` | +| `api.initContainers` | Allows you to define init container(s) for the api pod | `[]` | ### Dashboard service @@ -113,6 +114,7 @@ https://sorry-cypress.dev/dashboard#configuration | `dashboard.ingress.hosts[0].host` | Hostname to the service installation | `dashboard.chart-example.local` | | `dashboard.ingress.hosts[0].path` | Root path to the service installation | `/` | | `dashboard.ingress.tls` | Ingress secrets for TLS certificates | `[]` | +| `dashboard.initContainers` | Allows you to define init container(s) for the dashboard pod | `[]` | ### Director service @@ -140,6 +142,7 @@ https://sorry-cypress.dev/director/configuration | `director.ingress.hosts[0].host` | Hostname to the service installation | `director.chart-example.local` | | `director.ingress.hosts[0].path` | Root path to the service installation | `/` | | `director.ingress.tls` | Ingress secrets for TLS certificates | `[]` | +| `director.initContainers` | Allows you to define init container(s) for the director pod | `[]` | ### Mongodb service diff --git a/charts/sorry-cypress/templates/deployment-api.yml b/charts/sorry-cypress/templates/deployment-api.yml index 5597dc7..3fb9204 100644 --- a/charts/sorry-cypress/templates/deployment-api.yml +++ b/charts/sorry-cypress/templates/deployment-api.yml @@ -64,4 +64,8 @@ spec: restartPolicy: Always serviceAccountName: "" volumes: null -{{- end }} \ No newline at end of file + {{- if .Values.api.initContainers }} + initContainers: + {{- include "common.tplvalues.render" (dict "value" .Values.api.initContainers "context" $) | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/sorry-cypress/templates/deployment-dashboard.yml b/charts/sorry-cypress/templates/deployment-dashboard.yml index a29d208..e75fedb 100644 --- a/charts/sorry-cypress/templates/deployment-dashboard.yml +++ b/charts/sorry-cypress/templates/deployment-dashboard.yml @@ -67,4 +67,8 @@ spec: restartPolicy: Always serviceAccountName: "" volumes: null -{{- end }} \ No newline at end of file + {{- if .Values.dashboard.initContainers }} + initContainers: + {{- include "common.tplvalues.render" (dict "value" .Values.api.initContainers "context" $) | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/sorry-cypress/templates/deployment-director.yml b/charts/sorry-cypress/templates/deployment-director.yml index fc113d7..b0225cf 100644 --- a/charts/sorry-cypress/templates/deployment-director.yml +++ b/charts/sorry-cypress/templates/deployment-director.yml @@ -111,3 +111,7 @@ spec: restartPolicy: Always serviceAccountName: "" volumes: null + {{- if .Values.director.initContainers }} + initContainers: + {{- include "common.tplvalues.render" (dict "value" .Values.api.initContainers "context" $) | nindent 8 }} + {{- end }} diff --git a/charts/sorry-cypress/values.yaml b/charts/sorry-cypress/values.yaml index 8bf9e34..df78a91 100644 --- a/charts/sorry-cypress/values.yaml +++ b/charts/sorry-cypress/values.yaml @@ -33,6 +33,16 @@ api: affinity: {} + # You can define any init container(s) here. + # This example checks that mongodb is running before allowing the api pod to start. + # If you wish to do this, you will need to modify your RBAC settings (not included in this Helm chart) + initContainers: [] + # - name: waitformongo + # image: groundnuty/k8s-wait-for + # args: + # - "pod" + # - "-lapp.kubernetes.io/name=mongodb" + service: port: 4000 @@ -89,6 +99,8 @@ dashboard: affinity: {} + initContainers: [] + # https://sorry-cypress.dev/dashboard#configuration environmentVariables: graphQlClientCredentials: "" @@ -143,6 +155,16 @@ director: affinity: {} + # You can define any init container(s) here. + # This example checks that mongodb is running before allowing the api pod to start. + # If you wish to do this, you will need to modify your RBAC settings (not included in this Helm chart) + initContainers: [] + # - name: waitformongo + # image: groundnuty/k8s-wait-for + # args: + # - "pod" + # - "-lapp.kubernetes.io/name=mongodb" + environmentVariables: # The "Run URL" in the Cypress client dashboardUrl: "" From 1ee8e289e8072e921eef0abd8c765a5535ce7260 Mon Sep 17 00:00:00 2001 From: Tim Collins Date: Wed, 28 Jul 2021 11:53:41 +0100 Subject: [PATCH 2/4] Remove readiness probe for director --- charts/sorry-cypress/templates/deployment-director.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/charts/sorry-cypress/templates/deployment-director.yml b/charts/sorry-cypress/templates/deployment-director.yml index b0225cf..93a62ed 100644 --- a/charts/sorry-cypress/templates/deployment-director.yml +++ b/charts/sorry-cypress/templates/deployment-director.yml @@ -98,14 +98,6 @@ spec: name: {{ include "sorry-cypress-helm.fullname" . }}-director ports: - containerPort: 1234 - readinessProbe: - httpGet: - path: / - port: 1234 - periodSeconds: 10 - timeoutSeconds: 5 - successThreshold: 2 - failureThreshold: 5 resources: {{- toYaml .Values.director.resources | nindent 10 }} restartPolicy: Always From 57a257dab1b6cfb9125acc81cf8bda0bf362cbf4 Mon Sep 17 00:00:00 2001 From: Tim Collins Date: Wed, 28 Jul 2021 11:55:11 +0100 Subject: [PATCH 3/4] Support v1.1.0 --- charts/sorry-cypress/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/sorry-cypress/Chart.yaml b/charts/sorry-cypress/Chart.yaml index 669bc7e..94683ab 100644 --- a/charts/sorry-cypress/Chart.yaml +++ b/charts/sorry-cypress/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: sorry-cypress description: A Helm chart for Sorry Cypress type: application -version: 1.0.3 -appVersion: 1.0.3 +version: 1.0.4 +appVersion: 1.1.0 home: https://sorry-cypress.dev/ sources: - https://github.com/sorry-cypress/sorry-cypress From 4a659512dcd7bf056cd568b276a6c136423c7c94 Mon Sep 17 00:00:00 2001 From: Tim Collins Date: Wed, 28 Jul 2021 12:14:25 +0100 Subject: [PATCH 4/4] Tweak some ci stuff? --- .github/workflows/lint-test.yml | 4 ++-- test.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 5a4735e..fadb308 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -17,7 +17,7 @@ jobs: - "kindest/node:v1.19.11" - "kindest/node:v1.18.19" - "kindest/node:v1.17.17" - fail-fast: false + fail-fast: true steps: - name: Checkout @@ -57,7 +57,7 @@ jobs: run: ct lint --all --debug --config lint.yaml - name: Create kind cluster - uses: helm/kind-action@v1.1.0 + uses: helm/kind-action@v1.2.0 if: steps.list-changed.outputs.changed == 'true' with: node_image: ${{ matrix.kubernetes_version }} diff --git a/test.yaml b/test.yaml index 88551a3..2b33fc3 100644 --- a/test.yaml +++ b/test.yaml @@ -6,4 +6,4 @@ chart-repos: - mongodb=https://charts.bitnami.com/bitnami chart-dirs: - charts -helm-extra-args: --timeout 600s +helm-extra-args: --timeout 300s