LoadBalancer svc type and sticky sessions
This commit is contained in:
@@ -6,7 +6,13 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
{{- include "helm-chart.labels" . | nindent 4 }}
|
{{- include "helm-chart.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ if .Values.nodePortEnabled }}NodePort{{ else }}ClusterIP{{ end }}
|
type: {{ if .Values.nodePortEnabled }}NodePort{{ else if .Values.loadbalancerEnabled }}LoadBalancer{{ else }}ClusterIP{{ end }}
|
||||||
|
{{- if .Values.stickySessions }}
|
||||||
|
sessionAffinityConfig:
|
||||||
|
clientIP:
|
||||||
|
timeoutSeconds: 10800
|
||||||
|
externalTrafficPolicy: Local
|
||||||
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
{{- if not .Values.ports }}
|
{{- if not .Values.ports }}
|
||||||
- port: {{ if .Values.svcPort }}{{ .Values.svcPort }}{{ else }}{{ .Values.containerPort }}{{ end }}
|
- port: {{ if .Values.svcPort }}{{ .Values.svcPort }}{{ else }}{{ .Values.containerPort }}{{ end }}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
suite: test deployment
|
||||||
|
templates:
|
||||||
|
- service.yaml
|
||||||
|
tests:
|
||||||
|
- it: Should set NodePort if flag enabled
|
||||||
|
set:
|
||||||
|
stickySessions: true
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.externalTrafficPolicy
|
||||||
|
value: Local
|
||||||
@@ -14,3 +14,10 @@ tests:
|
|||||||
- equal:
|
- equal:
|
||||||
path: spec.type
|
path: spec.type
|
||||||
value: NodePort
|
value: NodePort
|
||||||
|
- it: Should set LoadBalancer if flag enabled
|
||||||
|
set:
|
||||||
|
loadbalancerEnabled: true
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.type
|
||||||
|
value: LoadBalancer
|
||||||
|
|||||||
Reference in New Issue
Block a user