haproxytech / kubernetes-ingress

HAProxy Kubernetes Ingress Controller
https://www.haproxy.com/documentation/kubernetes/
Apache License 2.0
684 stars 195 forks source link

Not able to add `send-proxy` option to a TCP service #598

Open Raj-prateek opened 6 months ago

Raj-prateek commented 6 months ago

Here is my TCP service configmap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: smtp-config
  namespace: ingress-haproxy
  annotations:
    argocd.argoproj.io/sync-wave: "-1"
data:
  587:                    # Port where the frontend is going to listen to.
    my-namespace/my-service:587    # Kubernetes service in the format NS/ServiceName:ServicePort
  465:
    my-namespace/my-service:465:ssl # ssl option will enable ssl offloading for target service.
  2525:
    my-namespace/my-service:2525
  log-format-tcp: '{"client_ip":"%ci","client_port":"%cp","frontend_port":"%fp","date_time":"%t","backend_name":"%b","server_name":"%s","Tt":"%Tt","Tc":"%Tc","Tw":"%Tw","bytes_read":"%B"}'

I tried global config as well, it didn't work.

apiVersion: v1
kind: ConfigMap
metadata:
  name: ingress-haproxy-kubernetes-ingress
  namespace: ingress-haproxy
data:
   syslog-server: 'address:stdout, format: raw, facility:daemon'

Values.yaml

controller:
  image:
    tag: nightly
  allowPrivilegeEscalation: true
  logging:
    level: debug
  extraArgs:
    - --configmap=ingress-haproxy/ingress-haproxy-kubernetes-ingress
    - --configmap-tcp-services=ingress-haproxy/smtp-config
    - --default-ssl-certificate=ingress-haproxy/xyz-com-tls-secret
    - --watch-namespace my-namespace
    - --disable-ipv6
  autoscaling:
    enabled: true
    minReplicas: 5
    maxReplicas: 10
    targetCPUUtilizationPercentage: 80
  service:
    type: LoadBalancer
    loadBalancerIP: 127.0.0.1
    tcpPorts:
      - name: smtp-587
        port: 587
        targetPort: 587
      - name: smtp-465
        port: 465
        targetPort: 465
      - name: smtp-2525
        port: 2525
        targetPort: 2525

Can you please suggest a good way to setup send-proxy option in tcp service?

Raj-prateek commented 5 months ago

Problem

In the current configuration of HAProxy Ingress, it seems that it's not possible to add the "send-proxy" option to the TCP service. The "send-proxy" option is typically used to forward client's information to the server. However, due to some constraints or limitations in the current setup of HAProxy Ingress, this particular feature is not being added successfully to the TCP service.

oktalz commented 5 months ago

hi @Raj-prateek send-proxy is currently not supported for TCP services, I've added enhancement label to include it to the list

Raj-prateek commented 2 months ago

Hi @oktalz Do you have any update about the above request. Is it delivered?

clement0210 commented 2 months ago

Hello @oktalz, Also something that I need in my side. Do you a plan to share on this?

oktalz commented 2 months ago

it not delivered yet, plan is to release it with next controller version (~May, most likely June).

mukul-brevo commented 4 weeks ago

Hi @oktalz I hope you are doing good. Just wanted to check, do you have any news around it? Thanks