Commit a5b21a80 authored by sonicaj's avatar sonicaj

Allow specifying farmer port for chia application

parent 7f4906bd
...@@ -172,3 +172,11 @@ questions: ...@@ -172,3 +172,11 @@ questions:
max: 65535 max: 65535
default: 8444 default: 8444
required: true required: true
- variable: farmerPort
label: "Farmer Port to use for Chia"
schema:
type: int
min: 8000
max: 65535
default: 8447
required: true
...@@ -16,7 +16,7 @@ spec: ...@@ -16,7 +16,7 @@ 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 }} {{ if eq (include "hostNetworkingEnabled" .) "true" }}
hostNetwork: true hostNetwork: true
{{ end }} {{ end }}
containers: containers:
...@@ -31,9 +31,9 @@ spec: ...@@ -31,9 +31,9 @@ spec:
- name: chia-network - name: chia-network
protocol: TCP protocol: TCP
containerPort: 8444 containerPort: 8444
{{ if lt (.Values.service.nodePort | int) 9000 }} - name: chia-farmer
hostPort: {{ .Values.service.nodePort }} protocol: TCP
{{ end }} containerPort: 8447
{{ $envList := (default list .Values.environmentVariables) }} {{ $envList := (default list .Values.environmentVariables) }}
{{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }} {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }}
{{ $envList = mustAppend $envList (dict "name" "farmr" "value" $.Values.farmr_env) }} {{ $envList = mustAppend $envList (dict "name" "farmr" "value" $.Values.farmr_env) }}
......
{{/*
Formats volumeMount for Minio tls keys and trusted certs
*/}}
{{- define "hostNetworkingEnabled" -}}
{{- if or (lt (.Values.service.nodePort | int) 9000) (lt (.Values.service.farmerPort | int) 9000) -}}
{{- print "true" -}}
{{- else -}}
{{- print "false" -}}
{{- end -}}
{{- end -}}
{{/*
Formats volume for Minio tls keys and trusted certs
*/}}
{{- define "enableService" -}}
{{- if or (ge (.Values.service.nodePort | int) 9000) (ge (.Values.service.farmerPort | int) 9000) -}}
{{- print "true" -}}
{{- else -}}
{{- print "false" -}}
{{- end -}}
{{- end -}}
{{ if eq (include "enableService" .) "true" }}
{{ $svc := .Values.service }} {{ $svc := .Values.service }}
{{ if ge ($svc.nodePort | int) 9000 }}
{{ $ports := list }} {{ $ports := list }}
{{ if ge ($svc.nodePort | int) 9000 }}
{{ $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) }}
{{ end }}
{{ if ge ($svc.farmerPort | int) 9000 }}
{{ $ports = mustAppend $ports (dict "name" "chia-farmer" "port" $svc.farmerPort "nodePort" $svc.farmerPort "targetPort" 8447) }}
{{ end }}
{{ $params := . }} {{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} {{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ include "common.classes.service" $params }} {{ include "common.classes.service" $params }}
......
...@@ -13,3 +13,4 @@ image: ...@@ -13,3 +13,4 @@ image:
updateStrategy: Recreate updateStrategy: Recreate
service: service:
nodePort: 33121 nodePort: 33121
farmerPort: 33122
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