| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- {{ $scheme := "http" }}
- apiVersion: {{ template "ipfs.deployment.apiVersion" . }}
- kind: Deployment
- metadata:
- name: {{ template "ipfs.fullname" . }}
- labels:
- app: {{ template "ipfs.name" . }}
- chart: {{ template "ipfs.chart" . }}
- release: {{ .Release.Name }}
- heritage: {{ .Release.Service }}
- spec:
- strategy:
- type: {{ .Values.updateStrategy }}
- selector:
- matchLabels:
- app: {{ template "ipfs.name" . }}
- release: {{ .Release.Name }}
- template:
- metadata:
- name: {{ template "ipfs.fullname" . }}
- labels:
- app: {{ template "ipfs.name" . }}
- release: {{ .Release.Name }}
- spec:
- 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 ; chown -R 1000:100 /data/ipfs) ; 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', '1000:100', '/data/ipfs/config']
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- volumeMounts:
- - name: data
- mountPath: /data/ipfs
- - name: staging
- mountPath: /export
- containers:
- - name: {{ .Chart.Name }}
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- volumeMounts:
- - name: data
- mountPath: /data/ipfs
- - name: staging
- mountPath: /export
- ports:
- - name: swarm
- containerPort: 9401
- - name: api
- containerPort: 9501
- - name: gateway
- containerPort: 9880
- {{- range $key, $val := .Values.environment }}
- - name: {{ $key }}
- value: {{ $val | quote }}
- {{- end}}
- volumes:
- - name: data
- {{- if .Values.emptyDirVolumes }}
- emptyDir: {}
- {{- else }}
- hostPath:
- path: {{ template "configuredHostPathData" . }}
- {{- end }}
- - name: staging
- {{- if .Values.emptyDirVolumes }}
- emptyDir: {}
- {{- else }}
- hostPath:
- path: {{ template "configuredHostPathStaging" . }}
- {{- end }}
|