deployment.yaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "common.names.fullname" . }}
  5. labels: {{ include "common.labels" . | nindent 4 }}
  6. spec:
  7. strategy:
  8. type: {{ .Values.updateStrategy }}
  9. selector:
  10. matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
  11. template:
  12. metadata:
  13. name: {{ template "common.names.fullname" . }}
  14. labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
  15. spec:
  16. serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
  17. initContainers:
  18. - name: init-init
  19. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  20. command: ['/bin/sh', '-c', '[ ! -e /data/ipfs/config ] && (/usr/local/bin/ipfs init ; chown -R 1000:100 /data/ipfs) ; exit 0']
  21. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  22. - name: init-api
  23. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  24. command: ['/usr/local/bin/ipfs', 'config', 'Addresses.API', "/ip4/0.0.0.0/tcp/9501"]
  25. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  26. - name: init-gateway
  27. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  28. command: ['/usr/local/bin/ipfs', 'config', 'Addresses.Gateway', "/ip4/0.0.0.0/tcp/9080"]
  29. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  30. - name: init-swarm
  31. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  32. command: ['/usr/local/bin/ipfs', 'config', '--json', 'Addresses.Swarm', "[\"/ip4/0.0.0.0/tcp/9401\",\"/ip4/0.0.0.0/tcp/9401/quic\"]" ]
  33. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  34. - name: init-access-origin
  35. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  36. command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Origin', "[\"*\"]" ]
  37. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  38. - name: init-access-methods
  39. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  40. command: ['/usr/local/bin/ipfs', 'config', '--json', 'API.HTTPHeaders.Access-Control-Allow-Methods', "[\"PUT\",\"POST\"]" ]
  41. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  42. - name: init-chown
  43. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  44. command: ['chown', '1000:100', '/data/ipfs/config']
  45. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  46. containers:
  47. - name: {{ .Chart.Name }}
  48. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  49. {{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
  50. ports:
  51. - name: swarm
  52. containerPort: 9401
  53. - name: api
  54. containerPort: 9501
  55. - name: gateway
  56. containerPort: 9880
  57. {{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }}
  58. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  59. {{ include "common.storage.allAppVolumes" .Values | nindent 6 }}