diff --git a/deploy/kubernetes/console/templates/config-init.yaml b/deploy/kubernetes/console/templates/config-init.yaml index 6313d3ab8c..4653fa4184 100644 --- a/deploy/kubernetes/console/templates/config-init.yaml +++ b/deploy/kubernetes/console/templates/config-init.yaml @@ -94,6 +94,10 @@ spec: {{ toYaml .Values.console.podExtraLabels | nindent 8 }} {{- end }} spec: +{{- if .Values.configInit }} + nodeSelector: +{{ toYaml .Values.configInit.nodeSelector | indent 8 }} +{{- end }} containers: - env: - name: "STRATOS_VOLUME_MIGRATION" @@ -170,6 +174,10 @@ spec: app.kubernetes.io/version: "{{ .Chart.AppVersion }}" helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" spec: +{{- if .Values.configInit }} + nodeSelector: +{{ toYaml .Values.configInit.nodeSelector | indent 8 }} +{{- end }} containers: - env: - name: "NAMESPACE" diff --git a/deploy/kubernetes/console/templates/database.yaml b/deploy/kubernetes/console/templates/database.yaml index 45af491bca..3ce1c6026a 100644 --- a/deploy/kubernetes/console/templates/database.yaml +++ b/deploy/kubernetes/console/templates/database.yaml @@ -49,6 +49,10 @@ spec: {{ toYaml .Values.console.podExtraLabels | nindent 8 }} {{- end}} spec: +{{- if .Values.mariadb }} + nodeSelector: +{{ toYaml .Values.mariadb.nodeSelector | indent 8 }} +{{- end }} containers: - name: mariadb image: {{.Values.kube.registry.hostname}}/{{.Values.kube.organization}}/{{.Values.images.mariadb}}:{{.Values.consoleVersion}} diff --git a/deploy/kubernetes/console/templates/deployment.yaml b/deploy/kubernetes/console/templates/deployment.yaml index 0be76b839b..bd8990ac3c 100644 --- a/deploy/kubernetes/console/templates/deployment.yaml +++ b/deploy/kubernetes/console/templates/deployment.yaml @@ -47,6 +47,10 @@ spec: {{ toYaml .Values.console.podExtraLabels | indent 8 }} {{- end }} spec: +{{- if .Values.console }} + nodeSelector: +{{ toYaml .Values.console.nodeSelector | indent 8 }} +{{- end }} containers: - image: {{.Values.kube.registry.hostname}}/{{.Values.kube.organization}}/{{.Values.images.console}}:{{.Values.consoleVersion}} imagePullPolicy: {{.Values.imagePullPolicy}} diff --git a/deploy/kubernetes/console/tests/config_init_test.yaml b/deploy/kubernetes/console/tests/config_init_test.yaml new file mode 100644 index 0000000000..85778e7267 --- /dev/null +++ b/deploy/kubernetes/console/tests/config_init_test.yaml @@ -0,0 +1,12 @@ +suite: test stratos configInit +templates: + - config-init.yaml +tests: + - it: should set kubernetes.io/arch if configInit.nodeSelector.kubernetes.io/arch is set + set: + configInit.nodeSelector.kubernetes.io/arch: amd64 + asserts: + - equal: + path: spec.template.spec.nodeSelector.kubernetes.io/arch + value: amd64 + documentIndex: 3 \ No newline at end of file diff --git a/deploy/kubernetes/console/tests/database-test.yaml b/deploy/kubernetes/console/tests/database-test.yaml new file mode 100644 index 0000000000..be52ea6bb9 --- /dev/null +++ b/deploy/kubernetes/console/tests/database-test.yaml @@ -0,0 +1,12 @@ +suite: test stratos database +templates: + - database.yaml +tests: + - it: should set kubernetes.io/arch if mariadb.nodeSelector.kubernetes.io/arch is set + set: + mariadb.nodeSelector.kubernetes.io/arch: amd64 + asserts: + - equal: + path: spec.template.spec.nodeSelector.kubernetes.io/arch + value: amd64 + documentIndex: 0 \ No newline at end of file diff --git a/deploy/kubernetes/console/tests/deployment_test.yaml b/deploy/kubernetes/console/tests/deployment_test.yaml index b451ba5a3a..9aa6137c08 100644 --- a/deploy/kubernetes/console/tests/deployment_test.yaml +++ b/deploy/kubernetes/console/tests/deployment_test.yaml @@ -67,3 +67,11 @@ tests: content: name: AUTO_REG_CF_URL value: https://autoreg.test.com + - it: should set kubernetes.io/arch if console.nodeSelector.kubernetes.io/arch is set + set: + console.nodeSelector.kubernetes.io/arch: amd64 + asserts: + - equal: + path: spec.template.spec.nodeSelector.kubernetes.io/arch + value: amd64 + documentIndex: 0 \ No newline at end of file