-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
hostPort is not working after upgrade from calico v3.15.5 to any latest(v3.16.0 above) #4617
Comments
@asudhakarreddy How did you install Calico v3.16.10. AFAIK, |
@song-jiang we do kubectl apply -f https://docs.projectcalico.org/archive/v3.16/manifests/calico.yaml |
Do you happen to get any log from kubelet on portmap plugin? I suspect we may have an issue here since we are not actively testing portmap plugin. |
@song-jiang with this commit it seems broken projectcalico/felix#2424 |
Hey, |
@caseydavenport Is this still an active problem? I am experiencing a problem with Datadog APM not working because the hostPort isn't being mapped in correctly. We are running a cluster that is using version 3.18.1 of calico... This is in our configmap so it should be working... |
This sounds different, and is clearly called out in the docs requirements for Calico:
https://projectcalico.docs.tigera.io/getting-started/kubernetes/requirements |
@caseydavenport No firewalld enabled in my environment that I'm aware of. 3.18.1 is definitely still having this problem for us. |
We run e2e tests that verify host ports function properly regularly, so I can confirm that in some capacity hostPorts should be functioning. There may be something specific about your environment that's causing this. host ports are implemented in iptables by the |
@jurschel We use calico and portmap in parallel for hostPorts for quite a while through many calico versions and hadn't had any problem with that. I cannot guarantee that for 3.18.1 specifically but I could go through our history. We recently switched from 3.20 to 3.21 and have no issues with that. |
I asked our managed provider to discuss upgrading calico to the current version. We use platform9 as our provider. Worked for quite a number of days with Datadog engineering to come to the conclusion that likely the version of calico we are on or some other setting is causing it to not map hostPort correctly. When we look it does a mapping to a dynamic port and the host never actually listens on the hostPort that is required... Any guidance on troubleshooting the issue from calico's perspective to gain some insight into it? Like look for logs somewhere etc? |
Not sure if this is relevant, but we have first calico, then portmap in the cni config, and we set externalSetMarkChain explicitly:
|
The most simple thing, like I mentioned above, is to confirm whether or not the iptables rules are being programmed by the portmap plugin and if so, are they being hit?
^ This should tell you whether the rules exist, and give packet/byte counts to see if the rules are being hit. Note that if something else on your host is bound to the |
Thanks @caseydavenport if I had another choice for a kubernetes deployment of Datadog agent I would use that. Their APM uses hostPort to bind to 8126 and so that's what I got. I've worked around it for the time being with a service but that messes up the metric correlation as it might be from any machine since it's now using a service instead of hostPort. sudo iptables-save -c |grep 8126 root@platform908:~# netstat -l |
Doesn't look like any packets are hitting that rule. So, either there was no traffic to the pod around the time that you ran this command, or there is another rule earlier in the chain that is accepting / denying the traffic before it reaches here. I'd recommend trying to ensure there is traffic flowing to the service on the hostport, and then monitor to see if it is being handled by another rule. From the netstat output, doesn't look like anyone else is listening on that port so that's good. |
Expected Behavior
In k8s deployment container hostPort should expose to the host level
Current Behavior
with calico version v3.16.0 and above hostPort functionality broken
Possible Solution
Steps to Reproduce (for bugs)
Context
Due to this issue applications will not support SNMP traps, Syslog, telemetry functionalities
Your Environment
The text was updated successfully, but these errors were encountered: