_minio.tpl 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. {{- if .Values.minioStorage.logSearchApi }}
  78. wait-api:
  79. enabled: true
  80. type: init
  81. imageSelector: bashImage
  82. command:
  83. - bash
  84. args:
  85. - -c
  86. - |
  87. echo "Waiting for [{{ $logapi }}]";
  88. until wget --spider --quiet --timeout=3 --tries=1 {{ $logapi }}/status;
  89. do
  90. echo "Waiting for [{{ $logapi }}]";
  91. sleep 2;
  92. done
  93. echo "API is up: {{ $logapi }}";
  94. {{- end }}
  95. {{- end -}}