mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-16 09:58:21 +00:00
render imagePullSecrets in Deployment/StatefulSet (#1130)
Signed-off-by: czaloumis <80974398+czaloumis@users.noreply.github.com>
This commit is contained in:
@@ -80,3 +80,22 @@ Return image pull secret content
|
||||
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the default imagePullSecret name
|
||||
*/}}
|
||||
{{- define "rustfs.imagePullSecret.name" -}}
|
||||
{{- printf "%s-registry-secret" (include "rustfs.fullname" .) }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Render imagePullSecrets for workloads - appends registry secret
|
||||
*/}}
|
||||
{{- define "chart.imagePullSecrets" -}}
|
||||
{{- $secrets := .Values.imagePullSecrets | default list }}
|
||||
{{- if .Values.imageRegistryCredentials.enabled }}
|
||||
{{- $secrets = append $secrets (dict "name" (include "rustfs.imagePullSecret.name" .)) }}
|
||||
{{- end }}
|
||||
{{- toYaml $secrets }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ spec:
|
||||
labels:
|
||||
app: {{ include "rustfs.name" . }}
|
||||
spec:
|
||||
{{- if .Values.imageRegistryCredentials.enabled }}
|
||||
{{- with include "chart.imagePullSecrets" . }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.imagePullSecrets }}
|
||||
{{- . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
|
||||
@@ -14,7 +14,7 @@ data:
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.imagePullSecrets }}
|
||||
name: {{ include "rustfs.imagePullSecret.name" . }}
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
|
||||
@@ -15,9 +15,9 @@ spec:
|
||||
labels:
|
||||
app: {{ include "rustfs.name" . }}
|
||||
spec:
|
||||
{{- if .Values.imageRegistryCredentials.enabled }}
|
||||
{{- with include "chart.imagePullSecrets" . }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.imagePullSecrets }}
|
||||
{{- . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
|
||||
@@ -14,7 +14,7 @@ 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: rustfs-regcred
|
||||
imagePullSecrets: []
|
||||
|
||||
imageRegistryCredentials:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user