Skip to content

Commit

Permalink
Remove versions from matchLabels in helm chart (#150)
Browse files Browse the repository at this point in the history
Despite helm's recommendations, versions should *not* be included in
`matchLabels` in deployments, as they're immutable once created.
Including versions or other frequently changing things in `matchLabels`
means that `helm upgrade` will fail if the chart/app version increments,
as the `matchLabels` cannot be updated.

[ci skip]
  • Loading branch information
jcrist authored Oct 8, 2019
1 parent 6bf4f1b commit bccc3a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions resources/helm/dask-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Match labels
*/}}
{{- define "dask-gateway.matchLabels" -}}
app.kubernetes.io/name: {{ include "dask-gateway.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
replicas: 1
selector:
matchLabels:
{{- include "dask-gateway.labels" . | nindent 6 }}
{{- include "dask-gateway.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: gateway
template:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
replicas: 1
selector:
matchLabels:
{{- include "dask-gateway.labels" . | nindent 6 }}
{{- include "dask-gateway.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: scheduler-proxy
template:
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
replicas: 1
selector:
matchLabels:
{{- include "dask-gateway.labels" . | nindent 6 }}
{{- include "dask-gateway.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: web-proxy
template:
metadata:
Expand Down

0 comments on commit bccc3a0

Please sign in to comment.