Skip to content

Commit

Permalink
Added registry values to pull the CronJob Image
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmontufar committed May 14, 2024
1 parent 5386d9a commit e11864b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Chart/twistlock-updater-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
description: Twistlock Defender Updater CronJob Helm Chart
name: twistlock-updater
version: 1.0.1
version: 1.0.2
8 changes: 6 additions & 2 deletions Chart/twistlock-updater-helm/templates/imagepullsecret.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{{- if .Values.job.pull_secret_dockerconfigjson }}
{{- if or (.Values.job.pull_secret_dockerconfigjson) (and .Values.job.registry.name .Values.job.registry.username .Values.job.registry.password) }}
apiVersion: v1
data:
{{- if .Values.job.pull_secret_dockerconfigjson }}
.dockerconfigjson: {{ .Values.job.pull_secret_dockerconfigjson }}
{{- else }}
.dockerconfigjson: {{printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.job.registry.name (printf "%s:%s" .Values.job.registry.username .Values.job.registry.password | b64enc) | b64enc }}
{{- end }}
kind: Secret
metadata:
name: {{ .Values.job.image_pull_secret }}
namespace: {{ .Release.Namespace }}
type: kubernetes.io/dockerconfigjson
{{- end}}
{{- end }}
8 changes: 6 additions & 2 deletions Chart/twistlock-updater-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ job:
has_volume: true # Verifies if job has Persistant Volume. If set to false, then no Persistant Volume will be created.
schedule: "0 0 * * Sun" # Time Schedule where the CronJob will be executed. Refer to https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
timezone: "Etc/UTC" # Time zone of current CronJob. if not set the Time will be UTC. Refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones to get your current time zone
image_name: # *Name of the image to be used.
image_name: # *Name of the image to be used. Must be full path ej REGISTRY_NAME/IMAGE_NAME:IMAGE_TAG
image_pull_policy: Always # Pull policy of the CronJob image.
image_pull_secret: # Name of the secret needed to pull the CronJob image.
pull_secret_dockerconfigjson: # Credentials for pulling the CronJob image. It is the base 64 encoded of a Docker config file in JSON format. Not needed if the secret has already been created
registry: # Variables used to authenticate with external registry to pull the CronJob image. Not needed if the secret has already been created
name: # Name of the registry
username: # Username used for authentication.
password: # Password used for authentication.
pull_secret_dockerconfigjson: # Credentials for pulling the CronJob image. It is the base 64 encoded of a Docker config file in JSON format. Not needed if the secret has already been created or registry values are set.
role_arn: # AWS role ARN for CronJob
storage: # Storage settings for PersistantVolumeClaim. Refer to https://kubernetes.io/docs/concepts/storage/persistent-volumes/
access_mode: ReadWriteOnce # Storage access mode for CronJob Persistant Volume
Expand Down
Binary file added docs/twistlock-updater-1.0.2.tgz
Binary file not shown.

0 comments on commit e11864b

Please sign in to comment.