Skip to content

Commit 113ddd1

Browse files
authored
Merge pull request twuni#164 from Mercbot7/update-garbagecollect-cronjob
Update garbageCollect cronjob
2 parents 64d7c68 + 9bba24a commit 113ddd1

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

templates/cronjob.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,26 @@ spec:
1717
app: {{ template "docker-registry.name" . }}
1818
release: {{ .Release.Name }}
1919
{{- with .Values.podLabels }}
20-
{{ toYaml . | nindent 8 }}
20+
{{- toYaml . | nindent 8 }}
2121
{{- end }}
2222
annotations:
2323
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
2424
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
2525
{{- if .Values.podAnnotations }}
26-
{{ toYaml .Values.podAnnotations | nindent 8 }}
26+
{{- toYaml .Values.podAnnotations | nindent 8 }}
2727
{{- end }}
2828
spec:
2929
template:
30+
metadata:
31+
labels:
32+
release: {{ .Release.Name }}
33+
{{- if or .Values.podLabels .Values.garbageCollect.podLabels }}
34+
{{- toYaml (merge (.Values.garbageCollect.podLabels | default (dict)) (.Values.podLabels | default (dict))) | nindent 12 }}
35+
{{- end }}
36+
{{- if or .Values.podAnnotations .Values.garbageCollect.podAnnotations }}
37+
annotations:
38+
{{- toYaml (merge (.Values.garbageCollect.podAnnotations | default (dict)) (.Values.podAnnotations | default (dict))) | nindent 12 }}
39+
{{- end}}
3040
spec:
3141
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
3242
serviceAccountName: {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
@@ -49,7 +59,10 @@ spec:
4959
- garbage-collect
5060
- --delete-untagged={{ .Values.garbageCollect.deleteUntagged }}
5161
- /etc/docker/registry/config.yml
52-
resources: {{ toYaml .Values.garbageCollect.resources | nindent 12 }}
62+
{{- if .Values.garbageCollect.resources }}
63+
resources:
64+
{{- toYaml .Values.garbageCollect.resources | nindent 16 }}
65+
{{- end }}
5366
env: {{ include "docker-registry.envs" . | nindent 16 }}
5467
{{- if .Values.containerSecurityContext.enabled }}
5568
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 16 }}

values.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ resources: {}
6161
# resources, such as Minikube. If you do want to specify resources, uncomment the following
6262
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
6363
# limits:
64-
# cpu: 100m
65-
# memory: 128Mi
64+
# cpu: 100m
65+
# memory: 128Mi
6666
# requests:
67-
# cpu: 100m
68-
# memory: 128Mi
67+
# cpu: 100m
68+
# memory: 128Mi
6969
persistence:
7070
accessMode: 'ReadWriteOnce'
7171
enabled: false
@@ -98,17 +98,17 @@ secrets:
9898

9999
# Options for s3 storage type:
100100
# s3:
101-
# region: us-east-1
102-
# regionEndpoint: https://s3.us-east-1.amazonaws.com
103-
# bucket: my-bucket
104-
# rootdirectory: /object/prefix
105-
# encrypt: false
106-
# secure: true
101+
# region: us-east-1
102+
# regionEndpoint: https://s3.us-east-1.amazonaws.com
103+
# bucket: my-bucket
104+
# rootdirectory: /object/prefix
105+
# encrypt: false
106+
# secure: true
107107

108108
# Options for swift storage type:
109109
# swift:
110-
# authurl: http://swift.example.com/
111-
# container: my-container
110+
# authurl: http://swift.example.com/
111+
# container: my-container
112112

113113
# https://docs.docker.com/registry/recipes/mirror/
114114
proxy:
@@ -245,4 +245,16 @@ garbageCollect:
245245
enabled: false
246246
deleteUntagged: true
247247
schedule: "0 1 * * *"
248+
podAnnotations: {}
249+
podLabels: {}
248250
resources: {}
251+
# We usually recommend not to specify default resources and to leave this as a conscious
252+
# choice for the user. This also increases chances charts run on environments with little
253+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
254+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
255+
# limits:
256+
# cpu: 100m
257+
# memory: 128Mi
258+
# requests:
259+
# cpu: 100m
260+
# memory: 128Mi

0 commit comments

Comments
 (0)