Skip to content

Commit 4efb76f

Browse files
authored
Update cronjob.yaml
1 parent 2a9672e commit 4efb76f

File tree

1 file changed

+76
-45
lines changed

1 file changed

+76
-45
lines changed

templates/cronjob.yaml

Lines changed: 76 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
1-
{{- if .Values.garbageCollect.enabled }}
2-
apiVersion: batch/v1
3-
kind: CronJob
1+
apiVersion: apps/v1
2+
kind: Deployment
43
metadata:
5-
name: {{ template "docker-registry.fullname" . }}-garbage-collector
4+
name: {{ template "docker-registry.fullname" . }}
65
namespace: {{ .Values.namespace | default .Release.Namespace }}
76
labels:
87
app: {{ template "docker-registry.name" . }}
98
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
109
release: {{ .Release.Name }}
1110
heritage: {{ .Release.Service }}
11+
{{- if .Values.deployment.annotations }}
12+
annotations:
13+
{{ toYaml .Values.deployment.annotations | indent 4 }}
14+
{{- end }}
1215
spec:
13-
schedule: {{ .Values.garbageCollect.schedule | quote }}
14-
jobTemplate:
16+
selector:
17+
matchLabels:
18+
app: {{ template "docker-registry.name" . }}
19+
release: {{ .Release.Name }}
20+
replicas: {{ .Values.replicaCount }}
21+
{{- if .Values.updateStrategy }}
22+
strategy: {{ toYaml .Values.updateStrategy | nindent 4 }}
23+
{{- end }}
24+
minReadySeconds: 5
25+
template:
1526
metadata:
1627
labels:
1728
app: {{ template "docker-registry.name" . }}
@@ -26,44 +37,64 @@ spec:
2637
{{ toYaml .Values.podAnnotations | nindent 8 }}
2738
{{- end }}
2839
spec:
29-
template:
30-
spec:
31-
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
32-
serviceAccountName: {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
33-
{{- end }}
34-
{{- if .Values.imagePullSecrets }}
35-
imagePullSecrets: {{ toYaml .Values.imagePullSecrets | nindent 12 }}
36-
{{- end }}
37-
{{- if .Values.priorityClassName }}
38-
priorityClassName: "{{ .Values.priorityClassName }}"
39-
{{- end }}
40-
{{- if .Values.securityContext.enabled }}
41-
securityContext: {{ omit .Values.securityContext "enabled" | toYaml | nindent 12 }}
42-
{{- end }}
43-
containers:
44-
- name: {{ .Chart.Name }}
45-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
46-
imagePullPolicy: {{ .Values.image.pullPolicy }}
47-
command:
48-
- /bin/registry
49-
- garbage-collect
50-
- --delete-untagged={{ .Values.garbageCollect.deleteUntagged }}
51-
- /etc/docker/registry/config.yml
52-
resources: {{ toYaml .Values.garbageCollect.resources | nindent 12 }}
53-
env: {{ include "docker-registry.envs" . | nindent 16 }}
54-
{{- if .Values.containerSecurityContext.enabled }}
55-
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 16 }}
40+
{{- if or (eq .Values.serviceAccount.create true) (ne .Values.serviceAccount.name "") }}
41+
serviceAccountName: {{ .Values.serviceAccount.name | default (include "docker-registry.fullname" .) }}
42+
{{- end }}
43+
{{- if .Values.imagePullSecrets }}
44+
imagePullSecrets: {{ toYaml .Values.imagePullSecrets | nindent 8 }}
45+
{{- end }}
46+
{{- if .Values.priorityClassName }}
47+
priorityClassName: "{{ .Values.priorityClassName }}"
48+
{{- end }}
49+
{{- if .Values.securityContext.enabled }}
50+
securityContext: {{ omit .Values.securityContext "enabled" | toYaml | nindent 8 }}
51+
{{- end }}
52+
{{- with .Values.initContainers }}
53+
initContainers:
54+
{{- toYaml . | nindent 8 }}
55+
{{- end }}
56+
containers:
57+
- name: {{ .Chart.Name }}
58+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
59+
imagePullPolicy: {{ .Values.image.pullPolicy }}
60+
command:
61+
- /bin/registry
62+
- serve
63+
- /etc/docker/registry/config.yml
64+
ports:
65+
- containerPort: 5000
66+
{{- if .Values.metrics.enabled }}
67+
- containerPort: {{ (split ":" .Values.configData.http.debug.addr)._1 }}
68+
name: http-metrics
69+
protocol: TCP
70+
{{- end }}
71+
livenessProbe:
72+
httpGet:
73+
{{- if .Values.tlsSecretName }}
74+
scheme: HTTPS
5675
{{- end }}
57-
volumeMounts: {{ include "docker-registry.volumeMounts" . | nindent 16 }}
58-
restartPolicy: OnFailure
59-
{{- if .Values.nodeSelector }}
60-
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 12 }}
61-
{{- end }}
62-
{{- if .Values.affinity }}
63-
affinity: {{ toYaml .Values.affinity | nindent 12 }}
64-
{{- end }}
65-
{{- if .Values.tolerations }}
66-
tolerations: {{ toYaml .Values.tolerations | nindent 12 }}
76+
path: /
77+
port: 5000
78+
readinessProbe:
79+
httpGet:
80+
{{- if .Values.tlsSecretName }}
81+
scheme: HTTPS
82+
{{- end }}
83+
path: /
84+
port: 5000
85+
resources: {{ toYaml .Values.resources | nindent 12 }}
86+
env: {{ include "docker-registry.envs" . | nindent 12 }}
87+
{{- if .Values.containerSecurityContext.enabled }}
88+
securityContext: {{ omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
6789
{{- end }}
68-
volumes: {{ include "docker-registry.volumes" . | nindent 12 }}
69-
{{- end }}
90+
volumeMounts: {{ include "docker-registry.volumeMounts" . | nindent 12 }}
91+
{{- if .Values.nodeSelector }}
92+
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
93+
{{- end }}
94+
{{- if .Values.affinity }}
95+
affinity: {{ toYaml .Values.affinity | nindent 8 }}
96+
{{- end }}
97+
{{- if .Values.tolerations }}
98+
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
99+
{{- end }}
100+
volumes: {{ include "docker-registry.volumes" . | nindent 8 }}

0 commit comments

Comments
 (0)