From 103cd3356d4f83467c5c32dc15b4542e1d1f7f62 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Thu, 7 Oct 2021 18:45:46 +0500 Subject: [PATCH 1/6] Bump chia app version --- test/chia/{1.3.17 => 1.3.18}/.helmignore | 0 test/chia/{1.3.17 => 1.3.18}/Chart.yaml | 2 +- test/chia/{1.3.17 => 1.3.18}/README.md | 0 test/chia/{1.3.17 => 1.3.18}/app-readme.md | 0 .../{1.3.17 => 1.3.18}/charts/common-2105.0.0.tgz | Bin test/chia/{1.3.17 => 1.3.18}/default_values.yaml | 0 test/chia/{1.3.17 => 1.3.18}/ix_values.yaml | 0 test/chia/{1.3.17 => 1.3.18}/questions.yaml | 0 test/chia/{1.3.17 => 1.3.18}/requirements.lock | 0 .../{1.3.17 => 1.3.18}/templates/deployment.yaml | 0 .../templates/generate-mnemonic.yaml | 0 .../templates/mnemonic-configmap.yaml | 0 test/chia/{1.3.17 => 1.3.18}/test_values.yaml | 0 test/chia/{1.3.17 => 1.3.18}/values.yaml | 0 14 files changed, 1 insertion(+), 1 deletion(-) rename test/chia/{1.3.17 => 1.3.18}/.helmignore (100%) rename test/chia/{1.3.17 => 1.3.18}/Chart.yaml (96%) rename test/chia/{1.3.17 => 1.3.18}/README.md (100%) rename test/chia/{1.3.17 => 1.3.18}/app-readme.md (100%) rename test/chia/{1.3.17 => 1.3.18}/charts/common-2105.0.0.tgz (100%) rename test/chia/{1.3.17 => 1.3.18}/default_values.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/ix_values.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/questions.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/requirements.lock (100%) rename test/chia/{1.3.17 => 1.3.18}/templates/deployment.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/templates/generate-mnemonic.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/templates/mnemonic-configmap.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/test_values.yaml (100%) rename test/chia/{1.3.17 => 1.3.18}/values.yaml (100%) diff --git a/test/chia/1.3.17/.helmignore b/test/chia/1.3.18/.helmignore similarity index 100% rename from test/chia/1.3.17/.helmignore rename to test/chia/1.3.18/.helmignore diff --git a/test/chia/1.3.17/Chart.yaml b/test/chia/1.3.18/Chart.yaml similarity index 96% rename from test/chia/1.3.17/Chart.yaml rename to test/chia/1.3.18/Chart.yaml index 6ea63093df..2aa2e9603f 100644 --- a/test/chia/1.3.17/Chart.yaml +++ b/test/chia/1.3.18/Chart.yaml @@ -15,4 +15,4 @@ name: chia sources: - https://github.com/Chia-Network/chia-blockchain - https://github.com/orgs/chia-network/packages/container/package/chia -version: 1.3.17 +version: 1.3.18 diff --git a/test/chia/1.3.17/README.md b/test/chia/1.3.18/README.md similarity index 100% rename from test/chia/1.3.17/README.md rename to test/chia/1.3.18/README.md diff --git a/test/chia/1.3.17/app-readme.md b/test/chia/1.3.18/app-readme.md similarity index 100% rename from test/chia/1.3.17/app-readme.md rename to test/chia/1.3.18/app-readme.md diff --git a/test/chia/1.3.17/charts/common-2105.0.0.tgz b/test/chia/1.3.18/charts/common-2105.0.0.tgz similarity index 100% rename from test/chia/1.3.17/charts/common-2105.0.0.tgz rename to test/chia/1.3.18/charts/common-2105.0.0.tgz diff --git a/test/chia/1.3.17/default_values.yaml b/test/chia/1.3.18/default_values.yaml similarity index 100% rename from test/chia/1.3.17/default_values.yaml rename to test/chia/1.3.18/default_values.yaml diff --git a/test/chia/1.3.17/ix_values.yaml b/test/chia/1.3.18/ix_values.yaml similarity index 100% rename from test/chia/1.3.17/ix_values.yaml rename to test/chia/1.3.18/ix_values.yaml diff --git a/test/chia/1.3.17/questions.yaml b/test/chia/1.3.18/questions.yaml similarity index 100% rename from test/chia/1.3.17/questions.yaml rename to test/chia/1.3.18/questions.yaml diff --git a/test/chia/1.3.17/requirements.lock b/test/chia/1.3.18/requirements.lock similarity index 100% rename from test/chia/1.3.17/requirements.lock rename to test/chia/1.3.18/requirements.lock diff --git a/test/chia/1.3.17/templates/deployment.yaml b/test/chia/1.3.18/templates/deployment.yaml similarity index 100% rename from test/chia/1.3.17/templates/deployment.yaml rename to test/chia/1.3.18/templates/deployment.yaml diff --git a/test/chia/1.3.17/templates/generate-mnemonic.yaml b/test/chia/1.3.18/templates/generate-mnemonic.yaml similarity index 100% rename from test/chia/1.3.17/templates/generate-mnemonic.yaml rename to test/chia/1.3.18/templates/generate-mnemonic.yaml diff --git a/test/chia/1.3.17/templates/mnemonic-configmap.yaml b/test/chia/1.3.18/templates/mnemonic-configmap.yaml similarity index 100% rename from test/chia/1.3.17/templates/mnemonic-configmap.yaml rename to test/chia/1.3.18/templates/mnemonic-configmap.yaml diff --git a/test/chia/1.3.17/test_values.yaml b/test/chia/1.3.18/test_values.yaml similarity index 100% rename from test/chia/1.3.17/test_values.yaml rename to test/chia/1.3.18/test_values.yaml diff --git a/test/chia/1.3.17/values.yaml b/test/chia/1.3.18/values.yaml similarity index 100% rename from test/chia/1.3.17/values.yaml rename to test/chia/1.3.18/values.yaml From 67f9f344e43e21633c00d60ed45cb1e96b398537 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Thu, 7 Oct 2021 19:23:21 +0500 Subject: [PATCH 2/6] Allow node port of chia app to be configurable --- test/chia/1.3.18/questions.yaml | 19 +++++++++++++++++++ test/chia/1.3.18/templates/deployment.yaml | 4 +++- test/chia/1.3.18/templates/service.yaml | 8 ++++++++ test/chia/1.3.18/test_values.yaml | 2 ++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/chia/1.3.18/templates/service.yaml 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 From 7f4906bdc172147c8ec67ed0587704edee1d2edd Mon Sep 17 00:00:00 2001 From: sonicaj Date: Thu, 7 Oct 2021 20:07:23 +0500 Subject: [PATCH 3/6] Properly disable host networking when chia ports are greater then or equal to 9000 --- test/chia/1.3.18/questions.yaml | 30 +++++++++++----------- test/chia/1.3.18/templates/deployment.yaml | 6 ++++- test/chia/1.3.18/templates/service.yaml | 2 +- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/test/chia/1.3.18/questions.yaml b/test/chia/1.3.18/questions.yaml index 74004f86d2..c163bb3e4e 100644 --- a/test/chia/1.3.18/questions.yaml +++ b/test/chia/1.3.18/questions.yaml @@ -157,18 +157,18 @@ questions: 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 + 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 4af5e243ee..5839b70ae2 100644 --- a/test/chia/1.3.18/templates/deployment.yaml +++ b/test/chia/1.3.18/templates/deployment.yaml @@ -3,6 +3,8 @@ kind: Deployment metadata: name: {{ template "common.names.fullname" . }} labels: {{ include "common.labels" . | nindent 4 }} + annotations: + rollme: {{ randAlphaNum 5 | quote }} spec: strategy: type: {{ .Values.updateStrategy }} @@ -14,7 +16,9 @@ spec: labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} spec: # 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 + {{ end }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} @@ -27,7 +31,7 @@ spec: - name: chia-network protocol: TCP containerPort: 8444 - {{ if lt .Values.service.nodePort 9000 }} + {{ if lt (.Values.service.nodePort | int) 9000 }} hostPort: {{ .Values.service.nodePort }} {{ end }} {{ $envList := (default list .Values.environmentVariables) }} diff --git a/test/chia/1.3.18/templates/service.yaml b/test/chia/1.3.18/templates/service.yaml index ff64c4841f..8b9c3c225b 100644 --- a/test/chia/1.3.18/templates/service.yaml +++ b/test/chia/1.3.18/templates/service.yaml @@ -1,5 +1,5 @@ {{ $svc := .Values.service }} -{{ if ge $svc.nodePort 9000 }} +{{ if ge ($svc.nodePort | int) 9000 }} {{ $ports := list }} {{ $ports = mustAppend $ports (dict "name" "chia-network" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 8444) }} {{ $params := . }} From a5b21a802e8b5d676c35070f35e939fb58c2a722 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Fri, 8 Oct 2021 20:31:56 +0500 Subject: [PATCH 4/6] Allow specifying farmer port for chia application --- test/chia/1.3.18/questions.yaml | 8 ++++++++ test/chia/1.3.18/templates/deployment.yaml | 8 ++++---- test/chia/1.3.18/templates/networking.tpl | 21 +++++++++++++++++++++ test/chia/1.3.18/templates/service.yaml | 9 +++++++-- test/chia/1.3.18/test_values.yaml | 1 + 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 test/chia/1.3.18/templates/networking.tpl diff --git a/test/chia/1.3.18/questions.yaml b/test/chia/1.3.18/questions.yaml index c163bb3e4e..29ca90ccac 100644 --- a/test/chia/1.3.18/questions.yaml +++ b/test/chia/1.3.18/questions.yaml @@ -172,3 +172,11 @@ questions: max: 65535 default: 8444 required: true + - variable: farmerPort + label: "Farmer Port to use for Chia" + schema: + type: int + min: 8000 + max: 65535 + default: 8447 + required: true diff --git a/test/chia/1.3.18/templates/deployment.yaml b/test/chia/1.3.18/templates/deployment.yaml index 5839b70ae2..f9983b5b90 100644 --- a/test/chia/1.3.18/templates/deployment.yaml +++ b/test/chia/1.3.18/templates/deployment.yaml @@ -16,7 +16,7 @@ spec: labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} spec: # 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 {{ end }} containers: @@ -31,9 +31,9 @@ spec: - name: chia-network protocol: TCP containerPort: 8444 - {{ if lt (.Values.service.nodePort | int) 9000 }} - hostPort: {{ .Values.service.nodePort }} - {{ end }} + - name: chia-farmer + protocol: TCP + containerPort: 8447 {{ $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/networking.tpl b/test/chia/1.3.18/templates/networking.tpl new file mode 100644 index 0000000000..c2b2ff1344 --- /dev/null +++ b/test/chia/1.3.18/templates/networking.tpl @@ -0,0 +1,21 @@ +{{/* +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 -}} diff --git a/test/chia/1.3.18/templates/service.yaml b/test/chia/1.3.18/templates/service.yaml index 8b9c3c225b..bf92e8d57b 100644 --- a/test/chia/1.3.18/templates/service.yaml +++ b/test/chia/1.3.18/templates/service.yaml @@ -1,8 +1,13 @@ +{{ if eq (include "enableService" .) "true" }} {{ $svc := .Values.service }} -{{ if ge ($svc.nodePort | int) 9000 }} {{ $ports := list }} +{{ if ge ($svc.nodePort | int) 9000 }} {{ $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 := . }} {{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} {{ include "common.classes.service" $params }} -{{ end }} +{{ end }} \ No newline at end of file diff --git a/test/chia/1.3.18/test_values.yaml b/test/chia/1.3.18/test_values.yaml index b808f454a0..1fb13a38ee 100644 --- a/test/chia/1.3.18/test_values.yaml +++ b/test/chia/1.3.18/test_values.yaml @@ -13,3 +13,4 @@ image: updateStrategy: Recreate service: nodePort: 33121 + farmerPort: 33122 From bb453a39fa4fac666ca95d92f5be8dabcfdad09c Mon Sep 17 00:00:00 2001 From: sonicaj Date: Sun, 10 Oct 2021 18:04:39 +0500 Subject: [PATCH 5/6] Update stable train from test train --- charts/chia/{1.3.17 => 1.3.18}/.helmignore | 0 charts/chia/{1.3.17 => 1.3.18}/Chart.yaml | 2 +- charts/chia/{1.3.17 => 1.3.18}/README.md | 0 charts/chia/{1.3.17 => 1.3.18}/app-readme.md | 0 .../charts/common-2105.0.0.tgz | Bin .../{1.3.17 => 1.3.18}/default_values.yaml | 0 charts/chia/{1.3.17 => 1.3.18}/ix_values.yaml | 0 charts/chia/{1.3.17 => 1.3.18}/questions.yaml | 27 ++++++++++++++++++ .../chia/{1.3.17 => 1.3.18}/requirements.lock | 0 .../templates/deployment.yaml | 8 +++++- .../templates/generate-mnemonic.yaml | 0 .../templates/mnemonic-configmap.yaml | 0 charts/chia/1.3.18/templates/networking.tpl | 21 ++++++++++++++ charts/chia/1.3.18/templates/service.yaml | 13 +++++++++ .../chia/{1.3.17 => 1.3.18}/test_values.yaml | 3 ++ charts/chia/{1.3.17 => 1.3.18}/values.yaml | 0 test/chia/1.3.18/templates/networking.tpl | 4 +-- test/chia/1.3.18/test_values.yaml | 4 +-- 18 files changed, 76 insertions(+), 6 deletions(-) rename charts/chia/{1.3.17 => 1.3.18}/.helmignore (100%) rename charts/chia/{1.3.17 => 1.3.18}/Chart.yaml (96%) rename charts/chia/{1.3.17 => 1.3.18}/README.md (100%) rename charts/chia/{1.3.17 => 1.3.18}/app-readme.md (100%) rename charts/chia/{1.3.17 => 1.3.18}/charts/common-2105.0.0.tgz (100%) rename charts/chia/{1.3.17 => 1.3.18}/default_values.yaml (100%) rename charts/chia/{1.3.17 => 1.3.18}/ix_values.yaml (100%) rename charts/chia/{1.3.17 => 1.3.18}/questions.yaml (87%) rename charts/chia/{1.3.17 => 1.3.18}/requirements.lock (100%) rename charts/chia/{1.3.17 => 1.3.18}/templates/deployment.yaml (89%) rename charts/chia/{1.3.17 => 1.3.18}/templates/generate-mnemonic.yaml (100%) rename charts/chia/{1.3.17 => 1.3.18}/templates/mnemonic-configmap.yaml (100%) create mode 100644 charts/chia/1.3.18/templates/networking.tpl create mode 100644 charts/chia/1.3.18/templates/service.yaml rename charts/chia/{1.3.17 => 1.3.18}/test_values.yaml (83%) rename charts/chia/{1.3.17 => 1.3.18}/values.yaml (100%) diff --git a/charts/chia/1.3.17/.helmignore b/charts/chia/1.3.18/.helmignore similarity index 100% rename from charts/chia/1.3.17/.helmignore rename to charts/chia/1.3.18/.helmignore diff --git a/charts/chia/1.3.17/Chart.yaml b/charts/chia/1.3.18/Chart.yaml similarity index 96% rename from charts/chia/1.3.17/Chart.yaml rename to charts/chia/1.3.18/Chart.yaml index 6ea63093df..2aa2e9603f 100644 --- a/charts/chia/1.3.17/Chart.yaml +++ b/charts/chia/1.3.18/Chart.yaml @@ -15,4 +15,4 @@ name: chia sources: - https://github.com/Chia-Network/chia-blockchain - https://github.com/orgs/chia-network/packages/container/package/chia -version: 1.3.17 +version: 1.3.18 diff --git a/charts/chia/1.3.17/README.md b/charts/chia/1.3.18/README.md similarity index 100% rename from charts/chia/1.3.17/README.md rename to charts/chia/1.3.18/README.md diff --git a/charts/chia/1.3.17/app-readme.md b/charts/chia/1.3.18/app-readme.md similarity index 100% rename from charts/chia/1.3.17/app-readme.md rename to charts/chia/1.3.18/app-readme.md diff --git a/charts/chia/1.3.17/charts/common-2105.0.0.tgz b/charts/chia/1.3.18/charts/common-2105.0.0.tgz similarity index 100% rename from charts/chia/1.3.17/charts/common-2105.0.0.tgz rename to charts/chia/1.3.18/charts/common-2105.0.0.tgz diff --git a/charts/chia/1.3.17/default_values.yaml b/charts/chia/1.3.18/default_values.yaml similarity index 100% rename from charts/chia/1.3.17/default_values.yaml rename to charts/chia/1.3.18/default_values.yaml diff --git a/charts/chia/1.3.17/ix_values.yaml b/charts/chia/1.3.18/ix_values.yaml similarity index 100% rename from charts/chia/1.3.17/ix_values.yaml rename to charts/chia/1.3.18/ix_values.yaml diff --git a/charts/chia/1.3.17/questions.yaml b/charts/chia/1.3.18/questions.yaml similarity index 87% rename from charts/chia/1.3.17/questions.yaml rename to charts/chia/1.3.18/questions.yaml index d2e2e71a7b..29ca90ccac 100644 --- a/charts/chia/1.3.17/questions.yaml +++ b/charts/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,28 @@ 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 + - variable: farmerPort + label: "Farmer Port to use for Chia" + schema: + type: int + min: 8000 + max: 65535 + default: 8447 + required: true diff --git a/charts/chia/1.3.17/requirements.lock b/charts/chia/1.3.18/requirements.lock similarity index 100% rename from charts/chia/1.3.17/requirements.lock rename to charts/chia/1.3.18/requirements.lock diff --git a/charts/chia/1.3.17/templates/deployment.yaml b/charts/chia/1.3.18/templates/deployment.yaml similarity index 89% rename from charts/chia/1.3.17/templates/deployment.yaml rename to charts/chia/1.3.18/templates/deployment.yaml index 83eb2a02c6..f9983b5b90 100644 --- a/charts/chia/1.3.17/templates/deployment.yaml +++ b/charts/chia/1.3.18/templates/deployment.yaml @@ -3,6 +3,8 @@ kind: Deployment metadata: name: {{ template "common.names.fullname" . }} labels: {{ include "common.labels" . | nindent 4 }} + annotations: + rollme: {{ randAlphaNum 5 | quote }} spec: strategy: type: {{ .Values.updateStrategy }} @@ -14,7 +16,9 @@ spec: labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} spec: # FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router + {{ if eq (include "hostNetworkingEnabled" .) "true" }} hostNetwork: true + {{ end }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} @@ -27,7 +31,9 @@ spec: - name: chia-network protocol: TCP containerPort: 8444 - hostPort: 8444 + - name: chia-farmer + protocol: TCP + containerPort: 8447 {{ $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/charts/chia/1.3.17/templates/generate-mnemonic.yaml b/charts/chia/1.3.18/templates/generate-mnemonic.yaml similarity index 100% rename from charts/chia/1.3.17/templates/generate-mnemonic.yaml rename to charts/chia/1.3.18/templates/generate-mnemonic.yaml diff --git a/charts/chia/1.3.17/templates/mnemonic-configmap.yaml b/charts/chia/1.3.18/templates/mnemonic-configmap.yaml similarity index 100% rename from charts/chia/1.3.17/templates/mnemonic-configmap.yaml rename to charts/chia/1.3.18/templates/mnemonic-configmap.yaml diff --git a/charts/chia/1.3.18/templates/networking.tpl b/charts/chia/1.3.18/templates/networking.tpl new file mode 100644 index 0000000000..280f7bdc9e --- /dev/null +++ b/charts/chia/1.3.18/templates/networking.tpl @@ -0,0 +1,21 @@ +{{/* +Enable host networking +*/}} +{{- define "hostNetworkingEnabled" -}} +{{- if or (lt (.Values.service.nodePort | int) 9000) (lt (.Values.service.farmerPort | int) 9000) -}} +{{- print "true" -}} +{{- else -}} +{{- print "false" -}} +{{- end -}} +{{- end -}} + +{{/* +Enable Node Port Service +*/}} +{{- define "enableService" -}} +{{- if or (ge (.Values.service.nodePort | int) 9000) (ge (.Values.service.farmerPort | int) 9000) -}} +{{- print "true" -}} +{{- else -}} +{{- print "false" -}} +{{- end -}} +{{- end -}} diff --git a/charts/chia/1.3.18/templates/service.yaml b/charts/chia/1.3.18/templates/service.yaml new file mode 100644 index 0000000000..bf92e8d57b --- /dev/null +++ b/charts/chia/1.3.18/templates/service.yaml @@ -0,0 +1,13 @@ +{{ if eq (include "enableService" .) "true" }} +{{ $svc := .Values.service }} +{{ $ports := list }} +{{ if ge ($svc.nodePort | int) 9000 }} +{{ $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 := . }} +{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} +{{ include "common.classes.service" $params }} +{{ end }} \ No newline at end of file diff --git a/charts/chia/1.3.17/test_values.yaml b/charts/chia/1.3.18/test_values.yaml similarity index 83% rename from charts/chia/1.3.17/test_values.yaml rename to charts/chia/1.3.18/test_values.yaml index 448ef92450..b012433afd 100644 --- a/charts/chia/1.3.17/test_values.yaml +++ b/charts/chia/1.3.18/test_values.yaml @@ -11,3 +11,6 @@ image: repository: ixsystems/chia-docker tag: v1.2.8 updateStrategy: Recreate +service: + nodePort: 31121 + farmerPort: 31122 diff --git a/charts/chia/1.3.17/values.yaml b/charts/chia/1.3.18/values.yaml similarity index 100% rename from charts/chia/1.3.17/values.yaml rename to charts/chia/1.3.18/values.yaml diff --git a/test/chia/1.3.18/templates/networking.tpl b/test/chia/1.3.18/templates/networking.tpl index c2b2ff1344..280f7bdc9e 100644 --- a/test/chia/1.3.18/templates/networking.tpl +++ b/test/chia/1.3.18/templates/networking.tpl @@ -1,5 +1,5 @@ {{/* -Formats volumeMount for Minio tls keys and trusted certs +Enable host networking */}} {{- define "hostNetworkingEnabled" -}} {{- if or (lt (.Values.service.nodePort | int) 9000) (lt (.Values.service.farmerPort | int) 9000) -}} @@ -10,7 +10,7 @@ Formats volumeMount for Minio tls keys and trusted certs {{- end -}} {{/* -Formats volume for Minio tls keys and trusted certs +Enable Node Port Service */}} {{- define "enableService" -}} {{- if or (ge (.Values.service.nodePort | int) 9000) (ge (.Values.service.farmerPort | int) 9000) -}} diff --git a/test/chia/1.3.18/test_values.yaml b/test/chia/1.3.18/test_values.yaml index 1fb13a38ee..b012433afd 100644 --- a/test/chia/1.3.18/test_values.yaml +++ b/test/chia/1.3.18/test_values.yaml @@ -12,5 +12,5 @@ image: tag: v1.2.8 updateStrategy: Recreate service: - nodePort: 33121 - farmerPort: 33122 + nodePort: 31121 + farmerPort: 31122 From 372707f1e5abe7a81ac04a4f6dda525f351d5ae4 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Wed, 13 Oct 2021 21:57:31 +0500 Subject: [PATCH 6/6] Make sure host ports are not retained on upgrade --- charts/chia/1.3.18/templates/deployment.yaml | 6 +++--- test/chia/1.3.18/templates/deployment.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/chia/1.3.18/templates/deployment.yaml b/charts/chia/1.3.18/templates/deployment.yaml index f9983b5b90..c3ce22a445 100644 --- a/charts/chia/1.3.18/templates/deployment.yaml +++ b/charts/chia/1.3.18/templates/deployment.yaml @@ -16,9 +16,7 @@ spec: labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} spec: # FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router - {{ if eq (include "hostNetworkingEnabled" .) "true" }} - hostNetwork: true - {{ end }} + hostNetwork: {{ include "hostNetworkingEnabled" . }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} @@ -31,9 +29,11 @@ spec: - name: chia-network protocol: TCP containerPort: 8444 + hostPort: null - name: chia-farmer protocol: TCP containerPort: 8447 + hostPort: null {{ $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/deployment.yaml b/test/chia/1.3.18/templates/deployment.yaml index f9983b5b90..c3ce22a445 100644 --- a/test/chia/1.3.18/templates/deployment.yaml +++ b/test/chia/1.3.18/templates/deployment.yaml @@ -16,9 +16,7 @@ spec: labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} spec: # FIXME: Let's please remove hostnetwork when upstream hostport issue is sorted out with kube-router - {{ if eq (include "hostNetworkingEnabled" .) "true" }} - hostNetwork: true - {{ end }} + hostNetwork: {{ include "hostNetworkingEnabled" . }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} @@ -31,9 +29,11 @@ spec: - name: chia-network protocol: TCP containerPort: 8444 + hostPort: null - name: chia-farmer protocol: TCP containerPort: 8447 + hostPort: null {{ $envList := (default list .Values.environmentVariables) }} {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }} {{ $envList = mustAppend $envList (dict "name" "farmr" "value" $.Values.farmr_env) }}