From bd77438bf535f319650e63e302c4ca8350b4256b Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Sat, 8 May 2021 08:35:05 +0500 Subject: [PATCH] Setup chia deployment --- charts/chia/1.0.0/templates/deployment.yaml | 40 ++----------------- charts/chia/1.0.0/templates/service.yaml | 8 ---- .../chia/1.0.0/templates/serviceaccount.yaml | 1 - 3 files changed, 4 insertions(+), 45 deletions(-) delete mode 100644 charts/chia/1.0.0/templates/service.yaml delete mode 100644 charts/chia/1.0.0/templates/serviceaccount.yaml diff --git a/charts/chia/1.0.0/templates/deployment.yaml b/charts/chia/1.0.0/templates/deployment.yaml index c830a17a16..230c4d8ec0 100644 --- a/charts/chia/1.0.0/templates/deployment.yaml +++ b/charts/chia/1.0.0/templates/deployment.yaml @@ -13,46 +13,14 @@ spec: name: {{ template "common.names.fullname" . }} labels: {{ include "common.labels.selectorLabels" . | nindent 8 }} spec: - serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }} - initContainers: - - name: init-init - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && (/usr/local/bin/ipfs init ; chown -R 1000:100 /data/ipfs) ; exit 0'] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} - - name: init-api - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['/usr/local/bin/ipfs', 'config', 'Addresses.API', "/ip4/0.0.0.0/tcp/9501"] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} - - name: init-gateway - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['/usr/local/bin/ipfs', 'config', 'Addresses.Gateway', "/ip4/0.0.0.0/tcp/9080"] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} - - name: init-swarm - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['/usr/local/bin/ipfs', 'config', '--json', 'Addresses.Swarm', "[\"/ip4/0.0.0.0/tcp/9401\",\"/ip4/0.0.0.0/tcp/9401/quic\"]" ] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} - - name: init-access-origin - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Origin', "[\"*\"]" ] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} - - name: init-access-methods - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Methods', "[\"PUT\",\"POST\"]" ] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} - - name: init-chown - {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} - command: ['chown', '1000:100', '/data/ipfs/config'] - {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }} ports: - - name: swarm - containerPort: 9401 - - name: api - containerPort: 9501 - - name: gateway - containerPort: 9880 + - name: chia-network + protocol: TCP + containerPort: 8444 + hostPort: 8444 {{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }} {{ include "common.storage.allAppVolumes" .Values | nindent 6 }} diff --git a/charts/chia/1.0.0/templates/service.yaml b/charts/chia/1.0.0/templates/service.yaml deleted file mode 100644 index 4cc9718639..0000000000 --- a/charts/chia/1.0.0/templates/service.yaml +++ /dev/null @@ -1,8 +0,0 @@ -{{ $svc := .Values.service }} -{{ $ports := list }} -{{ $ports = mustAppend $ports (dict "name" "swarm" "port" $svc.swarmPort "nodePort" $svc.swarmPort "targetPort" 9401) }} -{{ $ports = mustAppend $ports (dict "name" "api" "port" $svc.apiPort "nodePort" $svc.apiPort "targetPort" 9501) }} -{{ $ports = mustAppend $ports (dict "name" "gateway" "port" $svc.gatewayPort "nodePort" $svc.gatewayPort "targetPort" 9880) }} -{{ $params := . }} -{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} -{{ include "common.classes.service" $params }} diff --git a/charts/chia/1.0.0/templates/serviceaccount.yaml b/charts/chia/1.0.0/templates/serviceaccount.yaml deleted file mode 100644 index 12bd3f4a39..0000000000 --- a/charts/chia/1.0.0/templates/serviceaccount.yaml +++ /dev/null @@ -1 +0,0 @@ -{{ include "common.serviceaccount" . }}