Skip to content

Commit

Permalink
feat: add nodeselector and tolerations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Jun 5, 2024
1 parent f0c1f9f commit 1495f2f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" $ }}
Expand Down
14 changes: 14 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
22 changes: 22 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1495f2f

Please sign in to comment.