diff --git a/test/chia/1.3.18/questions.yaml b/test/chia/1.3.18/questions.yaml index d2e2e71a7b..74004f86d2 100644 --- a/test/chia/1.3.18/questions.yaml +++ b/test/chia/1.3.18/questions.yaml @@ -5,6 +5,8 @@ groups: description: "Configure farmr.net support" - name: "Chia Environment Variables" description: "Set the environment that will be visible to the container" + - name: "Networking" + description: "Configure networking for Chia container" portals: web_portal: @@ -153,3 +155,20 @@ questions: label: "Value" schema: type: string + + - variable: service + description: "Networking Configuration" + label: "Networking Configuration" + group: "Networking" + schema: + type: dict + required: true + attrs: + - variable: nodePort + label: "Node Port to use for Chia" + schema: + type: int + min: 8000 + max: 65535 + default: 8444 + required: true diff --git a/test/chia/1.3.18/templates/deployment.yaml b/test/chia/1.3.18/templates/deployment.yaml index 83eb2a02c6..4af5e243ee 100644 --- a/test/chia/1.3.18/templates/deployment.yaml +++ b/test/chia/1.3.18/templates/deployment.yaml @@ -27,7 +27,9 @@ spec: - name: chia-network protocol: TCP containerPort: 8444 - hostPort: 8444 + {{ if lt .Values.service.nodePort 9000 }} + hostPort: {{ .Values.service.nodePort }} + {{ end }} {{ $envList := (default list .Values.environmentVariables) }} {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }} {{ $envList = mustAppend $envList (dict "name" "farmr" "value" $.Values.farmr_env) }} diff --git a/test/chia/1.3.18/templates/service.yaml b/test/chia/1.3.18/templates/service.yaml new file mode 100644 index 0000000000..ff64c4841f --- /dev/null +++ b/test/chia/1.3.18/templates/service.yaml @@ -0,0 +1,8 @@ +{{ $svc := .Values.service }} +{{ if ge $svc.nodePort 9000 }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "chia-network" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 8444) }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} +{{ include "common.classes.service" $params }} +{{ end }} diff --git a/test/chia/1.3.18/test_values.yaml b/test/chia/1.3.18/test_values.yaml index 448ef92450..b808f454a0 100644 --- a/test/chia/1.3.18/test_values.yaml +++ b/test/chia/1.3.18/test_values.yaml @@ -11,3 +11,5 @@ image: repository: ixsystems/chia-docker tag: v1.2.8 updateStrategy: Recreate +service: + nodePort: 33121