mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-17 10:17:55 +00:00
add image pull secret support (#1127)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -71,3 +71,12 @@ Return the secret name
|
||||
{{- printf "%s-secret" (include "rustfs.fullname" .) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return image pull secret content
|
||||
*/}}
|
||||
{{- define "imagePullSecret" }}
|
||||
{{- with .Values.imageRegistryCredentials }}
|
||||
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -15,6 +15,10 @@ spec:
|
||||
labels:
|
||||
app: {{ include "rustfs.name" . }}
|
||||
spec:
|
||||
{{- if .Values.imageRegistryCredentials.enabled }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.imagePullSecrets }}
|
||||
{{- end }}
|
||||
{{- if .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 12 }}
|
||||
|
||||
@@ -8,3 +8,14 @@ data:
|
||||
RUSTFS_ACCESS_KEY: {{ .Values.secret.rustfs.access_key | b64enc | quote }}
|
||||
RUSTFS_SECRET_KEY: {{ .Values.secret.rustfs.secret_key | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
{{- if .Values.imageRegistryCredentials.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.imagePullSecrets }}
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
{{- end }}
|
||||
|
||||
@@ -15,6 +15,10 @@ spec:
|
||||
labels:
|
||||
app: {{ include "rustfs.name" . }}
|
||||
spec:
|
||||
{{- if .Values.imageRegistryCredentials.enabled }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.imagePullSecrets }}
|
||||
{{- end }}
|
||||
{{- if .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 12 }}
|
||||
|
||||
+10
-1
@@ -14,7 +14,16 @@ image:
|
||||
tag: "latest"
|
||||
|
||||
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||
imagePullSecrets: []
|
||||
imagePullSecrets: rustfs-regcred
|
||||
|
||||
imageRegistryCredentials:
|
||||
enabled: false
|
||||
registry: ""
|
||||
username: ""
|
||||
password: ""
|
||||
email: ""
|
||||
|
||||
|
||||
# This is to override the chart name.
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
Reference in New Issue
Block a user