File tree Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ appVersion: v2.1.5
3
3
description : A Helm chart for Kubernetes
4
4
name : zot
5
5
type : application
6
- version : 0.1.74
6
+ version : 0.1.75
Original file line number Diff line number Diff line change
1
+ {{- if and .Values.serviceHeadless .Values.serviceHeadless.enabled .Values.persistence -}}
2
+ apiVersion : v1
3
+ kind : Service
4
+ metadata :
5
+ name : {{ include "zot.fullname" . }}-headless
6
+ namespace : {{ .Values.namespace | default .Release.Namespace }}
7
+ labels :
8
+ {{- include "zot.labels" . | nindent 4 }}
9
+ {{- with .Values.serviceHeadless.annotations }}
10
+ annotations :
11
+ {{ toYaml . | indent 4 }}
12
+ {{- end }}
13
+ spec :
14
+ type : ClusterIP
15
+ clusterIP : None
16
+ ports :
17
+ - port : {{ .Values.serviceHeadless.port }}
18
+ targetPort : zot
19
+ protocol : TCP
20
+ name : zot
21
+ selector :
22
+ {{- include "zot.selectorLabels" . | nindent 4 }}
23
+ {{- end -}}
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ metadata:
11
11
{{- toYaml . | nindent 4 }}
12
12
{{- end }}
13
13
spec :
14
+ {{- if and .Values.serviceHeadless .Values.serviceHeadless.enabled }}
15
+ serviceName : {{ include "zot.fullname" . }}-headless
16
+ {{- end }}
14
17
replicas : {{ .Values.replicaCount }}
15
18
selector :
16
19
matchLabels :
Original file line number Diff line number Diff line change @@ -94,3 +94,13 @@ tests:
94
94
- equal :
95
95
path : spec.volumeClaimTemplates[0].metadata.name
96
96
value : custom-pvc-pvc
97
+
98
+ - it : should have an headless service when enabled
99
+ set :
100
+ persistence : true
101
+ serviceHeadless :
102
+ enabled : true
103
+ asserts :
104
+ - matchRegex :
105
+ path : spec.serviceName
106
+ pattern : .*-headless$
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ serviceAccount:
17
17
# The name of the service account to use.
18
18
# If not set and create is true, a name is generated using the fullname template
19
19
name : " "
20
+ serviceHeadless :
21
+ # Enable headless service, only for statefulset
22
+ enabled : false
23
+ # Headless service port
24
+ port : 5000
25
+ # Annotations to add to the headless service
26
+ annotations : {}
20
27
service :
21
28
type : NodePort
22
29
port : 5000
You can’t perform that action at this time.
0 commit comments