apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: name: {{ template "common.names.fullname" . }} labels: app: {{ template "common.names.name" . }} chart: {{ template "common.names.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} annotations: rollme: {{ randAlphaNum 5 | quote }} spec: replicas: {{ (default 1 .Values.replicas) }} strategy: type: {{ (default "Recreate" .Values.updateStrategy ) }} selector: matchLabels: app: {{ template "common.names.name" . }} release: {{ .Release.Name }} template: metadata: name: {{ template "common.names.fullname" . }} labels: app: {{ template "common.names.name" . }} release: {{ .Release.Name }} {{- include "common.labels.selectorLabels" . | nindent 8 }} annotations: {{ include "common.annotations" . | nindent 8 }} spec: securityContext: runAsUser: {{ .Values.runAsUser }} runAsGroup: {{ .Values.runAsGroup }} serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }} hostNetwork: {{ include "minio.hostNetworking" . }} containers: - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} {{- include "minio.tlsKeysVolumeMount" . | nindent 12 }} {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} - name: extrappvolume-{{ $index }} mountPath: {{ $hostPathConfiguration.mountPath }} {{ end }} command: - "/bin/sh" - "-ce" - {{ include "minio.commandArgs" . }} ports: - name: api containerPort: 9000 - name: console containerPort: 9001 env: {{ $secretName := (include "minio.secretName" .) }} {{ $envList := (default list .Values.environmentVariables) }} {{ if and (eq (include "minio.certAvailable" .) "true") .Values.minioDomain }} {{ $envList = mustAppend $envList (dict "name" "MINIO_BROWSER_REDIRECT_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.consolePort | int))) }} {{ $envList = mustAppend $envList (dict "name" "MINIO_SERVER_URL" "value" (printf "%s://%s:%d" (include "minio.scheme" .) .Values.minioDomain (.Values.service.nodePort | int))) }} {{ end }} {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }} {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }} {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} {{- include "minio.tlsKeysVolume" . | nindent 8 }} {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} - name: extrappvolume-{{ $index }} hostPath: path: {{ $hostPathConfiguration.hostPath }} {{ end }}