Skip to content
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

Using old ubuntu with the newest k3s version, containers can't access the internet #7160

Closed
sides-flow opened this issue Mar 28, 2023 · 2 comments

Comments

@sides-flow
Copy link

Environmental Info:
K3s Version:

k3s version v1.25.7+k3s1 (f7c20e23)
go version go1.19.6

Node(s) CPU architecture, OS, and Version:

vagrant@vagrant:~$ uname -a
Linux vagrant 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
vagrant@vagrant:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

Cluster Configuration:
default k3s installation

Describe the bug:
I use MacOS to run a vagrant box of ubuntu 18.04. I install k3s inside the vagrant box.
When I create a pod in the k3s cluster inside the vagrant box, I can access the host (=vagrant) but not anything else outside the vagrant (not my Mac, and no internet services like google.com / 8.8.8.8).
After some debugging (with basically zero knowledge on how container networking works), I discovered that cni and flannel are somehow part of it, and I saw that the recent release changed something with flannel.
When I install k3s with INSTALL_K3S_VERSION=v1.24.11+k3s1, it all seems to work just as normal.

Steps To Reproduce:
Creating the vagrant box

vagrant init rezonanc-oxid/ubuntu-bionic-kernel-4.15
vagrant up

Connecting to the vagrant box & setup

vagrant ssh
# Inside the vagrant terminal:
curl -sfL https://get.k3s.io | sh -
sudo chmod 644 /etc/rancher/k3s/k3s.yaml # To use kubectl without sudo
kubectl get pods -A # Sanity

Creating a pod with shell

kubectl run bbp --image=radial/busyboxplus:curl -i --tty -- sh

Expected behavior:
Inside the shell of the bbp pod:

[ root@bbp:/ ]$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=61 time=10.260 ms
64 bytes from 8.8.8.8: seq=1 ttl=61 time=17.567 ms
64 bytes from 8.8.8.8: seq=2 ttl=61 time=11.395 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 10.260/13.074/17.567 ms

Actual behavior:

[ root@bbp:/ ]$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 0 packets received, 100% packet loss
[ root@bbp:/ ]$
@brandond
Copy link
Member

brandond commented Mar 29, 2023

Please upgrade to the latest 1.25 release.

@sides-flow
Copy link
Author

sides-flow commented Mar 29, 2023

Please upgrade to the latest 1.25 release.

I just ran it again, with the steps above. It used this version:

vagrant@vagrant:~$ curl -sfL https://get.k3s.io | sh -
[INFO]  Finding release for channel stable
[INFO]  Using v1.25.7+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.25.7+k3s1/sha256sum-amd64.txt

Still the same behavior. However, when I install using this command:

vagrant@vagrant:~$ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.26.3+k3s1 sh -
[INFO]  Using v1.26.3+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.26.3+k3s1/sha256sum-amd64.txt

The problem is solved.
I guess it's better to update the stable channel to a more recent release that fixes this issue.
Anyways, this issue should be kept close since it shouldn't occur in future releases...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants