0
votes

I'm write helm chart for deploy web service to eks. I need to deploy Load balancer for pods running web application. I'm create service that deploy Network Load Balancer

apiVersion: v1
kind: Service
metadata:
  name: my-service
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
spec:
  selector:
    app: "MyApp"
  type: LoadBalancer
  ports:
  - name: http
    port: {{ .Values.app.port }}
    protocol: TCP
    targetPort: {{ .Values.app.port }}

I'm need sticky session for this application.

I'd tried to add sessionAffinity: ClientIP to chart, but this failed. LoadBalancer wont to be created.

Other way LoadBalancer created, but sticky session in Target group still disabled.

What are correct way to configure sticky session for NLB via helm chart?

1
Failed meaning you are not able to create service or you cannot obtain externalIP? How it look when you used sessionAffinity: ClientIP ? What error you received?PjoterS
Service created and loadbalancer not... No loadbalancer url in service manifest and no loadbalancer in console... ExternalIP not in scope.ozlevka

1 Answers

0
votes

This is impossible due to AWS feature sequence.

This feature belongs to TargetGroup of NLB.

When you create LoadBalancer you can't edit attributes of Target group.

After creation attributes of TargetGroup can be modified.

Kubernetes does not implement any annotation to change this flag.

Conclusion: After creating LoadBalancer run awscli script for change sticky session flag.