Ability to have different container and svcPort
This commit is contained in:
@@ -8,7 +8,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: {{ if .Values.nodePortEnabled }}NodePort{{ else }}ClusterIP{{ end }}
|
type: {{ if .Values.nodePortEnabled }}NodePort{{ else }}ClusterIP{{ end }}
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.containerPort }}
|
- port: {{ if .Values.svcPort }}{{ .Values.svcPort }}{{ else }}{{ .Values.containerPort }}{{ end }}
|
||||||
targetPort: http
|
targetPort: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: http
|
name: http
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
suite: test deployment
|
||||||
|
templates:
|
||||||
|
- service.yaml
|
||||||
|
tests:
|
||||||
|
- it: Should set containerPort as default
|
||||||
|
set:
|
||||||
|
containerPort: 11111
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.ports[0].port
|
||||||
|
value: 11111
|
||||||
|
- it: Should set svcPort if it is defined
|
||||||
|
set:
|
||||||
|
containerPort: 11111
|
||||||
|
svcPort: 22222
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.ports[0].port
|
||||||
|
value: 22222
|
||||||
Reference in New Issue
Block a user