Commit 7f4906bd authored by sonicaj's avatar sonicaj

Properly disable host networking when chia ports are greater then or equal to 9000

parent 67f9f344
...@@ -3,6 +3,8 @@ kind: Deployment ...@@ -3,6 +3,8 @@ kind: Deployment
metadata: metadata:
name: {{ template "common.names.fullname" . }} name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels" . | nindent 4 }} labels: {{ include "common.labels" . | nindent 4 }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec: spec:
strategy: strategy:
type: {{ .Values.updateStrategy }} type: {{ .Values.updateStrategy }}
...@@ -14,7 +16,9 @@ spec: ...@@ -14,7 +16,9 @@ spec:
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
spec: spec:
# FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router # FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router
{{ if lt (.Values.service.nodePort | int) 9000 }}
hostNetwork: true hostNetwork: true
{{ end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
...@@ -27,7 +31,7 @@ spec: ...@@ -27,7 +31,7 @@ spec:
- name: chia-network - name: chia-network
protocol: TCP protocol: TCP
containerPort: 8444 containerPort: 8444
{{ if lt .Values.service.nodePort 9000 }} {{ if lt (.Values.service.nodePort | int) 9000 }}
hostPort: {{ .Values.service.nodePort }} hostPort: {{ .Values.service.nodePort }}
{{ end }} {{ end }}
{{ $envList := (default list .Values.environmentVariables) }} {{ $envList := (default list .Values.environmentVariables) }}
......
{{ $svc := .Values.service }} {{ $svc := .Values.service }}
{{ if ge $svc.nodePort 9000 }} {{ if ge ($svc.nodePort | int) 9000 }}
{{ $ports := list }} {{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "chia-network" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 8444) }} {{ $ports = mustAppend $ports (dict "name" "chia-network" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 8444) }}
{{ $params := . }} {{ $params := . }}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment