_minio.tpl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {{- define "minio.workload" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
  3. {{- $logapi := printf "http://%v-log:8080" $fullname -}}
  4. workload:
  5. minio:
  6. enabled: true
  7. primary: true
  8. type: Deployment
  9. podSpec:
  10. hostNetwork: {{ .Values.minioStorage.distributedMode }}
  11. containers:
  12. minio:
  13. enabled: true
  14. primary: true
  15. imageSelector: image
  16. securityContext:
  17. runAsUser: 473
  18. runAsGroup: 473
  19. {{- if not .Values.minioStorage.distributedMode }}
  20. env:
  21. MINIO_VOLUMES: {{ .Values.minioStorage.export.mountPath }}
  22. {{- end }}
  23. args:
  24. - server
  25. - --console-address
  26. - {{ printf ":%v" .Values.minioNetwork.consolePort | quote }}
  27. {{- if .Values.minioStorage.distributedMode }}
  28. {{- range .Values.minioStorage.distributedIps }}
  29. - {{ quote . }}
  30. {{- end }}
  31. {{- else }}
  32. - "--address"
  33. - {{ printf ":%v" .Values.minioNetwork.apiPort | quote }}
  34. {{- end }}
  35. {{- if .Values.minioNetwork.certificateID }}
  36. - "--certs-dir"
  37. - "/etc/minio/certs"
  38. {{- end }}
  39. {{- range .Values.minioConfig.extraArgs }}
  40. - {{ quote . }}
  41. {{ end }}
  42. envFrom:
  43. - secretRef:
  44. name: minio-creds
  45. {{ with .Values.minioConfig.additionalEnvs }}
  46. envList:
  47. {{ range $env := . }}
  48. - name: {{ $env.name }}
  49. value: {{ $env.value }}
  50. {{ end }}
  51. {{ end }}
  52. probes:
  53. {{- $proto := "http" -}}
  54. {{- if .Values.minioNetwork.certificateID -}}
  55. {{- $proto = "https" -}}
  56. {{- end }}
  57. liveness:
  58. enabled: true
  59. type: {{ $proto }}
  60. path: /minio/health/live
  61. port: {{ .Values.minioNetwork.consolePort }}
  62. readiness:
  63. enabled: true
  64. type: {{ $proto }}
  65. path: /minio/health/live
  66. port: {{ .Values.minioNetwork.consolePort }}
  67. startup:
  68. enabled: true
  69. type: {{ $proto }}
  70. path: /minio/health/live
  71. port: {{ .Values.minioNetwork.consolePort }}
  72. initContainers:
  73. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  74. "UID" 473
  75. "GID" 473
  76. "mode" "check"
  77. "type" "init") | nindent 8 }}
  78. {{- if .Values.minioStorage.logSearchApi }}
  79. wait-api:
  80. enabled: true
  81. type: init
  82. imageSelector: bashImage
  83. command:
  84. - bash
  85. args:
  86. - -c
  87. - |
  88. echo "Waiting for [{{ $logapi }}]";
  89. until wget --spider --quiet --timeout=3 --tries=1 {{ $logapi }}/status;
  90. do
  91. echo "Waiting for [{{ $logapi }}]";
  92. sleep 2;
  93. done
  94. echo "API is up: {{ $logapi }}";
  95. {{- end }}
  96. {{- end -}}