Add ability to mount extra minio env from secret (#14254)

This commit is contained in:
Domonkos Cinke 2022-02-04 23:53:20 +01:00 committed by GitHub
parent 6123377e66
commit 75adb787c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 0 deletions

View File

@ -81,6 +81,10 @@ spec:
subPath: "{{ .Values.persistence.subPath }}" subPath: "{{ .Values.persistence.subPath }}"
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.extraSecret }}
- name: extra-secret
mountPath: "/tmp/minio-config-env"
{{- end }}
{{- include "minio.tlsKeysVolumeMount" . | indent 12 }} {{- include "minio.tlsKeysVolumeMount" . | indent 12 }}
ports: ports:
- name: {{ $scheme }} - name: {{ $scheme }}
@ -98,6 +102,10 @@ spec:
secretKeyRef: secretKeyRef:
name: {{ template "minio.secretName" . }} name: {{ template "minio.secretName" . }}
key: rootPassword key: rootPassword
{{- if .Values.extraSecret }}
- name: MINIO_CONFIG_ENV_FILE
value: "/tmp/minio-config-env/config.env"
{{- end}}
{{- if .Values.metrics.serviceMonitor.public }} {{- if .Values.metrics.serviceMonitor.public }}
- name: MINIO_PROMETHEUS_AUTH_TYPE - name: MINIO_PROMETHEUS_AUTH_TYPE
value: "public" value: "public"
@ -149,6 +157,11 @@ spec:
{{- else }} {{- else }}
emptyDir: {} emptyDir: {}
{{- end }} {{- end }}
{{- if .Values.extraSecret }}
- name: extra-secret
secret:
secretName: {{ .Values.extraSecret }}
{{- end }}
- name: minio-user - name: minio-user
secret: secret:
secretName: {{ template "minio.secretName" . }} secretName: {{ template "minio.secretName" . }}

View File

@ -86,6 +86,10 @@ spec:
subPath: "{{ .Values.persistence.subPath }}" subPath: "{{ .Values.persistence.subPath }}"
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.extraSecret }}
- name: extra-secret
mountPath: "/tmp/minio-config-env"
{{- end }}
{{- include "minio.tlsKeysVolumeMount" . | indent 12 }} {{- include "minio.tlsKeysVolumeMount" . | indent 12 }}
ports: ports:
- name: {{ $scheme }} - name: {{ $scheme }}
@ -103,6 +107,10 @@ spec:
secretKeyRef: secretKeyRef:
name: {{ template "minio.secretName" . }} name: {{ template "minio.secretName" . }}
key: rootPassword key: rootPassword
{{- if .Values.extraSecret }}
- name: MINIO_CONFIG_ENV_FILE
value: "/tmp/minio-config-env/config.env"
{{- end}}
{{- if eq .Values.gateway.type "gcs" }} {{- if eq .Values.gateway.type "gcs" }}
- name: GOOGLE_APPLICATION_CREDENTIALS - name: GOOGLE_APPLICATION_CREDENTIALS
value: "/tmp/credentials/service-account-file.json" value: "/tmp/credentials/service-account-file.json"
@ -161,5 +169,10 @@ spec:
- name: minio-user - name: minio-user
secret: secret:
secretName: {{ template "minio.secretName" . }} secretName: {{ template "minio.secretName" . }}
{{- if .Values.extraSecret }}
- name: extra-secret
secret:
secretName: {{ .Values.extraSecret }}
{{- end }}
{{- include "minio.tlsKeysVolume" . | indent 8 }} {{- include "minio.tlsKeysVolume" . | indent 8 }}
{{- end }} {{- end }}

View File

@ -114,6 +114,10 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.extraSecret }}
- name: extra-secret
mountPath: "/tmp/minio-config-env"
{{- end }}
{{- include "minio.tlsKeysVolumeMount" . | indent 12 }} {{- include "minio.tlsKeysVolumeMount" . | indent 12 }}
ports: ports:
- name: {{ $scheme }} - name: {{ $scheme }}
@ -131,6 +135,10 @@ spec:
secretKeyRef: secretKeyRef:
name: {{ template "minio.secretName" . }} name: {{ template "minio.secretName" . }}
key: rootPassword key: rootPassword
{{- if .Values.extraSecret }}
- name: MINIO_CONFIG_ENV_FILE
value: "/tmp/minio-config-env/config.env"
{{- end}}
{{- if .Values.metrics.serviceMonitor.public }} {{- if .Values.metrics.serviceMonitor.public }}
- name: MINIO_PROMETHEUS_AUTH_TYPE - name: MINIO_PROMETHEUS_AUTH_TYPE
value: "public" value: "public"
@ -158,6 +166,11 @@ spec:
- name: minio-user - name: minio-user
secret: secret:
secretName: {{ template "minio.secretName" . }} secretName: {{ template "minio.secretName" . }}
{{- if .Values.extraSecret }}
- name: extra-secret
secret:
secretName: {{ .Values.extraSecret }}
{{- end }}
{{- include "minio.tlsKeysVolume" . | indent 8 }} {{- include "minio.tlsKeysVolume" . | indent 8 }}
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
volumeClaimTemplates: volumeClaimTemplates:

View File

@ -315,6 +315,12 @@ environment:
## MINIO_SUBNET_LICENSE: "License key obtained from https://subnet.min.io" ## MINIO_SUBNET_LICENSE: "License key obtained from https://subnet.min.io"
## MINIO_BROWSER: "off" ## MINIO_BROWSER: "off"
## The name of a secret in the same kubernetes namespace which contain secret values
## This can be useful for LDAP password, etc
## The key in the secret must be 'config.env'
##
# extraSecret: minio-extraenv
networkPolicy: networkPolicy:
enabled: false enabled: false
allowExternal: true allowExternal: true