_storj.tpl 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {{- define "storj.workload" -}}
  2. workload:
  3. storj:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.storjNetwork.hostNetwork }}
  9. terminationGracePeriodSeconds: {{ .Values.storjConfig.gracePeriod }}
  10. containers:
  11. storj:
  12. enabled: true
  13. primary: true
  14. imageSelector: image
  15. securityContext:
  16. runAsUser: {{ .Values.storjRunAs.user }}
  17. runAsGroup: {{ .Values.storjRunAs.group }}
  18. readOnlyRootFilesystem: false
  19. {{- include "storj.args" $ | nindent 10 }}
  20. envFrom:
  21. - secretRef:
  22. name: storj-config
  23. {{ with .Values.storjConfig.additionalEnvs }}
  24. envList:
  25. {{ range $env := . }}
  26. - name: {{ $env.name }}
  27. value: {{ $env.value }}
  28. {{ end }}
  29. {{ end }}
  30. probes:
  31. liveness:
  32. enabled: false
  33. readiness:
  34. enabled: false
  35. startup:
  36. enabled: false
  37. initContainers:
  38. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  39. "UID" .Values.storjRunAs.user
  40. "GID" .Values.storjRunAs.group
  41. "mode" "check"
  42. "type" "install") | nindent 8 }}
  43. 02-generateid:
  44. enabled: true
  45. type: init
  46. imageSelector: curlImage
  47. securityContext:
  48. runAsUser: 0
  49. runAsGroup: 0
  50. runAsNonRoot: false
  51. readOnlyRootFilesystem: false
  52. capabilities:
  53. add:
  54. - CHOWN
  55. - FOWNER
  56. - DAC_OVERRIDE
  57. command:
  58. - /bin/sh
  59. - -c
  60. args:
  61. - ./init_script/init_config.sh
  62. env:
  63. DEFAULT_CERT_PATH: {{ template "storj.idPath" }}/ca.cert
  64. DEFAULT_IDENTITY_CERT_PATH: {{ template "storj.idPath" }}/identity.cert
  65. AUTH_KEY:
  66. secretKeyRef:
  67. name: storj
  68. key: authToken
  69. 03-setup:
  70. enabled: true
  71. type: init
  72. imageSelector: image
  73. envFrom:
  74. - secretRef:
  75. name: storj-config
  76. securityContext:
  77. runAsUser: {{ .Values.storjRunAs.user }}
  78. runAsGroup: {{ .Values.storjRunAs.group }}
  79. readOnlyRootFilesystem: false
  80. command:
  81. - /bin/sh
  82. - -c
  83. - |
  84. if test ! -f /app/config/config.yaml; then
  85. echo "Setting up Storj"
  86. export SETUP="true"
  87. /entrypoint
  88. else
  89. echo "Storj already setup"
  90. fi
  91. {{- end -}}