181 lines
7.6 KiB
YAML
Executable file
181 lines
7.6 KiB
YAML
Executable file
{{- if eq .Values.mode "distributed" }}
|
|
{{- $replicaCount := int .Values.statefulset.replicaCount }}
|
|
{{- if and (eq (mod $replicaCount 2) 0) (gt $replicaCount 3) (lt $replicaCount 33) }}
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ include "minio.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels: {{- include "minio.labels" . | nindent 4 }}
|
|
spec:
|
|
selector:
|
|
matchLabels: {{- include "minio.matchLabels" . | nindent 6 }}
|
|
serviceName: {{ include "minio.fullname" . }}-headless
|
|
replicas: {{ .Values.statefulset.replicaCount }}
|
|
podManagementPolicy: {{ .Values.statefulset.podManagementPolicy }}
|
|
updateStrategy:
|
|
type: {{ .Values.statefulset.updateStrategy }}
|
|
{{- if (eq "Recreate" .Values.statefulset.updateStrategy) }}
|
|
rollingUpdate: null
|
|
{{- end }}
|
|
template:
|
|
metadata:
|
|
labels: {{- include "minio.labels" . | nindent 8 }}
|
|
{{- if or .Values.podAnnotations (include "minio.createSecret" .) }}
|
|
annotations:
|
|
{{- if (include "minio.createSecret" .) }}
|
|
checksum/credentials-secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
|
{{- end }}
|
|
{{- if .Values.podAnnotations }}
|
|
{{- include "minio.tplValue" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.schedulerName }}
|
|
schedulerName: {{ .Values.schedulerName }}
|
|
{{- end }}
|
|
serviceAccountName: {{ template "minio.serviceAccountName" . }}
|
|
{{- include "minio.imagePullSecrets" . | nindent 6 }}
|
|
{{- if .Values.affinity }}
|
|
affinity: {{- include "minio.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.nodeSelector }}
|
|
nodeSelector: {{- include "minio.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.tolerations }}
|
|
tolerations: {{- include "minio.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.securityContext.enabled }}
|
|
securityContext:
|
|
fsGroup: {{ .Values.securityContext.fsGroup }}
|
|
{{- end }}
|
|
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
|
initContainers:
|
|
- name: volume-permissions
|
|
image: {{ template "minio.volumePermissions.image" . }}
|
|
imagePullPolicy: {{ default "" .Values.volumePermissions.image.pullPolicy | quote }}
|
|
command:
|
|
- /bin/bash
|
|
- -ec
|
|
- |
|
|
chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} {{ .Values.persistence.mountPath }}
|
|
securityContext:
|
|
runAsUser: 0
|
|
{{- if .Values.volumePermissions.resources }}
|
|
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- end }}
|
|
containers:
|
|
- name: minio
|
|
image: {{ include "minio.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
|
{{- if .Values.securityContext.enabled }}
|
|
securityContext:
|
|
runAsUser: {{ .Values.securityContext.runAsUser }}
|
|
{{- end }}
|
|
env:
|
|
- name: BITNAMI_DEBUG
|
|
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
|
- name: MINIO_DISTRIBUTED_MODE_ENABLED
|
|
value: "yes"
|
|
- name: MINIO_SKIP_CLIENT
|
|
value: "yes"
|
|
- name: MINIO_DISTRIBUTED_NODES
|
|
{{- $minioFullname := include "minio.fullname" . }}
|
|
{{- $minioHeadlessServiceName := printf "%s-%s" $minioFullname "headless" | trunc 63 }}
|
|
{{- $releaseNamespace := .Release.Namespace }}
|
|
value: {{range $i, $e := until $replicaCount }}{{ $minioFullname }}-{{ $e }}.{{ $minioHeadlessServiceName }}.{{ $releaseNamespace }}.svc.{{ $.Values.clusterDomain }},{{ end }}
|
|
- name: MINIO_FORCE_NEW_KEYS
|
|
value: {{ ternary "yes" "no" .Values.forceNewKeys | quote }}
|
|
{{- if .Values.useCredentialsFile }}
|
|
- name: MINIO_ACCESS_KEY_FILE
|
|
value: "/opt/bitnami/minio/secrets/access-key"
|
|
{{- else }}
|
|
- name: MINIO_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "minio.secretName" . }}
|
|
key: access-key
|
|
{{- end }}
|
|
{{- if .Values.useCredentialsFile }}
|
|
- name: MINIO_SECRET_KEY_FILE
|
|
value: "/opt/bitnami/minio/secrets/secret-key"
|
|
{{- else }}
|
|
- name: MINIO_SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "minio.secretName" . }}
|
|
key: secret-key
|
|
{{- end }}
|
|
- name: MINIO_BROWSER
|
|
value: {{ ternary "off" "on" .Values.disableWebUI | quote }}
|
|
{{- if .Values.prometheusAuthType }}
|
|
- name: MINIO_PROMETHEUS_AUTH_TYPE
|
|
value: {{ .Values.prometheusAuthType }}
|
|
{{- end }}
|
|
{{- if .Values.extraEnv }}
|
|
{{- toYaml .Values.extraEnv | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: minio
|
|
containerPort: 9000
|
|
{{- if .Values.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
httpGet:
|
|
path: /minio/health/live
|
|
port: minio
|
|
{{- end }}
|
|
{{- if .Values.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
tcpSocket:
|
|
port: minio
|
|
{{- end }}
|
|
{{- if .Values.resources }}
|
|
resources: {{ toYaml .Values.resources | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- if .Values.useCredentialsFile }}
|
|
- name: minio-credentials
|
|
mountPath: /opt/bitnami/minio/secrets/
|
|
{{- end }}
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
volumes:
|
|
{{- if .Values.useCredentialsFile }}
|
|
- name: minio-credentials
|
|
secret:
|
|
secretName: {{ include "minio.secretName" . }}
|
|
{{- end }}
|
|
{{- if not .Values.persistence.enabled }}
|
|
- name: data
|
|
emptyDir: {}
|
|
{{- else }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
labels: {{- include "minio.matchLabels" . | nindent 10 }}
|
|
{{- if .Values.persistence.annotations }}
|
|
annotations: {{- include "minio.tplValue" ( dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
|
{{- end }}
|
|
spec:
|
|
accessModes: {{ toYaml .Values.persistence.accessModes | nindent 10 }}
|
|
{{ include "minio.storageClass" . }}
|
|
resources:
|
|
requests:
|
|
storage: {{ .Values.persistence.size | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|