HAProxy not forwarding requests to kubernetes nginx ingress

144 views
Skip to first unread message

MK

unread,
Jan 20, 2023, 2:32:17 AM1/20/23
to haproxy-ingress
I'm using HA-Proxy (Independent server) and Kubernetes v1.24.9 cluster (One master and three workers) bare metal based.

HAProxy Environment:

OS: Ubuntu 20.04.5 LTS
HAProxy version: 2.4.20-1ppa1~focal 2022/12/09


My access workflow:-

Users --> HAproxy(Front End --> Back End) --> Kubernetes Cluster(Nginx Ingress --> Service --> Jenkins POD)

I have deployed Jenkins application as a pod inside my cluster. When i access my Jenkins URL - "http://jenkins.company.com/jenkins" on browser i should see my Jenkins login page. But it always fails with "404 Not Found" error.

Master, Workers and HAProxy(LB) are running separately on VMs. In Master, Worker, LB and in my laptop i have added "jenkins.company.com" entry along with LB IP address in host file. 

Have found that our HAProxy is not forwarding request to our cluster nginx-ingress controller pod.

Based on the "nginx-ingress" logs it doesn't look like the Ingress Controller has not even processed the request. There should be a log line similar to this one:

160.5.5.7 - - [19/Jan/2023:09:35:18 +0000] "GET /favicon.ico HTTP/1.1" 404 153 "http://jenkins.company.com/jenkins" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0" "-"

But in my case i can't see any logs.

My HAproxy "/etc/haproxy/haproxy.cfg" configurations as follows,

frontend user_local
    bind *:80
    mode http
    default_backend ks_backend

backend ks_backend
    mode http
    balance roundrobin
    server kserver1 160.20.21.12:80


$ sudo netstat -pnltu | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7529/haproxy



$ sudo tail -n 10 /var/log/haproxy.log

Jan 19 16:21:41 LB haproxy[238044]: [NOTICE]   (238044) : path to executable is /usr/sbin/haproxy
Jan 19 16:21:41 LB haproxy[238044]: [ALERT]    (238044) : Current worker #1 (238046) exited with code 143 (Terminated)
Jan 19 16:21:41 LB haproxy[238044]: [WARNING]  (238044) : All workers exited. Exiting... (0)
Jan 19 17:07:14 LB haproxy[6863]: [WARNING]  (6863) : Exiting Master process...
Jan 19 17:07:14 LB haproxy[6863]: [NOTICE]   (6863) : haproxy version is 2.4.20-1ppa1~focal
Jan 19 17:07:14 LB haproxy[6863]: [NOTICE]   (6863) : path to executable is /usr/sbin/haproxy
Jan 19 17:07:14 LB haproxy[6863]: [ALERT]    (6863) : Current worker #1 (6879) exited with code 143 (Terminated)
Jan 19 17:07:14 LB haproxy[6863]: [WARNING]  (6863) : All workers exited. Exiting... (0)
Jan 19 17:07:14 LB haproxy[7527]: [NOTICE]   (7527) : New worker #1 (7529) forked

In the log shown "exited with code 143 (Terminated)" does it causing issue?

Any guidance to solve this issue would be helpful.

Thank you!

Mohan

unread,
Jan 20, 2023, 8:52:25 AM1/20/23
to haproxy...@googlegroups.com
Indeed it was some issue with my HAProxy VM system side, So I had swichted to new VM the server, now it is working fine as expected.

Sorry for the inconvenience caused. Thanks.



--
You received this message because you are subscribed to a topic in the Google Groups "haproxy-ingress" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haproxy-ingress/RIPI78joBkg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haproxy-ingre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haproxy-ingress/a9bff3ce-bf81-4bb9-86eb-44f63dad7433n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages