Skip to content

Commit

Permalink
Enable bringing custom selectors to ease migrations to the templates (#…
Browse files Browse the repository at this point in the history
…101)

* Enable bringing custom selectors to ease migrations to the templates

* Update charts/aspnetcore/templates/service.yaml

Co-authored-by: Tristan <[email protected]>

---------

Co-authored-by: Samuel Robillard <[email protected]>
Co-authored-by: Tristan <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2025
1 parent 1ba4693 commit c7eb54f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion charts/aspnetcore/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "aspnetcore.selectorLabels" . | nindent 6 }}
{{- if .Values.migration.existingSelectors.enabled }}
{{- toYaml .Values.migration.existingSelectors.selectors | nindent 6 }}
{{- else }}
{{ include "aspnetcore.selectorLabels" . | nindent 6 }}
{{- end }}
template:
metadata:
labels:
Expand Down
6 changes: 5 additions & 1 deletion charts/aspnetcore/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ spec:
protocol: TCP
name: http
selector:
{{- include "aspnetcore.selectorLabels" . | nindent 4 }}
{{- if .Values.migration.existingSelectors.enabled }}
{{- toYaml .Values.migration.existingSelectors.selectors | nindent 4 }}
{{- else }}
{{ include "aspnetcore.selectorLabels" . | nindent 4 }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/aspnetcore/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,11 @@ securityContext:
value: "30"
- name: net.ipv4.tcp_keepalive_probes
value: "8"

## Configure settings related to HELM chart migration.
## @param migration.existingSelectors.enabled Whether or not to use existing selectors for the deployment
## @param migration.existingSelectors.selectors A map of existing selectors to use for the deployment
migration:
existingSelectors:
enabled: false
selectors: {}

0 comments on commit c7eb54f

Please sign in to comment.