_storj.tpl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. # capabilities:
  20. # add:
  21. # - CHOWN
  22. # - DAC_OVERRIDE
  23. # - FOWNER
  24. # - SETGID
  25. # - SETUID
  26. # - KILL
  27. {{- include "storj.args" $ | nindent 10 }}
  28. envFrom:
  29. - secretRef:
  30. name: storj-config
  31. {{ with .Values.storjConfig.additionalEnvs }}
  32. envList:
  33. {{ range $env := . }}
  34. - name: {{ $env.name }}
  35. value: {{ $env.value }}
  36. {{ end }}
  37. {{ end }}
  38. probes:
  39. liveness:
  40. enabled: false
  41. readiness:
  42. enabled: false
  43. startup:
  44. enabled: false
  45. initContainers:
  46. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  47. "UID" .Values.storjRunAs.user
  48. "GID" .Values.storjRunAs.group
  49. "mode" "check"
  50. "type" "install") | nindent 8 }}
  51. 02-generateid:
  52. enabled: true
  53. type: init
  54. imageSelector: curlImage
  55. securityContext:
  56. runAsUser: 0
  57. runAsGroup: 0
  58. runAsNonRoot: false
  59. readOnlyRootFilesystem: false
  60. capabilities:
  61. add:
  62. - CHOWN
  63. - FOWNER
  64. - DAC_OVERRIDE
  65. command:
  66. - /bin/sh
  67. - -c
  68. args:
  69. - ./init_script/init_config.sh
  70. env:
  71. DEFAULT_CERT_PATH: {{ template "storj.idPath" }}/ca.cert
  72. DEFAULT_IDENTITY_CERT_PATH: {{ template "storj.idPath" }}/identity.cert
  73. AUTH_KEY:
  74. secretKeyRef:
  75. name: storj
  76. key: authToken
  77. 03-setup:
  78. enabled: true
  79. type: init
  80. imageSelector: image
  81. envFrom:
  82. - secretRef:
  83. name: storj-config
  84. securityContext:
  85. runAsUser: {{ .Values.storjRunAs.user }}
  86. runAsGroup: {{ .Values.storjRunAs.group }}
  87. readOnlyRootFilesystem: false
  88. command:
  89. - /bin/sh
  90. - -c
  91. - |
  92. test ! -f /app/config/config.yaml && export SETUP="true"; /entrypoint
  93. {{- end -}}