Merge pull request #19 from gimlet-io/lb-and-sticky-sessions
LoadBalancer svc type and sticky sessions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user