2

I am trying to setup kubelet component as standalone service from kubernetes page, though it seems I am missing something.

I've configured the containerd + runc (according to steps) with:

$ mkdir -p /etc/containerd/
$ containerd config default | tee /etc/containerd/config.toml
$ sed 's/SystemdCgroup.*/SystemdCgroup = true/' -i /etc/containerd/config.toml 

to enable runc according to:

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
  ...
  [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
    SystemdCgroup = true

though, It seems something is missing, because I keep getting the error:

Feb 28 12:29:45 ip-200-115-0-5 kubelet[1854442]: E0228 12:29:45.986417 1854442 cri_stats_provider.go:455] "Failed to get the info of the filesystem with mountpoint" err="unable to find data in memory cache" mountpoint="/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs"

The second problem, is that I can't seem to access internet from within pod. I've started kubelet with command:

ExecStart=/usr/local/bin/kubelet \
            --config=/etc/kubernetes/kubelet-config.yaml \
            --resolv-conf=/etc/resolv.conf \
            --pod-cidr=10.88.0.0/16 \
            --cluster-domain=cluster.local \
            --cluster-dns=127.0.0.53 \
            --cgroup-driver=systemd \
            --fail-swap-on=false \
            --pod-manifest-path=/etc/kubernetes/manifests \
            --container-runtime=remote \
            --container-runtime-endpoint=unix:///run/containerd/containerd.sock \
            --runtime-request-timeout=10m \
            --network-plugin=cni \
            --cni-conf-dir=/etc/cni/ \
            --cni-bin-dir=/opt/cni/bin

For the versions, I am using:

  • containerd 1.6.19
  • runc 1.1.4
  • kubelet 1.23.16
  • ubuntu 20.04

Any tips?

Thanks

1 Answers1

0

After some time away from this, was able to circle back and troubleshoot it a little more.

So, the initial thought was that the container didn't have network. To troubleshoot this you can do the following:

# ip netns
cni-f6078594-55bf-95d3-a2fd-33a5095b74c9 (id: 0)

So, for each Pod that Kubelet spins, it will create a network namespace and attach virtual interfaces, this is a Pod design. Check it here.

Moving on with the troubleshoot:

# ip netns exec cni-f6078594-55bf-95d3-a2fd-33a5095b74c9 ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 56:ef:8e:da:f2:29 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.200.0.15/24 brd 10.200.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::54ef:8eff:feda:f229/64 scope link 
       valid_lft forever preferred_lft forever

This highlight that the interface inside the network namespace had indeed been assigned with a ip 10.200.0.15/24

Lets try connection through the namespace:

# ip netns exec cni-f6078594-55bf-95d3-a2fd-33a5095b74c9 ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=0.975 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=1.24 ms

Which reassures that the container has connectivity, though, when trying:

# ip netns exec cni-f6078594-55bf-95d3-a2fd-33a5095b74c9 ping google.com
ping: google.com: Temporary failure in name resolution 

This concludes that we are having a dns problem and not a connectivity problem.

So, to solve that, I've created a new /root/resolve.conf file with good servers:

nameserver 8.8.8.8
nameserver 8.8.4.4

And updated the command:

--resolv-conf=/etc/resolv.conf \

To point to the new file, as:

--resolv-conf=/root/resolv.conf \

And also, removed the cluster DNS:

--cluster-dns=127.0.0.53 \

Still need to fix the cluster-dns, though for validation purposes having the dns pointed to DNS outside the instance is good enough.

EDIT:

On a hindsight, I've improved this. I've let the resolv.conf unchanged and updated the cluster-dns:

--cluster-dns=8.8.8.8 \

That was a better solution for now. Still investigating.