Merge pull request #16 from gimlet-io/svcport-mapping
Ability to have different container and svcPort
This commit is contained in:
@@ -8,7 +8,7 @@ metadata:
|
||||
spec:
|
||||
type: {{ if .Values.nodePortEnabled }}NodePort{{ else }}ClusterIP{{ end }}
|
||||
ports:
|
||||
- port: {{ .Values.containerPort }}
|
||||
- port: {{ if .Values.svcPort }}{{ .Values.svcPort }}{{ else }}{{ .Values.containerPort }}{{ end }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
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