deployment.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "common.names.fullname" . }}
  5. labels:
  6. app: {{ template "common.names.name" . }}
  7. chart: {{ template "common.names.chart" . }}
  8. release: {{ .Release.Name }}
  9. heritage: {{ .Release.Service }}
  10. annotations:
  11. rollme: {{ randAlphaNum 5 | quote }}
  12. spec:
  13. replicas: {{ (default 1 .Values.replicas) }}
  14. strategy:
  15. type: {{ (default "Recreate" .Values.updateStrategy ) }}
  16. selector:
  17. matchLabels:
  18. app: {{ template "common.names.name" . }}
  19. release: {{ .Release.Name }}
  20. template:
  21. metadata:
  22. name: {{ template "common.names.fullname" . }}
  23. labels:
  24. app: {{ template "common.names.name" . }}
  25. release: {{ .Release.Name }}
  26. {{- include "common.labels.selectorLabels" . | nindent 8 }}
  27. annotations: {{ include "common.annotations" . | nindent 8 }}
  28. spec:
  29. serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
  30. hostNetwork: {{ include "minio.hostNetworking" . }}
  31. containers:
  32. - name: {{ .Chart.Name }}
  33. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  34. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  35. {{- include "minio.tlsKeysVolumeMount" . | nindent 12 }}
  36. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  37. - name: extrappvolume-{{ $index }}
  38. mountPath: {{ $hostPathConfiguration.mountPath }}
  39. {{ end }}
  40. command:
  41. - "/bin/sh"
  42. - "-ce"
  43. - {{ include "minio.commandArgs" . }}
  44. ports:
  45. - name: api
  46. containerPort: 9000
  47. - name: console
  48. containerPort: 9001
  49. env:
  50. {{ $secretName := (include "minio.secretName" .) }}
  51. {{ $envList := (default list .Values.environmentVariables) }}
  52. {{ if and (eq (include "minio.certAvailable" .) "true") .Values.minioDomain }}
  53. {{ $envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.consolePort | int))) }}
  54. {{ $envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.nodePort | int))) }}
  55. {{ end }}
  56. {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }}
  57. {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }}
  58. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  59. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  60. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  61. {{- include "minio.tlsKeysVolume" . | nindent 8 }}
  62. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  63. - name: extrappvolume-{{ $index }}
  64. hostPath:
  65. path: {{ $hostPathConfiguration.hostPath }}
  66. {{ end }}