-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HaProxy log format doesn't work for TCP frontend #562
Comments
Hi @aimbot31 , I'll look at the code. Keep you updated. |
Hello @ivanmatmati thanks for the answer, did you find something ? |
Hi @aimbot31 , we're going to implement a second log format annotation on tcp configmap so that you can have a specific one for TCP services (because of some incompatibilities with HTTP format). |
@ivanmatmati this is great ! this feature will really help us ! Looking forward to see it |
Hello, @ivanmatmati. Instead of utilizing annotations in the TCP ConfigMap, I've submitted the PR #570 that uses the main ConfigMap, allowing us to centralize the configurations in a single location. |
Hi @fabianonunes , Thanks for being so active, it's very cool. Concerning this PR, I've already done the job. I think it'd be better if you see that something is scheduled that you ask to volunteer so that I can let you go on if ok. In this PR, there's three issues. First, it's better to keep all the TCP configuration in a single dedicated place (think SRP principle). Second, the format for log seems to require escaped spaces or additional quotes which does not align with existing log-format. Third, when a tcp-log-format is removed you must reinsert the tcplog option otherwise it will collide with log-format option (some of them are purely HTTP and so incompatible with TCP). Here I get an error when I remove the annotation. Thanks again, I still need to review your others PRs. |
Hello @ivanmatmati, will test it right away, again thanks for the reactivity, this was a big hole for us ! 💪 |
Hey again @ivanmatmati Seems not working on my server, what i did :
And deployed like that
With the configmap for tcp services looking like that :
What i can see in the configuration when i jump inside the pod :
haproxy ingress controller version :
Do not hesitate if you require more informations |
Hello @ivanmatmati If you have some time to tell me if i got something wrong because i haven't been able to make it work |
Hi, as the documentation says the annotation is available only in TCP configmap not in the general one. Be aware that we kept the word annotation but actually it's data in the configmap. For instance, this would work: apiVersion: v1
data:
"6500": haproxy-controller/redis:6379
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"}'
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress-tcp
namespace: haproxy-controller |
Hello,
I'm trying to configure HaProxy to send logs in a JSON format with a format like this for example :
log-format: "{\"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\"}"
We cannot have that kind of format because of this line
kubernetes-ingress/pkg/handler/tcp-services.go
Line 124 in d404fc5
default even if we define logformat in global/defaults.
Am I missing something ? If this is not possible for the moment, how can we add this improvement to the ingress controller ?
The text was updated successfully, but these errors were encountered: