Closed collinarnett closed 2 years ago
I suspect this might be firewall related.
Can you see if:
networking.firewall.trustedInterfaces = [ "cni0" "flannel.1" ];
networking.firewall.extraCommands = ''
iptables -A nixos-fw -p tcp --source 192.168.1.0/24 -m udp --dport 8472 -j nixos-fw-accept
'';
makes a difference, or if that doesn't, whether temporarily disabling the firewall does (assuming you can safely do that experiment)?
The above flannel vxlan port is taken from https://rancher.com/docs/k3s/latest/en/installation/installation-requirements/#networking
The k3s module doesn't do any firewall setup, even though it really should by default... but before going off into any weeds there, let's verify that is the issue, and that it's not something else.
(thanks for trying the module and reporting this issue btw!)
Thank you so much for getting back to me so quickly.
I tried both of the suggestions you made and neither of them worked. Running without a firewall and running the busybox test with your configuration resulted in the same output, although I'm not sure If I should be running any additional commands other than nixos-rebuild switch
in between changes.
I had a look at: https://github.com/TUM-DSE/doctor-cluster-config/blob/master/modules/k3s/k3s-reset-node but I'm not sure if it's necessary to run that after any configuration change.
Works for me using RPi4.
boot.kernelModules = [ "overlay" "br_netfilter" ]; # Needed for K3s?
boot.kernel.sysctl = {
"net.bridge-nf-call-ip6tables" = 1;
"net.bridge-nf-call-iptables" = 1;
"net.ipv4.ip_forward" = 1;
};
Have you added this?
My k3s config (lots of junk): https://termbin.com/2kea
I figured it out after many ablations that what I was missing was opening these ports on both machines.
networking.firewall.allowedTCPPorts = [ 6443 ];
networking.firewall.allowedUDPPorts = [ 8472 ];
I didn't need any other additions to my configs.
suggested one liner works as @collinarnett mentioned
This is also found in k3s networking docs https://docs.k3s.io/installation/requirements#networking
Describe the bug
Pods created on a raspberry pi 4 (registered as an agent node) do not resolve urls.
Steps To Reproduce
Steps to reproduce the behavior:
kubectl run -it --rm --restart=Never busybox --image=busybox:1.28 --overrides='{"spec": { "nodeSelector": {"kubernetes.io/hostname": "eye"}}}' -- nslookup google.com
<-- In this case eye is the name of the raspberry piExpected behavior
DNS should work within pods.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Notify maintainers
@euank @Mic92 @superherointj @kalbasit
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.