deployment.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. securityContext:
  30. runAsUser: {{ .Values.runAsUser }}
  31. runAsGroup: {{ .Values.runAsGroup }}
  32. serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
  33. hostNetwork: {{ include "minio.hostNetworking" . }}
  34. containers:
  35. - name: {{ .Chart.Name }}
  36. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  37. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  38. {{- include "minio.tlsKeysVolumeMount" . | nindent 12 }}
  39. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  40. - name: extrappvolume-{{ $index }}
  41. mountPath: {{ $hostPathConfiguration.mountPath }}
  42. {{ end }}
  43. command:
  44. - "/bin/sh"
  45. - "-ce"
  46. - {{ include "minio.commandArgs" . }}
  47. ports:
  48. - name: api
  49. containerPort: 9000
  50. - name: console
  51. containerPort: 9001
  52. env:
  53. {{ $secretName := (include "minio.secretName" .) }}
  54. {{ $envList := (default list .Values.environmentVariables) }}
  55. {{ if and (eq (include "minio.certAvailable" .) "true") .Values.minioDomain }}
  56. {{ $envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.consolePort | int))) }}
  57. {{ $envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.nodePort | int))) }}
  58. {{ end }}
  59. {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }}
  60. {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }}
  61. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  62. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  63. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  64. {{- include "minio.tlsKeysVolume" . | nindent 8 }}
  65. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  66. - name: extrappvolume-{{ $index }}
  67. hostPath:
  68. path: {{ $hostPathConfiguration.hostPath }}
  69. {{ end }}