Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image pull secret generation using provided credentials #554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading