Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How enable backend Keepalive using TCP from LoadBalancer kubernentes?
Hi, I’m trying to enable keep-alive support from a LoadBalancer for an Ingress Controller in kubernetes:
apiVersion: v1 kind: Service metadata: annotations: service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: "true" # service.beta.kubernetes.io/do-loadbalancer-enable-backend-keepalive: "true" labels: helm.sh/chart: ingress-nginx-2.11.1 app.kubernetes.io/name: ingress-nginx app.kubernetes.io/instance: ingress-nginx app.kubernetes.io/version: 0.34.1 app.kubernetes.io/managed-by: Helm app.kubernetes.io/component: controller name: ingress-nginx-controller namespace: ingress-nginx spec: type: LoadBalancer externalTrafficPolicy: Local ports: - name: http port: 80 protocol: TCP targetPort: http - name: https port: 443 protocol: TCP targetPort: https selector: app.kubernetes.io/name: ingress-nginx app.kubernetes.io/instance: ingress-nginx app.kubernetes.io/component: controller
The issue is that KeepAlive is only available for “HTTP” forwarding rule, ending with this error:
Backend keepalive requires at least one forwarding rule with HTTP or HTTPS target protocol.
BUT ports only support “TCP”, “UDP”, and “SCTP” protocols. Default is TCP.
So, how get this enable?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×