Chris Stryczynski
Chris Stryczynski

Reputation: 34011

How do I implement session affinity with a Ingress controller using GCE load balancer

I have the following ingress config:

ingressProd.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: wordpress
  annotations:
    kubernetes.io/ingress.class: "gce"
spec:
  tls:
  - hosts:
    - ***.net
    secretName: production-tls
  rules:
    - host: ***.net
      http:
        paths:
        - path: /*
          backend:
            serviceName: wordpress
            servicePort: 80

I'm having difficulty finding resources on how to enable session affinity for the above. Having previously used a LoadBalancer service which worked as intended previously.

What do I need to investigate?

Upvotes: 0

Views: 911

Answers (1)

Jayson Chacko
Jayson Chacko

Reputation: 2418

The current GCE ingress controller doesn't support session affinity. This is because it is not capable of load balancing the pods directly (It uses the nodeport service).

If you really need session affinity, the current solution is to deploy an ngnix-controller in GKE. This link contains the deployment steps.

Upvotes: 2

Related Questions