_minio.tpl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {{- define "minio.workload" -}}
  2. workload:
  3. minio:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ include "minio.hostnetwork" $ }}
  9. containers:
  10. minio:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.minioRunAs.user }}
  16. runAsGroup: {{ .Values.minioRunAs.group }}
  17. envFrom:
  18. - secretRef:
  19. name: minio-creds
  20. args:
  21. - server
  22. - "--address"
  23. - {{ printf ":%v" .Values.minioNetwork.apiPort | quote }}
  24. - "--console-address"
  25. - {{ printf ":%v" .Values.minioNetwork.webPort | quote }}
  26. {{- if .Values.minioNetwork.certificateID }}
  27. - "--certs-dir"
  28. - "/.minio/certs"
  29. {{- end -}}
  30. {{- if .Values.minioLogging.anonymous }}
  31. - "--anonymous"
  32. {{- end -}}
  33. {{- if .Values.minioLogging.quiet }}
  34. - "--quiet"
  35. {{- end }}
  36. probes:
  37. liveness:
  38. enabled: true
  39. type: {{ include "minio.scheme" $ }}
  40. port: "{{ .Values.minioNetwork.apiPort }}"
  41. path: /minio/health/live
  42. readiness:
  43. enabled: true
  44. type: {{ include "minio.scheme" $ }}
  45. port: "{{ .Values.minioNetwork.apiPort }}"
  46. path: /minio/health/live
  47. startup:
  48. enabled: true
  49. type: {{ include "minio.scheme" $ }}
  50. port: "{{ .Values.minioNetwork.apiPort }}"
  51. path: /minio/health/live
  52. initContainers:
  53. {{- include "ix.v1.common.app.permissions" (dict "UID" .Values.minioRunAs.user
  54. "GID" .Values.minioRunAs.group
  55. "type" "install") | nindent 8 -}}
  56. {{- if .Values.minioLogging.logsearch.enabled }}
  57. logsearch-wait:
  58. enabled: true
  59. type: init
  60. imageSelector: bashImage
  61. resources:
  62. limits:
  63. cpu: 500m
  64. memory: 256Mi
  65. envFrom:
  66. - secretRef:
  67. name: minio-creds
  68. command: bash
  69. args:
  70. - -c
  71. - |
  72. echo "Pinging Logsearch API for readiness..."
  73. until wget --spider --quiet --timeout=3 --tries=1 ${MINIO_LOG_QUERY_URL}/status; do
  74. echo "Waiting for Logsearch API (${MINIO_LOG_QUERY_URL}/status) to be ready..."
  75. sleep 2
  76. done
  77. echo "Logsearch API is ready"
  78. {{- end }}
  79. {{/* Service */}}
  80. service:
  81. minio:
  82. enabled: true
  83. primary: true
  84. type: NodePort
  85. targetSelector: minio
  86. ports:
  87. api:
  88. enabled: true
  89. primary: true
  90. port: {{ .Values.minioNetwork.apiPort }}
  91. nodePort: {{ .Values.minioNetwork.apiPort }}
  92. targetSelector: minio
  93. webui:
  94. enabled: true
  95. port: {{ .Values.minioNetwork.webPort }}
  96. nodePort: {{ .Values.minioNetwork.webPort }}
  97. targetSelector: minio
  98. {{/* Persistence */}}
  99. persistence:
  100. {{- range $idx, $storage := .Values.minioStorage }}
  101. {{ printf "data%v" (int $idx) }}:
  102. enabled: true
  103. type: {{ $storage.type }}
  104. datasetName: {{ $storage.datasetName | default "" }}
  105. hostPath: {{ $storage.hostPath | default "" }}
  106. targetSelector:
  107. minio:
  108. minio:
  109. mountPath: {{ $storage.mountPath }}
  110. permissions:
  111. mountPath: /mnt/directories{{ $storage.mountPath }}
  112. {{- end }}
  113. # Minio writes temporary files to this directory. Adding this as an emptyDir,
  114. # So we don't have to set readOnlyRootFilesystem to false
  115. tempdir:
  116. enabled: true
  117. type: emptyDir
  118. targetSelector:
  119. minio:
  120. minio:
  121. mountPath: /.minio
  122. {{- if .Values.minioNetwork.certificateID }}
  123. cert:
  124. enabled: true
  125. type: secret
  126. objectName: minio-cert
  127. defaultMode: "0600"
  128. items:
  129. - key: tls.key
  130. path: private.key
  131. - key: tls.crt
  132. path: public.crt
  133. - key: tls.crt
  134. path: CAs/public.crt
  135. targetSelector:
  136. minio:
  137. minio:
  138. mountPath: /.minio/certs
  139. readOnly: true
  140. {{- end -}}
  141. {{- end -}}