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

feat: allow conditional secret creation #90

Open
wants to merge 4 commits 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
14 changes: 14 additions & 0 deletions templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ spec:
{{- end }}
spec:
template:
metadata:
labels:
app: {{ template "docker-registry.name" . }}
release: {{ .Release.Name }}
{{- with .Values.podLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
serviceAccountName: {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
Expand All @@ -53,6 +66,7 @@ spec:
- /etc/docker/registry/config.yml
env: {{ include "docker-registry.envs" . | nindent 16 }}
volumeMounts: {{ include "docker-registry.volumeMounts" . | nindent 16 }}
resources: {{ toYaml .Values.resources | nindent 16 }}
restartPolicy: OnFailure
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 12 }}
Expand Down
2 changes: 2 additions & 0 deletions templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.secrets.create }}
apiVersion: v1
kind: Secret
metadata:
Expand Down Expand Up @@ -38,3 +39,4 @@ data:
{{- end }}
proxyUsername: {{ .Values.proxy.username | default "" | b64enc | quote }}
proxyPassword: {{ .Values.proxy.password | default "" | b64enc | quote }}
{{ end }}
3 changes: 2 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serviceAccount:

image:
repository: registry
tag: 2.8.1
tag: 2.8.3
pullPolicy: IfNotPresent
# imagePullSecrets:
# - name: docker
Expand Down Expand Up @@ -74,6 +74,7 @@ storage: filesystem
# Set this to name of secret for tls certs
# tlsSecretName: registry.docker.example.com
secrets:
create: true
haSharedSecret: ""
htpasswd: ""
# Secrets for Azure
Expand Down