Haproxy ingress with sticky-session

I have researched about setting up kubernetes ingress controller in ingress resource having sticky session / session peristance , but not able to implement , any one can guide me ??

below is my ingress file

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: rtns-ingress
  namespace: default
  annotations:
    haproxy.org/cookie-persistence: "rtns-cookie"
    haproxy.com/backend-config-snippet: |
      cookie SERVERID insert indirect nocache
      http-send-name-header x-dst-server

spec:
  rules:
    - host: "rtns"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: rtns
                port:
                  number: 5007
haproxy.org/cookie-persistence: "rtns-cookie"

should be all you need. The application server’s cookie should just be passed through.

If you need a backend cookie directive, you can debug it by (temporarily) backing your Service with only one Pod.

A good way to debug Kubernetes network issues to start with kubectl exec into a Pod and wget or curl to the Pod. When that’s verified, wget or curl to the Service. When that’s verified, you can probe the Ingress Controller pods.