From 1495f2f9e32ccf016607fa6e9eadd319a6aaa5cc Mon Sep 17 00:00:00 2001 From: Andrej Petras Date: Wed, 5 Jun 2024 19:47:39 +0200 Subject: [PATCH] feat: add nodeselector and tolerations --- helm/templates/_helpers.tpl | 4 ++-- helm/templates/deployment.yaml | 14 ++++++++++++++ helm/values.yaml | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index 90a366d..5fa2790 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -7,12 +7,12 @@ {{- end -}} {{- define "app.version" -}} - {{ .Values.image.tag }} + {{ .Values.app.image.tag }} {{- end -}} {{- define "app.labels.common" -}} version: {{ .Chart.Version | replace "+" "_" }} -adminer: {{ .Values.image.tag | quote }} +adminer: {{ .Values.app.image.tag | quote }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/name: {{ template "app.fullname" $ }} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 6247b5c..f4ff66d 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -18,6 +18,20 @@ spec: imagePullSecrets: - name: {{ .Values.imagePullSecrets }} {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: + {{- .Values.nodeSelector | toYaml | trim | nindent 8 }} + {{- else if .Values.global.nodeSelector }} + nodeSelector: + {{- .Values.global.nodeSelector | toYaml | trim | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: + {{- .Values.tolerations | toYaml | trim | nindent 8 }} + {{- else if .Values.global.tolerations }} + tolerations: + {{- .Values.global.tolerations | toYaml | trim | nindent 8 }} + {{- end }} containers: - name: {{ include "app.fullname" . }} image: {{ .Values.app.image.registry }}/{{ .Values.app.image.repository }}:{{ .Values.app.image.tag }} diff --git a/helm/values.yaml b/helm/values.yaml index c7f2a37..b60361b 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -3,9 +3,21 @@ global: # global host name default_url: + # node selector for the pods + nodeSelector: + + # tolerations for the pods + tolerations: + # Name of the instance, default {{ .Release.Name }}-{{ .Values.name | default .Chart.Name }} name: adminer +# node selector for the pods +nodeSelector: + +# tolerations for the pods +tolerations: + # service service: port: 8080 @@ -17,6 +29,16 @@ pod: imagePullPolicy: IfNotPresent +app: + # Application image + image: + # Docker registry + registry: "ghcr.io" + # Docker repository (application name) + repository: "change-me" + # Docker image tag (application version) + tag: "main" + # Route routing: # Enable or disable route