_minio.tpl 3.1 KB

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