_minio.tpl 3.3 KB

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