Merge pull request #495 from truenas/NAS-116530

NAS-116530 / 22.12 / Do not setup node port services when host network is enabled
This commit is contained in:
M. Rehan
2022-06-07 22:06:18 +05:00
committed by GitHub
80 changed files with 26 additions and 20 deletions

View File

@@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2201.0.0
version: 2206.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to

View File

@@ -352,6 +352,7 @@ questions:
description: "Specify ports of node and workload to forward traffic from node port to workload port"
schema:
type: list
show_if: [["hostNetwork", "=", false]]
items:
- variable: portForwarding
label: "Port Forwarding Configuration"

View File

@@ -1,4 +1,4 @@
{{- if .Values.portForwardingList }}
{{- if and (.Values.portForwardingList) (eq (include "hostNetworkingConfiguration" .) "false") }}
apiVersion: v1
kind: Service
metadata:
@@ -17,4 +17,4 @@ spec:
{{- end }}
selector:
{{- include "ix-chart.selectorLabels" . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -16,4 +16,4 @@ sources:
- https://github.com/minio/minio
- https://github.com/minio/charts
upstream_version: 8.0.5
version: 1.6.16
version: 1.6.17

View File

@@ -56,11 +56,11 @@ Retrieve scheme/protocol for minio
Retrieve command for minio application
*/}}
{{- define "minio.commandArgs" -}}
{{- $arg := "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server --console-address=':9001'" -}}
{{- $arg := (printf "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server --console-address=':%d'" (.Values.service.consolePort | int)) -}}
{{- if .Values.distributedMode -}}
{{- cat $arg (join " " (concat (.Values.distributedIps | default list) (.Values.extraArgs | default list))) -}}
{{- else -}}
{{- cat $arg ((concat (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
{{- cat $arg ((concat (list (printf "--address ':%d'" (.Values.service.nodePort | int))) (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
{{- end -}}
{{- end -}}

View File

@@ -46,9 +46,9 @@ spec:
- {{ include "minio.commandArgs" . }}
ports:
- name: api
containerPort: 9000
containerPort: {{ .Values.service.nodePort | int }}
- name: console
containerPort: 9001
containerPort: {{ .Values.service.consolePort | int }}
env:
{{ $secretName := (include "minio.secretName" .) }}
{{ $envList := (default list .Values.environmentVariables) }}

View File

@@ -1,11 +1,13 @@
{{ if eq (include "minio.hostNetworking" .) "false" }}
{{ $svc := .Values.service }}
{{ $selectors := list }}
{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }}
{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 9000) }}
{{ $ports = mustAppend $ports (dict "name" "console" "port" $svc.consolePort "nodePort" $svc.consolePort "targetPort" 9001) }}
{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" (.Values.service.nodePort | int)) }}
{{ $ports = mustAppend $ports (dict "name" "console" "port" $svc.consolePort "nodePort" $svc.consolePort "targetPort" (.Values.service.consolePort | int)) }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ $_1 := set .Values "extraSelectorLabels" $selectors }}
{{ include "common.classes.service" $params }}
{{ end }}

View File

@@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2201.0.0
version: 2206.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to

View File

@@ -352,6 +352,7 @@ questions:
description: "Specify ports of node and workload to forward traffic from node port to workload port"
schema:
type: list
show_if: [["hostNetwork", "=", false]]
items:
- variable: portForwarding
label: "Port Forwarding Configuration"

View File

@@ -1,4 +1,4 @@
{{- if .Values.portForwardingList }}
{{- if and (.Values.portForwardingList) (eq (include "hostNetworkingConfiguration" .) "false") }}
apiVersion: v1
kind: Service
metadata:
@@ -17,4 +17,4 @@ spec:
{{- end }}
selector:
{{- include "ix-chart.selectorLabels" . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -16,4 +16,4 @@ sources:
- https://github.com/minio/minio
- https://github.com/minio/charts
upstream_version: 8.0.5
version: 1.6.16
version: 1.6.17

View File

@@ -56,11 +56,11 @@ Retrieve scheme/protocol for minio
Retrieve command for minio application
*/}}
{{- define "minio.commandArgs" -}}
{{- $arg := "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server --console-address=':9001'" -}}
{{- $arg := (printf "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server --console-address=':%d'" (.Values.service.consolePort | int)) -}}
{{- if .Values.distributedMode -}}
{{- cat $arg (join " " (concat (.Values.distributedIps | default list) (.Values.extraArgs | default list))) -}}
{{- else -}}
{{- cat $arg ((concat (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
{{- cat $arg ((concat (list (printf "--address ':%d'" (.Values.service.nodePort | int))) (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
{{- end -}}
{{- end -}}

View File

@@ -46,9 +46,9 @@ spec:
- {{ include "minio.commandArgs" . }}
ports:
- name: api
containerPort: 9000
containerPort: {{ .Values.service.nodePort | int }}
- name: console
containerPort: 9001
containerPort: {{ .Values.service.consolePort | int }}
env:
{{ $secretName := (include "minio.secretName" .) }}
{{ $envList := (default list .Values.environmentVariables) }}

View File

@@ -1,11 +1,13 @@
{{ if eq (include "minio.hostNetworking" .) "false" }}
{{ $svc := .Values.service }}
{{ $selectors := list }}
{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }}
{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 9000) }}
{{ $ports = mustAppend $ports (dict "name" "console" "port" $svc.consolePort "nodePort" $svc.consolePort "targetPort" 9001) }}
{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" (.Values.service.nodePort | int)) }}
{{ $ports = mustAppend $ports (dict "name" "console" "port" $svc.consolePort "nodePort" $svc.consolePort "targetPort" (.Values.service.consolePort | int)) }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ $_1 := set .Values "extraSelectorLabels" $selectors }}
{{ include "common.classes.service" $params }}
{{ end }}