_minio.tpl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 "containerName" "01-permissions"
  54. "UID" .Values.minioRunAs.user
  55. "GID" .Values.minioRunAs.group
  56. "type" "install") | nindent 8 -}}
  57. {{- if .Values.minioLogging.logsearch.enabled }}
  58. logsearch-wait:
  59. enabled: true
  60. type: init
  61. imageSelector: bashImage
  62. resources:
  63. limits:
  64. cpu: 500m
  65. memory: 256Mi
  66. envFrom:
  67. - secretRef:
  68. name: minio-creds
  69. command: bash
  70. args:
  71. - -c
  72. - |
  73. echo "Pinging Logsearch API for readiness..."
  74. until wget --spider --quiet --timeout=3 --tries=1 ${MINIO_LOG_QUERY_URL}/status; do
  75. echo "Waiting for Logsearch API (${MINIO_LOG_QUERY_URL}/status) to be ready..."
  76. sleep 2
  77. done
  78. echo "Logsearch API is ready"
  79. {{- end }}
  80. {{/* Service */}}
  81. service:
  82. minio:
  83. enabled: true
  84. primary: true
  85. type: NodePort
  86. targetSelector: minio
  87. ports:
  88. api:
  89. enabled: true
  90. primary: true
  91. port: {{ .Values.minioNetwork.apiPort }}
  92. nodePort: {{ .Values.minioNetwork.apiPort }}
  93. targetSelector: minio
  94. webui:
  95. enabled: true
  96. port: {{ .Values.minioNetwork.webPort }}
  97. nodePort: {{ .Values.minioNetwork.webPort }}
  98. targetSelector: minio
  99. {{/* Persistence */}}
  100. persistence:
  101. {{- range $idx, $storage := .Values.minioStorage }}
  102. {{ printf "data%v" (int $idx) }}:
  103. enabled: true
  104. {{- include "minio.storage.ci.migration" (dict "storage" $storage) }}
  105. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  106. targetSelector:
  107. minio:
  108. minio:
  109. mountPath: {{ $storage.mountPath }}
  110. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  111. 01-permissions:
  112. mountPath: /mnt/directories{{ $storage.mountPath }}
  113. {{- end }}
  114. {{- end }}
  115. # Minio writes temporary files to this directory. Adding this as an emptyDir,
  116. # So we don't have to set readOnlyRootFilesystem to false
  117. tempdir:
  118. enabled: true
  119. type: emptyDir
  120. targetSelector:
  121. minio:
  122. minio:
  123. mountPath: /.minio
  124. {{- if .Values.minioNetwork.certificateID }}
  125. cert:
  126. enabled: true
  127. type: secret
  128. objectName: minio-cert
  129. defaultMode: "0600"
  130. items:
  131. - key: tls.key
  132. path: private.key
  133. - key: tls.crt
  134. path: public.crt
  135. - key: tls.crt
  136. path: CAs/public.crt
  137. targetSelector:
  138. minio:
  139. minio:
  140. mountPath: /.minio/certs
  141. readOnly: true
  142. {{- end -}}
  143. {{- end -}}