From f443a9650d969978226c214d8a3ad79776e462b1 Mon Sep 17 00:00:00 2001 From: Gerard Wilkinson Date: Mon, 22 Mar 2021 11:54:55 +0000 Subject: [PATCH 1/4] Adding nodeSelector option to Helm Chart Signed-off-by: Gerard Wilkinson --- .../chart/backstage/templates/backend-deployment.yaml | 4 ++++ .../backstage/templates/frontend-deployment.yaml | 3 +++ .../backstage/templates/lighthouse-deployment.yaml | 4 ++++ contrib/chart/backstage/values.yaml | 11 +++++++++++ 4 files changed, 22 insertions(+) diff --git a/contrib/chart/backstage/templates/backend-deployment.yaml b/contrib/chart/backstage/templates/backend-deployment.yaml index 99ec955242..144fc93e62 100644 --- a/contrib/chart/backstage/templates/backend-deployment.yaml +++ b/contrib/chart/backstage/templates/backend-deployment.yaml @@ -63,6 +63,10 @@ spec: configMap: name: {{ include "backstage.fullname" . }}-app-config + {{- if .Values.global.nodeSelector }} + nodeSelector: {{- toYaml .Values.global.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.backend.enabled }} --- apiVersion: v1 diff --git a/contrib/chart/backstage/templates/frontend-deployment.yaml b/contrib/chart/backstage/templates/frontend-deployment.yaml index 5430ef041f..9c674cc160 100644 --- a/contrib/chart/backstage/templates/frontend-deployment.yaml +++ b/contrib/chart/backstage/templates/frontend-deployment.yaml @@ -43,6 +43,9 @@ spec: - name: app-config configMap: name: {{ include "backstage.fullname" . }}-app-config + {{- if .Values.global.nodeSelector }} + nodeSelector: {{- toYaml .Values.global.nodeSelector | nindent 8 }} + {{- end }} {{- if .Values.frontend.enabled }} --- apiVersion: v1 diff --git a/contrib/chart/backstage/templates/lighthouse-deployment.yaml b/contrib/chart/backstage/templates/lighthouse-deployment.yaml index 13bb8eadbb..d6e1ce19dd 100644 --- a/contrib/chart/backstage/templates/lighthouse-deployment.yaml +++ b/contrib/chart/backstage/templates/lighthouse-deployment.yaml @@ -59,6 +59,10 @@ spec: - name: postgres-ca configMap: name: {{ include "backstage.fullname" . }}-postgres-ca + + {{- if .Values.global.nodeSelector }} + nodeSelector: {{- toYaml .Values.global.nodeSelector | nindent 8 }} + {{- end }} --- apiVersion: v1 kind: Service diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 7926ebbc0a..4975f86753 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -69,6 +69,10 @@ global: postgresql: postgresqlUsername: backend-user caFilename: ca.crt + nodeSelector: {} + ## Speficy nodeSelector for multi-platform Kubernetes Services + ## nodeSelector: + ## kubernetes.io/os: linux postgresql: enabled: true @@ -81,6 +85,13 @@ postgresql: volumePermissions: enabled: true initdbScriptsSecret: backstage-postgresql-initdb + ## Speficy nodeSelector for multi-platform Kubernetes Services + ## master: + ## nodeSelector: + ## kubernetes.io/os: linux + ## slave: + ## nodeSelector: + ## kubernetes.io/os: linux appConfig: app: From d15f35fa88ff363ad9d63bd75b62dfa5f37b8723 Mon Sep 17 00:00:00 2001 From: Gerard Wilkinson Date: Mon, 22 Mar 2021 12:00:09 +0000 Subject: [PATCH 2/4] Adding docs for change Signed-off-by: Gerard Wilkinson --- contrib/chart/backstage/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index 96bfdb4351..90e998a169 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -236,6 +236,26 @@ Backend failed to start up Error: unable to verify the first certificate This error happens in the backend when it tries to connect to the configured PostgreSQL database and the specified CA is not correct. The solution is to make sure that the contents of the `configMap` that holds the certificate match the CA for the PostgreSQL instance. A workaround is to set `appConfig.backend.database.connection.ssl.rejectUnauthorized` to `false` in the chart's values. +#### Multi-Platform Kubernetes Services + +If you are running a multi-platform Kubernetes service with Windows and Linux nodes then you will need to apply a `nodeSelector` to the Helm chart to ensure that pods are scheduled onto the correct platform nodes. + +Add the following to your Helm values file: + +```yaml +global: + nodeSelector: + kubernetes.io/os: linux + +postgresql: + master: + nodeSelector: + kubernetes.io/os: linux + slave: + nodeSelector: + kubernetes.io/os: linux +``` + ## Uninstalling Backstage From 29dcd30e99b8f7c57cf4c46cad8eed709b3a777e Mon Sep 17 00:00:00 2001 From: Gerard Wilkinson Date: Mon, 22 Mar 2021 12:03:49 +0000 Subject: [PATCH 3/4] Removing commented lines as now documented instead Signed-off-by: Gerard Wilkinson --- contrib/chart/backstage/values.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 4975f86753..7b26d2bccd 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -70,9 +70,6 @@ global: postgresqlUsername: backend-user caFilename: ca.crt nodeSelector: {} - ## Speficy nodeSelector for multi-platform Kubernetes Services - ## nodeSelector: - ## kubernetes.io/os: linux postgresql: enabled: true @@ -85,13 +82,6 @@ postgresql: volumePermissions: enabled: true initdbScriptsSecret: backstage-postgresql-initdb - ## Speficy nodeSelector for multi-platform Kubernetes Services - ## master: - ## nodeSelector: - ## kubernetes.io/os: linux - ## slave: - ## nodeSelector: - ## kubernetes.io/os: linux appConfig: app: From 9f808f97c82551c407e01bf9e9ed6e23c6d23a32 Mon Sep 17 00:00:00 2001 From: Gerard Wilkinson Date: Mon, 22 Mar 2021 12:15:44 +0000 Subject: [PATCH 4/4] Clarification on documentation for postgres Helm chart Signed-off-by: Gerard Wilkinson --- contrib/chart/backstage/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index 90e998a169..7d04a2cf1e 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -245,8 +245,9 @@ Add the following to your Helm values file: ```yaml global: nodeSelector: - kubernetes.io/os: linux + kubernetes.io/os: linux +# If using Postgres Chart also add postgresql: master: nodeSelector: