Skip to content

Commit

Permalink
image pull secret generation using provided credentials
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Malka <[email protected]>
  • Loading branch information
amirmalka committed Dec 1, 2024
1 parent d54bc46 commit 522ce95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions charts/kubescape-operator/templates/configs/image-pull-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.imagePullSecrets .Values.imagePullSecret.server }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.imagePullSecrets }}
namespace: {{ .Values.ksNamespace }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}"
.Values.imagePullSecret.server
.Values.imagePullSecret.username
.Values.imagePullSecret.password
.Values.imagePullSecret.email
(printf "%s:%s" .Values.imagePullSecret.username .Values.imagePullSecret.password | b64enc) | b64enc }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/kubescape-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ customScheduling:
# -- set the image pull secrets for private registry support
imagePullSecrets: ""

# -- (optional) generate image pull secret with the provided credentials. Secret name must be provided in the imagePullSecrets field
imagePullSecret:
server: ""
username: ""
password: ""
email: ""

# -----------------------------------------------------------------------------------------
# ----------------------------- Providers -------------------------------------------------
# -----------------------------------------------------------------------------------------
Expand Down

0 comments on commit 522ce95

Please sign in to comment.