Reformat helm chart templates (#16947)

This commit is contained in:
Denis Krivenko 2023-04-17 08:04:15 +02:00 committed by GitHub
parent 839b9c9271
commit 18515a4e3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 268 additions and 310 deletions

View File

@ -9,24 +9,24 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
initialize: |- initialize: |-
{{ include (print $.Template.BasePath "/_helper_create_bucket.txt") . | indent 4 }} {{- include (print $.Template.BasePath "/_helper_create_bucket.txt") . | nindent 4 }}
add-user: |- add-user: |-
{{ include (print $.Template.BasePath "/_helper_create_user.txt") . | indent 4 }} {{- include (print $.Template.BasePath "/_helper_create_user.txt") . | nindent 4 }}
add-policy: |- add-policy: |-
{{ include (print $.Template.BasePath "/_helper_create_policy.txt") . | indent 4 }} {{- include (print $.Template.BasePath "/_helper_create_policy.txt") . | nindent 4 }}
{{- range $idx, $policy := .Values.policies }} {{- range $idx, $policy := .Values.policies }}
# Policy: {{ $policy.name }} # Policy: {{ $policy.name }}
policy_{{ $idx }}.json: |- policy_{{ $idx }}.json: |-
{{ include (print $.Template.BasePath "/_helper_policy.tpl") . | indent 4 }} {{- include (print $.Template.BasePath "/_helper_policy.tpl") . | nindent 4 }}
{{ end }} {{ end }}
{{- range $idx, $svc := .Values.svcaccts }} {{- range $idx, $svc := .Values.svcaccts }}
{{- if $svc.policy }} {{- if $svc.policy }}
# SVC: {{ $svc.accessKey }} # SVC: {{ $svc.accessKey }}
svc_policy_{{ $idx }}.json: |- svc_policy_{{ $idx }}.json: |-
{{ include (print $.Template.BasePath "/_helper_policy.tpl") .policy | indent 4 }} {{- include (print $.Template.BasePath "/_helper_policy.tpl") .policy | nindent 4 }}
{{- end }}
{{- end }} {{- end }}
{{ end }}
add-svcacct: |- add-svcacct: |-
{{ include (print $.Template.BasePath "/_helper_create_svcacct.txt") . | indent 4 }} {{- include (print $.Template.BasePath "/_helper_create_svcacct.txt") . | nindent 4 }}
custom-command: |- custom-command: |-
{{ include (print $.Template.BasePath "/_helper_custom_command.txt") . | indent 4 }} {{- include (print $.Template.BasePath "/_helper_custom_command.txt") . | nindent 4 }}

View File

@ -12,12 +12,10 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- with .Values.consoleIngress.labels }} {{- with .Values.consoleIngress.labels }}
{{ toYaml . | indent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .Values.consoleIngress.annotations }} {{- with .Values.consoleIngress.annotations }}
annotations: annotations: {{- toYaml . | nindent 4 }}
{{ toYaml . | indent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.consoleIngress.ingressClassName }} {{- if .Values.consoleIngress.ingressClassName }}

View File

@ -1,7 +1,4 @@
{{ $scheme := "http" }} {{ $scheme := .Values.tls.enabled | ternary "https" "http" }}
{{- if .Values.tls.enabled }}
{{ $scheme = "https" }}
{{ end }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -12,15 +9,14 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- if .Values.consoleService.annotations }} {{- if .Values.consoleService.annotations }}
annotations: annotations: {{- toYaml .Values.consoleService.annotations | nindent 4 }}
{{ toYaml .Values.consoleService.annotations | indent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if (or (eq .Values.consoleService.type "ClusterIP" "") (empty .Values.consoleService.type)) }} {{- if (or (eq .Values.consoleService.type "ClusterIP" "") (empty .Values.consoleService.type)) }}
type: ClusterIP type: ClusterIP
{{- if not (empty .Values.consoleService.clusterIP) }} {{- if not (empty .Values.consoleService.clusterIP) }}
clusterIP: {{ .Values.consoleService.clusterIP }} clusterIP: {{ .Values.consoleService.clusterIP }}
{{end}} {{- end }}
{{- else if eq .Values.consoleService.type "LoadBalancer" }} {{- else if eq .Values.consoleService.type "LoadBalancer" }}
type: {{ .Values.consoleService.type }} type: {{ .Values.consoleService.type }}
loadBalancerIP: {{ default "" .Values.consoleService.loadBalancerIP }} loadBalancerIP: {{ default "" .Values.consoleService.loadBalancerIP }}

View File

@ -1,8 +1,5 @@
{{- if eq .Values.mode "standalone" }} {{- if eq .Values.mode "standalone" }}
{{ $scheme := "http" }} {{ $scheme := .Values.tls.enabled | ternary "https" "http" }}
{{- if .Values.tls.enabled }}
{{ $scheme = "https" }}
{{ end }}
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }} {{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
apiVersion: {{ template "minio.deployment.apiVersion" . }} apiVersion: {{ template "minio.deployment.apiVersion" . }}
kind: Deployment kind: Deployment
@ -14,11 +11,10 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- if .Values.additionalLabels }} {{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }} {{- toYaml .Values.additionalLabels | nindent 4 }}
{{- end }} {{- end }}
{{- if .Values.additionalAnnotations }} {{- if .Values.additionalAnnotations }}
annotations: annotations: {{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }}
{{- end }} {{- end }}
spec: spec:
strategy: strategy:
@ -40,7 +36,7 @@ spec:
app: {{ template "minio.name" . }} app: {{ template "minio.name" . }}
release: {{ .Release.Name }} release: {{ .Release.Name }}
{{- if .Values.podLabels }} {{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }} {{- toYaml .Values.podLabels | nindent 8 }}
{{- end }} {{- end }}
annotations: annotations:
{{- if not .Values.ignoreChartChecksums }} {{- if not .Values.ignoreChartChecksums }}
@ -48,7 +44,7 @@ spec:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }} {{- end }}
{{- if .Values.podAnnotations }} {{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} {{- toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.priorityClassName }} {{- if .Values.priorityClassName }}
@ -160,8 +156,7 @@ spec:
- name: {{ $key }} - name: {{ $key }}
value: {{ $val | quote }} value: {{ $val | quote }}
{{- end }} {{- end }}
resources: resources: {{- toYaml .Values.resources | nindent 12 }}
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.extraContainers }} {{- with .Values.extraContainers }}
{{- if eq (typeOf .) "string" }} {{- if eq (typeOf .) "string" }}
{{- tpl . $ | nindent 8 }} {{- tpl . $ | nindent 8 }}
@ -170,17 +165,14 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- include "minio.imagePullSecrets" . | indent 6 }} {{- include "minio.imagePullSecrets" . | indent 6 }}
{{- with .Values.affinity }} {{- with .Values.affinity }}
affinity: affinity: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
volumes: volumes:
- name: export - name: export

View File

@ -12,12 +12,10 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- with .Values.ingress.labels }} {{- with .Values.ingress.labels }}
{{ toYaml . | indent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.annotations }}
annotations: annotations: {{- toYaml . | nindent 4 }}
{{ toYaml . | indent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.ingress.ingressClassName }} {{- if .Values.ingress.ingressClassName }}

View File

@ -24,23 +24,19 @@ spec:
{{- toYaml .Values.podLabels | nindent 8 }} {{- toYaml .Values.podLabels | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.postJob.podAnnotations }} {{- if .Values.postJob.podAnnotations }}
annotations: annotations: {{- toYaml .Values.postJob.podAnnotations | nindent 8 }}
{{- toYaml .Values.postJob.podAnnotations | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
restartPolicy: OnFailure restartPolicy: OnFailure
{{- include "minio.imagePullSecrets" . | nindent 6 }} {{- include "minio.imagePullSecrets" . | indent 6 }}
{{- if .Values.nodeSelector }} {{- if .Values.nodeSelector }}
nodeSelector: nodeSelector: {{- toYaml .Values.postJob.nodeSelector | nindent 8 }}
{{- toYaml .Values.postJob.nodeSelector | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.postJob.affinity }} {{- with .Values.postJob.affinity }}
affinity: affinity: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- with .Values.postJob.tolerations }} {{- with .Values.postJob.tolerations }}
tolerations: tolerations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.postJob.securityContext.enabled }} {{- if .Values.postJob.securityContext.enabled }}
securityContext: securityContext:
@ -81,7 +77,7 @@ spec:
items: items:
- key: {{ .Values.tls.publicCrt }} - key: {{ .Values.tls.publicCrt }}
path: CAs/public.crt path: CAs/public.crt
{{ end }} {{- end }}
containers: containers:
{{- if .Values.buckets }} {{- if .Values.buckets }}
- name: minio-make-bucket - name: minio-make-bucket
@ -109,9 +105,8 @@ spec:
{{- if .Values.tls.enabled }} {{- if .Values.tls.enabled }}
- name: cert-secret-volume-mc - name: cert-secret-volume-mc
mountPath: {{ .Values.configPathmc }}certs mountPath: {{ .Values.configPathmc }}certs
{{ end }} {{- end }}
resources: resources: {{- toYaml .Values.makeBucketJob.resources | nindent 12 }}
{{- toYaml .Values.makeBucketJob.resources | nindent 12 }}
{{- end }} {{- end }}
{{- if .Values.users }} {{- if .Values.users }}
- name: minio-make-user - name: minio-make-user
@ -139,9 +134,8 @@ spec:
{{- if .Values.tls.enabled }} {{- if .Values.tls.enabled }}
- name: cert-secret-volume-mc - name: cert-secret-volume-mc
mountPath: {{ .Values.configPathmc }}certs mountPath: {{ .Values.configPathmc }}certs
{{ end }} {{- end }}
resources: resources: {{- toYaml .Values.makeUserJob.resources | nindent 12 }}
{{- toYaml .Values.makeUserJob.resources | nindent 12 }}
{{- end }} {{- end }}
{{- if .Values.policies }} {{- if .Values.policies }}
- name: minio-make-policy - name: minio-make-policy
@ -169,9 +163,8 @@ spec:
{{- if .Values.tls.enabled }} {{- if .Values.tls.enabled }}
- name: cert-secret-volume-mc - name: cert-secret-volume-mc
mountPath: {{ .Values.configPathmc }}certs mountPath: {{ .Values.configPathmc }}certs
{{ end }} {{- end }}
resources: resources: {{- toYaml .Values.makePolicyJob.resources | nindent 12 }}
{{- toYaml .Values.makePolicyJob.resources | nindent 12 }}
{{- end }} {{- end }}
{{- if .Values.customCommands }} {{- if .Values.customCommands }}
- name: minio-custom-command - name: minio-custom-command
@ -199,9 +192,8 @@ spec:
{{- if .Values.tls.enabled }} {{- if .Values.tls.enabled }}
- name: cert-secret-volume-mc - name: cert-secret-volume-mc
mountPath: {{ .Values.configPathmc }}certs mountPath: {{ .Values.configPathmc }}certs
{{ end }} {{- end }}
resources: resources: {{- toYaml .Values.customCommandJob.resources | nindent 12 }}
{{- toYaml .Values.customCommandJob.resources | nindent 12 }}
{{- end }} {{- end }}
{{- if .Values.svcaccts }} {{- if .Values.svcaccts }}
- name: minio-make-svcacct - name: minio-make-svcacct
@ -229,8 +221,7 @@ spec:
{{- if .Values.tls.enabled }} {{- if .Values.tls.enabled }}
- name: cert-secret-volume-mc - name: cert-secret-volume-mc
mountPath: {{ .Values.configPathmc }}certs mountPath: {{ .Values.configPathmc }}certs
{{ end }} {{- end }}
resources: resources: {{- toYaml .Values.makeServiceAccountJob.resources | nindent 12 }}
{{- toYaml .Values.makeServiceAccountJob.resources | nindent 12 }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -10,8 +10,7 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- if .Values.persistence.annotations }} {{- if .Values.persistence.annotations }}
annotations: annotations: {{- toYaml .Values.persistence.annotations | nindent 4 }}
{{ toYaml .Values.persistence.annotations | trimSuffix "\n" | indent 4 }}
{{- end }} {{- end }}
spec: spec:
accessModes: accessModes:
@ -19,7 +18,6 @@ spec:
resources: resources:
requests: requests:
storage: {{ .Values.persistence.size | quote }} storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }} {{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }} {{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: "" storageClassName: ""

View File

@ -1,7 +1,4 @@
{{ $scheme := "http" }} {{ $scheme := .Values.tls.enabled | ternary "https" "http" }}
{{- if .Values.tls.enabled }}
{{ $scheme = "https" }}
{{ end }}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -13,15 +10,14 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
monitoring: "true" monitoring: "true"
{{- if .Values.service.annotations }} {{- if .Values.service.annotations }}
annotations: annotations: {{- toYaml .Values.service.annotations | nindent 4 }}
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if (or (eq .Values.service.type "ClusterIP" "") (empty .Values.service.type)) }} {{- if (or (eq .Values.service.type "ClusterIP" "") (empty .Values.service.type)) }}
type: ClusterIP type: ClusterIP
{{- if not (empty .Values.service.clusterIP) }} {{- if not (empty .Values.service.clusterIP) }}
clusterIP: {{ .Values.service.clusterIP }} clusterIP: {{ .Values.service.clusterIP }}
{{end}} {{- end }}
{{- else if eq .Values.service.type "LoadBalancer" }} {{- else if eq .Values.service.type "LoadBalancer" }}
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }} loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }}

View File

@ -1,4 +1,4 @@
{{- if .Values.serviceAccount.create -}} {{- if .Values.serviceAccount.create }}
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:

View File

@ -12,11 +12,10 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }} {{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }} {{- end }}
{{- if .Values.metrics.serviceMonitor.annotations }} {{- if .Values.metrics.serviceMonitor.annotations }}
annotations: annotations: {{- toYaml .Values.metrics.serviceMonitor.annotations | nindent 4 }}
{{ toYaml .Values.metrics.serviceMonitor.annotations | trimSuffix "\n" | indent 4 }}
{{- end }} {{- end }}
spec: spec:
endpoints: endpoints:
@ -29,7 +28,7 @@ spec:
name: {{ .Values.tls.certSecret }} name: {{ .Values.tls.certSecret }}
key: {{ .Values.tls.publicCrt }} key: {{ .Values.tls.publicCrt }}
serverName: {{ template "minio.fullname" . }} serverName: {{ template "minio.fullname" . }}
{{ else }} {{- else }}
- port: http - port: http
scheme: http scheme: http
{{- end }} {{- end }}
@ -41,7 +40,7 @@ spec:
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }} {{- end }}
{{- if .Values.metrics.serviceMonitor.relabelConfigs }} {{- if .Values.metrics.serviceMonitor.relabelConfigs }}
{{ toYaml .Values.metrics.serviceMonitor.relabelConfigs | indent 6 }} {{- toYaml .Values.metrics.serviceMonitor.relabelConfigs | nindent 6 }}
{{- end }} {{- end }}
{{- if not .Values.metrics.serviceMonitor.public }} {{- if not .Values.metrics.serviceMonitor.public }}
bearerTokenSecret: bearerTokenSecret:
@ -72,7 +71,7 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }} {{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
jobName: {{ template "minio.fullname" . }} jobName: {{ template "minio.fullname" . }}
@ -89,11 +88,11 @@ spec:
path: /minio/v2/metrics/cluster path: /minio/v2/metrics/cluster
{{- if .Values.tls.enabled }} {{- if .Values.tls.enabled }}
scheme: https scheme: https
{{ else }} {{- else }}
scheme: http scheme: http
{{- end }} {{- end }}
{{- if .Values.metrics.serviceMonitor.relabelConfigsCluster }} {{- if .Values.metrics.serviceMonitor.relabelConfigsCluster }}
{{ toYaml .Values.metrics.serviceMonitor.relabelConfigsCluster | indent 2 }} {{- toYaml .Values.metrics.serviceMonitor.relabelConfigsCluster | nindent 2 }}
{{- end }} {{- end }}
targets: targets:
staticConfig: staticConfig:

View File

@ -3,10 +3,7 @@
{{ $nodeCount := .Values.replicas | int }} {{ $nodeCount := .Values.replicas | int }}
{{ $replicas := mul $poolCount $nodeCount }} {{ $replicas := mul $poolCount $nodeCount }}
{{ $drivesPerNode := .Values.drivesPerNode | int }} {{ $drivesPerNode := .Values.drivesPerNode | int }}
{{ $scheme := "http" }} {{ $scheme := .Values.tls.enabled | ternary "https" "http" }}
{{- if .Values.tls.enabled }}
{{ $scheme = "https" }}
{{ end }}
{{ $mountPath := .Values.mountPath }} {{ $mountPath := .Values.mountPath }}
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }} {{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
{{ $subPath := .Values.persistence.subPath }} {{ $subPath := .Values.persistence.subPath }}
@ -21,8 +18,8 @@ metadata:
labels: labels:
app: {{ template "minio.name" . }} app: {{ template "minio.name" . }}
chart: {{ template "minio.chart" . }} chart: {{ template "minio.chart" . }}
release: "{{ .Release.Name }}" release: {{ .Release.Name }}
heritage: "{{ .Release.Service }}" heritage: {{ .Release.Service }}
spec: spec:
publishNotReadyAddresses: true publishNotReadyAddresses: true
clusterIP: None clusterIP: None
@ -45,11 +42,10 @@ metadata:
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- if .Values.additionalLabels }} {{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }} {{- toYaml .Values.additionalLabels | nindent 4 }}
{{- end }} {{- end }}
{{- if .Values.additionalAnnotations }} {{- if .Values.additionalAnnotations }}
annotations: annotations: {{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }}
{{- end }} {{- end }}
spec: spec:
updateStrategy: updateStrategy:
@ -68,7 +64,7 @@ spec:
app: {{ template "minio.name" . }} app: {{ template "minio.name" . }}
release: {{ .Release.Name }} release: {{ .Release.Name }}
{{- if .Values.podLabels }} {{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }} {{- toYaml .Values.podLabels | nindent 8 }}
{{- end }} {{- end }}
annotations: annotations:
{{- if not .Values.ignoreChartChecksums }} {{- if not .Values.ignoreChartChecksums }}
@ -76,7 +72,7 @@ spec:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }} {{- end }}
{{- if .Values.podAnnotations }} {{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} {{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.priorityClassName }} {{- if .Values.priorityClassName }}
@ -94,17 +90,18 @@ spec:
fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy }} fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{ if .Values.serviceAccount.create }} {{- if .Values.serviceAccount.create }}
serviceAccountName: {{ .Values.serviceAccount.name }} serviceAccountName: {{ .Values.serviceAccount.name }}
{{- end }} {{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [
command: [ "/bin/sh", "/bin/sh",
"-ce", "-ce",
"/usr/bin/docker-entrypoint.sh minio server {{- range $i := until $poolCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{else}}{{ $bucketRoot }}{{end}}{{- end}} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template `minio.extraArgs` . }}" ] "/usr/bin/docker-entrypoint.sh minio server {{- range $i := until $poolCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{ else }}{{ $bucketRoot }}{{end }}{{- end }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template `minio.extraArgs` . }}"
]
volumeMounts: volumeMounts:
{{- if $penabled }} {{- if $penabled }}
{{- if (gt $drivesPerNode 1) }} {{- if (gt $drivesPerNode 1) }}
@ -177,8 +174,7 @@ spec:
- name: {{ $key }} - name: {{ $key }}
value: {{ $val | quote }} value: {{ $val | quote }}
{{- end }} {{- end }}
resources: resources: {{- toYaml .Values.resources | nindent 12 }}
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.extraContainers }} {{- with .Values.extraContainers }}
{{- if eq (typeOf .) "string" }} {{- if eq (typeOf .) "string" }}
{{- tpl . $ | nindent 8 }} {{- tpl . $ | nindent 8 }}
@ -187,22 +183,18 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- include "minio.imagePullSecrets" . | indent 6 }} {{- include "minio.imagePullSecrets" . | indent 6 }}
{{- with .Values.affinity }} {{- with .Values.affinity }}
affinity: affinity: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- if and (gt $replicas 1) (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "19") }} {{- if and (gt $replicas 1) (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "19") }}
{{- with .Values.topologySpreadConstraints }} {{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints: topologySpreadConstraints: {{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
volumes: volumes:
@ -216,7 +208,7 @@ spec:
{{- end }} {{- end }}
{{- include "minio.tlsKeysVolume" . | indent 8 }} {{- include "minio.tlsKeysVolume" . | indent 8 }}
{{- if .Values.extraVolumes }} {{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | nindent 8 }} {{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
volumeClaimTemplates: volumeClaimTemplates:
@ -225,8 +217,7 @@ spec:
- metadata: - metadata:
name: export-{{ $diskId }} name: export-{{ $diskId }}
{{- if $.Values.persistence.annotations }} {{- if $.Values.persistence.annotations }}
annotations: annotations: {{- toYaml $.Values.persistence.annotations | nindent 10 }}
{{ toYaml $.Values.persistence.annotations | trimSuffix "\n" | indent 10 }}
{{- end }} {{- end }}
spec: spec:
accessModes: [ {{ $accessMode | quote }} ] accessModes: [ {{ $accessMode | quote }} ]
@ -241,8 +232,7 @@ spec:
- metadata: - metadata:
name: export name: export
{{- if $.Values.persistence.annotations }} {{- if $.Values.persistence.annotations }}
annotations: annotations: {{- toYaml $.Values.persistence.annotations | nindent 10 }}
{{ toYaml $.Values.persistence.annotations | trimSuffix "\n" | indent 10 }}
{{- end }} {{- end }}
spec: spec:
accessModes: [ {{ $accessMode | quote }} ] accessModes: [ {{ $accessMode | quote }} ]