Add support for hostPort in Deployment

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-03-14 18:24:46 -03:00
parent 4b78884fc4
commit 19c4c5652d
3 changed files with 11 additions and 8 deletions

View file

@ -134,8 +134,8 @@ spec:
- name: {{ $key }}
containerPort: {{ $value }}
protocol: TCP
{{- if $.Values.controller.daemonset.useHostPort }}
hostPort: {{ index $.Values.controller.daemonset.hostPorts $key | default $value }}
{{- if $.Values.controller.useHostPort }}
hostPort: {{ index $.Values.controller.hostPorts $key | default $value }}
{{- end }}
{{- end }}
{{- if .Values.controller.metrics.enabled }}
@ -152,7 +152,7 @@ spec:
- name: {{ $key }}-tcp
containerPort: {{ $key }}
protocol: TCP
{{- if $.Values.controller.daemonset.useHostPort }}
{{- if $.Values.controller.useHostPort }}
hostPort: {{ $key }}
{{- end }}
{{- end }}
@ -160,7 +160,7 @@ spec:
- name: {{ $key }}-udp
containerPort: {{ $key }}
protocol: UDP
{{- if $.Values.controller.daemonset.useHostPort }}
{{- if $.Values.controller.useHostPort }}
hostPort: {{ $key }}
{{- end }}
{{- end }}

View file

@ -137,6 +137,9 @@ spec:
- name: {{ $key }}
containerPort: {{ $value }}
protocol: TCP
{{- if $.Values.controller.useHostPort }}
hostPort: {{ index $.Values.controller.hostPorts $key | default $value }}
{{- end }}
{{- end }}
{{- if .Values.controller.metrics.enabled }}
- name: metrics