mirror of
https://github.com/truenas/charts.git
synced 2026-11-14 06:48:09 +00:00
Update ipfs deployment to use library chart
This commit is contained in:
1 parent
de3948ecdd
commit
e5d0fb7cc6
1 file changed
+19
-53
@@ -1,87 +1,71 @@
|
|||||||
{{ $scheme := "http" }}
|
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
|
||||||
apiVersion: {{ template "ipfs.deployment.apiVersion" . }}
|
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "ipfs.fullname" . }}
|
name: {{ template "common.names.fullname" . }}
|
||||||
labels:
|
labels: {{ include "common.labels" . | nindent 4 }}
|
||||||
app: {{ template "ipfs.name" . }}
|
|
||||||
chart: {{ template "ipfs.chart" . }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
heritage: {{ .Release.Service }}
|
|
||||||
spec:
|
spec:
|
||||||
strategy:
|
strategy:
|
||||||
type: {{ .Values.updateStrategy }}
|
type: {{ .Values.updateStrategy }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
|
||||||
app: {{ template "ipfs.name" . }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "ipfs.fullname" . }}
|
name: {{ template "common.names.fullname" . }}
|
||||||
labels:
|
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
|
||||||
app: {{ template "ipfs.name" . }}
|
|
||||||
release: {{ .Release.Name }}
|
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: {{ include "ipfs.serviceAccountName" . | quote }}
|
serviceAccountName: {{ include "ipfs.serviceAccountName" . | quote }}
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init-init
|
- name: init-init
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ 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']
|
command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && (/usr/local/bin/ipfs init ; chown -R 1000:100 /data/ipfs) ; exit 0']
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
- name: staging
|
- name: staging
|
||||||
mountPath: /export
|
mountPath: /export
|
||||||
- name: init-api
|
- name: init-api
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.API', "/ip4/0.0.0.0/tcp/{{ .Values.service.apiPort}}"]
|
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.API', "/ip4/0.0.0.0/tcp/{{ .Values.service.apiPort}}"]
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
- name: staging
|
- name: staging
|
||||||
mountPath: /export
|
mountPath: /export
|
||||||
- name: init-gateway
|
- name: init-gateway
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.Gateway', "/ip4/0.0.0.0/tcp/{{ .Values.service.gatewayPort}}"]
|
command: ['/usr/local/bin/ipfs', 'config', 'Addresses.Gateway', "/ip4/0.0.0.0/tcp/{{ .Values.service.gatewayPort}}"]
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
- name: staging
|
- name: staging
|
||||||
mountPath: /export
|
mountPath: /export
|
||||||
- name: init-swarm
|
- name: init-swarm
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
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\"]" ]
|
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:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
- name: staging
|
- name: staging
|
||||||
mountPath: /export
|
mountPath: /export
|
||||||
- name: init-access-origin
|
- name: init-access-origin
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Origin', "[\"*\"]" ]
|
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Origin', "[\"*\"]" ]
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
- name: staging
|
- name: staging
|
||||||
mountPath: /export
|
mountPath: /export
|
||||||
- name: init-access-methods
|
- name: init-access-methods
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Methods', "[\"PUT\",\"POST\"]" ]
|
command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Methods', "[\"PUT\",\"POST\"]" ]
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
- name: staging
|
- name: staging
|
||||||
mountPath: /export
|
mountPath: /export
|
||||||
- name: init-chown
|
- name: init-chown
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
command: ['chown', '1000:100', '/data/ipfs/config']
|
command: ['chown', '1000:100', '/data/ipfs/config']
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
@@ -89,8 +73,7 @@ spec:
|
|||||||
mountPath: /export
|
mountPath: /export
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data/ipfs
|
mountPath: /data/ipfs
|
||||||
@@ -105,27 +88,10 @@ spec:
|
|||||||
containerPort: 9880
|
containerPort: 9880
|
||||||
{{- if .Values.environment }}
|
{{- if .Values.environment }}
|
||||||
env:
|
env:
|
||||||
{{- range $envVariable := .Values.environment }}
|
{{ include "common.containers.environmentVariables" (dict "environmentVariables" .Values.environment) | nindent 12 }}
|
||||||
{{- if and $envVariable.name $envVariable.value }}
|
|
||||||
- name: {{ $envVariable.name }}
|
|
||||||
value: {{ $envVariable.value | quote }}
|
|
||||||
{{- else }}
|
|
||||||
{{- fail "Please specify name/value for environment variable" }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end}}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: data
|
{{ $vols := list }}
|
||||||
{{- if .Values.emptyDirVolumes }}
|
{{ $vols = mustAppend $vols (dict "name" "data" "emptyDirVolumes" .Values.emptyDirVolumes "hostPathEnabled" .Values.ipfsDataHostPathEnabled "pathField" .Values.ipfsDataHostPath "datasetName" (.Values.ipfsDataVolume | default dict).datasetName ) }}
|
||||||
emptyDir: {}
|
{{ $vols = mustAppend $vols (dict "name" "staging" "emptyDirVolumes" .Values.emptyDirVolumes "hostPathEnabled" .Values.ipfsStagingHostPath "pathField" .Values.ipfsStagingHostPath "datasetName" (.Values.ipfsStagingVolume | default dict).datasetName ) }}
|
||||||
{{- else }}
|
{{ include "common.storage.volumesConfiguration" (dict "ixVolumes" .Values.ixVolumes "volumes" $vols) | nindent 8 }}
|
||||||
hostPath:
|
|
||||||
path: {{ template "configuredHostPathData" . }}
|
|
||||||
{{- end }}
|
|
||||||
- name: staging
|
|
||||||
{{- if .Values.emptyDirVolumes }}
|
|
||||||
emptyDir: {}
|
|
||||||
{{- else }}
|
|
||||||
hostPath:
|
|
||||||
path: {{ template "configuredHostPathStaging" . }}
|
|
||||||
{{- end }}
|
|
||||||
Reference in new issue
Block a user