1
- {{- if .Values.garbageCollect.enabled }}
2
- apiVersion : batch/v1
3
- kind : CronJob
1
+ apiVersion : apps/v1
2
+ kind : Deployment
4
3
metadata :
5
- name : {{ template "docker-registry.fullname" . }}-garbage-collector
4
+ name : {{ template "docker-registry.fullname" . }}
6
5
namespace : {{ .Values.namespace | default .Release.Namespace }}
7
6
labels :
8
7
app : {{ template "docker-registry.name" . }}
9
8
chart : {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10
9
release : {{ .Release.Name }}
11
10
heritage : {{ .Release.Service }}
11
+ {{- if .Values.deployment.annotations }}
12
+ annotations :
13
+ {{ toYaml .Values.deployment.annotations | indent 4 }}
14
+ {{- end }}
12
15
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 :
15
26
metadata :
16
27
labels :
17
28
app : {{ template "docker-registry.name" . }}
@@ -26,44 +37,64 @@ spec:
26
37
{{ toYaml .Values.podAnnotations | nindent 8 }}
27
38
{{- end }}
28
39
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
56
75
{{- 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 }}
67
89
{{- 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