Commit e5a7976b authored by Kris Moore's avatar Kris Moore

Update ipfs chart, works on fresh install now, and on restart. Enables

setting options on each startup so that the WebUI is functional
parent 96b8da5f
groups: groups:
- name: "Container Images" - name: "Container Images"
description: "Image to be used for container" description: "Image to be used for container"
- name: "Workload Configuration"
description: "Configure Storage for IPFS"
- name: "Storage" - name: "Storage"
description: "Configure Storage for IPFS" description: "Configure Storage for IPFS"
- name: "IPFS Configuration"
description: "Configure Storage for IPFS"
portals: portals:
web_portal: web_portal:
...@@ -11,7 +15,8 @@ portals: ...@@ -11,7 +15,8 @@ portals:
host: host:
- "$node_ip" - "$node_ip"
ports: ports:
- "$variable-service.nodePort" - "$variable-service.apiPort"
path: "/webui"
questions: questions:
# Image related # Image related
...@@ -55,7 +60,7 @@ questions: ...@@ -55,7 +60,7 @@ questions:
group: "Workload Configuration" group: "Workload Configuration"
schema: schema:
type: string type: string
default: "RollingUpdate" default: "Recreate"
enum: enum:
- value: "RollingUpdate" - value: "RollingUpdate"
description: "Create new pods and then kill old ones" description: "Create new pods and then kill old ones"
...@@ -78,14 +83,31 @@ questions: ...@@ -78,14 +83,31 @@ questions:
type: dict type: dict
required: true required: true
attrs: attrs:
- variable: nodePort - variable: swarmPort
label: "Node Port to use for IPFS" label: "Swarm Port to use for IPFS (Public)"
schema:
type: int
min: 4000
max: 65535
default: 9401
required: true
- variable: apiPort
label: "API Port to use for IPFS (local)"
schema: schema:
type: int type: int
min: 9000 min: 4000
max: 65535 max: 65535
default: 9080 default: 9501
required: true required: true
- variable: gatewayPort
label: "Gateway Port to use for IPFS (local)"
schema:
type: int
min: 4000
max: 65535
default: 9880
required: true
- variable: ipfsDataHostPathEnabled - variable: ipfsDataHostPathEnabled
label: "Configure Host Path for IPFS data" label: "Configure Host Path for IPFS data"
...@@ -124,7 +146,7 @@ questions: ...@@ -124,7 +146,7 @@ questions:
editable: false editable: false
- variable: ipfsStagingHostPathEnabled - variable: ipfsStagingHostPathEnabled
label: "Configure Host Path for IPFS staging" label: "Configure Host Path for IPFS staging data"
group: "Storage" group: "Storage"
schema: schema:
type: boolean type: boolean
...@@ -132,7 +154,7 @@ questions: ...@@ -132,7 +154,7 @@ questions:
show_subquestions_if: true show_subquestions_if: true
subquestions: subquestions:
- variable: ipfsStagingHostPath - variable: ipfsStagingHostPath
label: "Specify HostPath for IPFS staging" label: "Specify HostPath for IPFS staging data"
schema: schema:
type: hostpath type: hostpath
......
...@@ -13,7 +13,7 @@ Retrieve host path from ix volumes based on dataset name ...@@ -13,7 +13,7 @@ Retrieve host path from ix volumes based on dataset name
{{/* {{/*
Retrieve host path for ipfs Retrieve host path for ipfs
*/}} */}}
{{- define "configuredDataHostPath" -}} {{- define "configuredHostPathData" -}}
{{- if .Values.ipfsDataHostPathEnabled -}} {{- if .Values.ipfsDataHostPathEnabled -}}
{{- .Values.ipfsDataHostPath -}} {{- .Values.ipfsDataHostPath -}}
{{- else -}} {{- else -}}
...@@ -25,7 +25,7 @@ Retrieve host path for ipfs ...@@ -25,7 +25,7 @@ Retrieve host path for ipfs
{{/* {{/*
Retrieve host path for ipfs Retrieve host path for ipfs
*/}} */}}
{{- define "configuredStagingHostPath" -}} {{- define "configuredHostPathStaging" -}}
{{- if .Values.ipfsStagingHostPathEnabled -}} {{- if .Values.ipfsStagingHostPathEnabled -}}
{{- .Values.ipfsStagingHostPath -}} {{- .Values.ipfsStagingHostPath -}}
{{- else -}} {{- else -}}
......
...@@ -23,6 +23,70 @@ spec: ...@@ -23,6 +23,70 @@ spec:
release: {{ .Release.Name }} release: {{ .Release.Name }}
spec: spec:
serviceAccountName: {{ include "ipfs.serviceAccountName" . | quote }} serviceAccountName: {{ include "ipfs.serviceAccountName" . | quote }}
initContainers:
- name: init-init
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && /usr/local/bin/ipfs init ; exit 0']
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
- name: init-api
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.API', "/ip4/0.0.0.0/tcp/{{ .Values.service.apiPort}}"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
- name: init-gateway
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.Gateway', "/ip4/0.0.0.0/tcp/{{ .Values.service.gatewayPort}}"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
- name: init-swarm
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['/usr/local/bin/ipfs', 'config', '--json', 'Addresses.Swarm', "[\"/ip4/0.0.0.0/tcp/{{ .Values.service.swarmPort}}\",\"/ip4/0.0.0.0/tcp/{{ .Values.service.swarmPort}}/quic\"]" ]
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
- name: init-access-origin
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Origin', "[\"*\"]" ]
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
- name: init-access-methods
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Methods', "[\"PUT\",\"POST\"]" ]
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
- name: init-chown
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ['chown', '-R', '1000:100', '/data/ipfs']
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: data
mountPath: /data/ipfs
- name: staging
mountPath: /export
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
...@@ -30,28 +94,31 @@ spec: ...@@ -30,28 +94,31 @@ spec:
volumeMounts: volumeMounts:
- name: data - name: data
mountPath: /data/ipfs mountPath: /data/ipfs
volumeMounts:
- name: staging - name: staging
mountPath: /export mountPath: /export
ports: ports:
- name: {{ $scheme }} - name: swarm
containerPort: 9080 containerPort: 9401
- name: api
containerPort: 9501
- name: gateway
containerPort: 9880
{{- range $key, $val := .Values.environment }} {{- range $key, $val := .Values.environment }}
- name: {{ $key }} - name: {{ $key }}
value: {{ $val | quote }} value: {{ $val | quote }}
{{- end}} {{- end}}
volumes: volumes:
- name: data - name: data
{{- if .Values.emptyDirVolumes }} {{- if ne (include "configuredHostPathData" .) "" }}
emptyDir: {}
{{- else }}
hostPath: hostPath:
path: {{ template "configuredDataHostPath" . }} path: {{ template "configuredHostPathData" . }}
{{- else }}
emptyDir: {}
{{- end }} {{- end }}
- name: staging - name: staging
{{- if .Values.emptyDirVolumes }} {{- if ne (include "configuredHostPathStaging" .) "" }}
emptyDir: {}
{{- else }}
hostPath: hostPath:
path: {{ template "configuredStagingHostPath" . }} path: {{ template "configuredHostPathStaging" . }}
{{- else }}
emptyDir: {}
{{- end }} {{- end }}
...@@ -11,11 +11,21 @@ metadata: ...@@ -11,11 +11,21 @@ metadata:
spec: spec:
type: "NodePort" type: "NodePort"
ports: ports:
- name: {{ $scheme }} - name: swarm
port: {{ .Values.service.nodePort }} port: {{ .Values.service.swarmPort }}
protocol: TCP protocol: TCP
nodePort: {{ .Values.service.nodePort }} nodePort: {{ .Values.service.swarmPort }}
targetPort: 9080 targetPort: 9401
- name: api
port: {{ .Values.service.apiPort }}
protocol: TCP
nodePort: {{ .Values.service.apiPort }}
targetPort: 9501
- name: gateway
port: {{ .Values.service.gatewayPort }}
protocol: TCP
nodePort: {{ .Values.service.gatewayPort }}
targetPort: 9880
selector: selector:
app: {{ template "ipfs.name" . }} app: {{ template "ipfs.name" . }}
release: {{ .Release.Name }} release: {{ .Release.Name }}
...@@ -8,11 +8,16 @@ image: ...@@ -8,11 +8,16 @@ image:
## Additional arguments to pass to minio binary ## Additional arguments to pass to minio binary
extraArgs: [] extraArgs: []
updateStrategy: RollingUpdate updateStrategy: Recreate
service: service:
nodePort: 9080 swarmPort: 9401
apiPort: 9501
gatewayPort: 9080
environment: environment:
emptyDirVolumes: true emptyDirVolumes: true
ipfsDataHostPathEnabled: false
ipfsStagingHostPathEnabled: false
...@@ -8,9 +8,14 @@ image: ...@@ -8,9 +8,14 @@ image:
## Additional arguments to pass to ipfs binary ## Additional arguments to pass to ipfs binary
extraArgs: [] extraArgs: []
updateStrategy: RollingUpdate updateStrategy: Recreate
service: service:
nodePort: 9080 swarmPort: 9401
apiPort: 9501
gatewayPort: 9080
environment: environment:
ipfsDataHostPathEnabled: false
ipfsStagingHostPathEnabled: false
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