diff --git a/stable/minio/Chart.yaml b/stable/minio/Chart.yaml index 99f000acc8..f583ac6e86 100755 --- a/stable/minio/Chart.yaml +++ b/stable/minio/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: MinIO is a high performance distributed object storage server, designed for large-scale private cloud infrastructure. name: minio -version: 2.5.13 +version: 2.5.14 appVersion: RELEASE.2019-08-07T01-59-21Z keywords: - storage diff --git a/stable/minio/templates/_helpers.tpl b/stable/minio/templates/_helpers.tpl index 5939428d48..2e6439b0c4 100644 --- a/stable/minio/templates/_helpers.tpl +++ b/stable/minio/templates/_helpers.tpl @@ -42,6 +42,39 @@ Return the appropriate apiVersion for networkpolicy. {{- end -}} {{- end -}} +{{/* +Return the appropriate apiVersion for deployment. +*/}} +{{- define "minio.deployment.apiVersion" -}} +{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "apps/v1beta2" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for statefulset. +*/}} +{{- define "minio.statefulset.apiVersion" -}} +{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "apps/v1beta2" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for ingress. +*/}} +{{- define "minio.ingress.apiVersion" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else -}} +{{- print "networking.k8s.io/v1beta1" -}} +{{- end -}} +{{- end -}} + {{/* Determine service account name for deployment or statefulset. */}} diff --git a/stable/minio/templates/deployment.yaml b/stable/minio/templates/deployment.yaml index 5cd918ce1c..1a001fa691 100644 --- a/stable/minio/templates/deployment.yaml +++ b/stable/minio/templates/deployment.yaml @@ -1,5 +1,5 @@ {{- if eq .Values.mode "standalone" }} -apiVersion: apps/v1beta2 +apiVersion: {{ template "minio.deployment.apiVersion" . }} kind: Deployment metadata: name: {{ template "minio.fullname" . }} @@ -46,10 +46,10 @@ spec: {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} - {{- if .Values.podAnnotations }} annotations: -{{ toYaml .Values.podAnnotations | indent 8 }} - {{- end }} + checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} +{{- if .Values.podAnnotations }}{{ toYaml .Values.podAnnotations | indent 8 }}{{- end }} spec: {{- if .Values.priorityClassName }} priorityClassName: "{{ .Values.priorityClassName }}" diff --git a/stable/minio/templates/ingress.yaml b/stable/minio/templates/ingress.yaml index 5168b861f4..e71451055c 100644 --- a/stable/minio/templates/ingress.yaml +++ b/stable/minio/templates/ingress.yaml @@ -2,7 +2,7 @@ {{- $fullName := include "minio.fullname" . -}} {{- $servicePort := .Values.service.port -}} {{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "minio.ingress.apiVersion" . }} kind: Ingress metadata: name: {{ $fullName }} diff --git a/stable/minio/templates/secrets.yaml b/stable/minio/templates/secrets.yaml index b01e0d3cd7..8eb7eea82f 100644 --- a/stable/minio/templates/secrets.yaml +++ b/stable/minio/templates/secrets.yaml @@ -10,8 +10,8 @@ metadata: heritage: {{ .Release.Service }} type: Opaque data: - accesskey: {{ .Values.accessKey | b64enc }} - secretkey: {{ .Values.secretKey | b64enc }} + accesskey: {{ if .Values.accessKey }}{{ .Values.accessKey | b64enc | quote }}{{ else }}{{ randAlphaNum 20 | b64enc | quote }}{{ end }} + secretkey: {{ if .Values.secretKey }}{{ .Values.secretKey | b64enc | quote }}{{ else }}{{ randAlphaNum 40 | b64enc | quote }}{{ end }} {{- if .Values.gcsgateway.enabled }} gcs_key.json: {{ .Values.gcsgateway.gcsKeyJson | b64enc }} {{- end }} diff --git a/stable/minio/templates/statefulset.yaml b/stable/minio/templates/statefulset.yaml index b967ff322c..1f2005f065 100644 --- a/stable/minio/templates/statefulset.yaml +++ b/stable/minio/templates/statefulset.yaml @@ -18,7 +18,7 @@ spec: selector: app: {{ template "minio.name" . }} --- -apiVersion: apps/v1beta1 +apiVersion: {{ template "minio.statefulset.apiVersion" . }} kind: StatefulSet metadata: name: {{ template "minio.fullname" . }} @@ -46,10 +46,10 @@ spec: {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} - {{- if .Values.podAnnotations }} annotations: -{{ toYaml .Values.podAnnotations | indent 8 }} - {{- end }} + checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} +{{- if .Values.podAnnotations }}{{ toYaml .Values.podAnnotations | indent 8 }}{{- end }} spec: {{- if .Values.priorityClassName }} priorityClassName: "{{ .Values.priorityClassName }}" diff --git a/stable/minio/values.yaml b/stable/minio/values.yaml index 61c49ed7c0..03f38e76f0 100755 --- a/stable/minio/values.yaml +++ b/stable/minio/values.yaml @@ -39,6 +39,7 @@ priorityClassName: "" ## Set default accesskey, secretkey, Minio config file path, volume mount path and ## number of nodes (only used for Minio distributed mode) +## AccessKey and secretKey is generated when not set ## Distributed Minio ref: https://docs.minio.io/docs/distributed-minio-quickstart-guide ## existingSecret: ""