Merge pull request #19 from gimlet-io/lb-and-sticky-sessions

LoadBalancer svc type and sticky sessions
This commit is contained in:
Laszlo Fogas
2021-04-28 10:30:22 +02:00
committed by GitHub
3 changed files with 25 additions and 1 deletions
+7 -1
View File
@@ -6,7 +6,13 @@ metadata:
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
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:
{{- if not .Values.ports }}
- 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:
path: spec.type
value: NodePort
- it: Should set LoadBalancer if flag enabled
set:
loadbalancerEnabled: true
asserts:
- equal:
path: spec.type
value: LoadBalancer