I'm new to Kubernetes, so please bear with me. I deployed K8s on Ubuntu 20.04 and am having issues with the 'kalico' pods and also the coreDNS pods:
root@k8s-master:~# kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-56cdb7c587-85qrr 0/1 Pending 0 4m24s
kube-system calico-node-kjmmh 0/1 Error 5 168m
kube-system canal-btw4r 0/2 Init:CrashLoopBackOff 5 (48s ago) 4m24s
kube-system coredns-5fcc94c66-6wptx 0/1 Pending 0 149m
kube-system coredns-5fcc94c66-lkxbp 0/1 Pending 0 149m
kube-system coredns-6d4b75cb6d-l68p2 0/1 Pending 0 154m
kube-system etcd-k8s-master 1/1 Running 1 (158m ago) 3h39m
kube-system kube-apiserver-k8s-master 1/1 Running 1 (158m ago) 3h39m
kube-system kube-controller-manager-k8s-master 1/1 Running 1 (158m ago) 3h39m
kube-system kube-proxy-lndkt 1/1 Running 1 (158m ago) 3h39m
kube-system kube-scheduler-k8s-master 1/1 Running 1 (158m ago) 3h39m
Checking the calico pod logs I see this:
root@k8s-master:~# kubectl logs -n kube-system calico-node-kjmmh
Defaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), flexvol-driver (init)
2022-06-21 23:12:45.486 [INFO][8] startup/startup.go 299: Early log level set to info
2022-06-21 23:12:45.486 [INFO][8] startup/startup.go 315: Using NODENAME environment for node name
2022-06-21 23:12:45.487 [INFO][8] startup/startup.go 327: Determined node name: k8s-master
2022-06-21 23:12:45.487 [INFO][8] startup/startup.go 359: Checking datastore connection
2022-06-21 23:12:45.504 [INFO][8] startup/startup.go 383: Datastore connection verified
2022-06-21 23:12:45.504 [INFO][8] startup/startup.go 104: Datastore is ready
2022-06-21 23:12:45.505 [INFO][8] startup/customresource.go 101: Error getting resource Key=GlobalFelixConfig(name=CalicoVersion) Name="calicoversion" Resource="GlobalFelixConfigs" error=the server could not find the requested resource (get GlobalFelixConfigs.crd.projectcalico.org calicoversion)
2022-06-21 23:12:45.512 [INFO][8] startup/startup.go 664: Using autodetected IPv4 address on interface ens192: 192.168.3.71/24
2022-06-21 23:12:45.512 [INFO][8] startup/startup.go 727: No AS number configured on node resource, using global value
2022-06-21 23:12:45.512 [INFO][8] startup/startup.go 201: Setting NetworkUnavailable to False
2022-06-21 23:12:45.522 [INFO][8] startup/startup.go 772: found v4=10.244.0.0/16 in the kubeadm config map
2022-06-21 23:12:45.522 [INFO][8] startup/startup.go 776: found v6= in the kubeadm config map
2022-06-21 23:12:45.523 [INFO][8] startup/startup.go 616: CALICO_IPV4POOL_NAT_OUTGOING is true (defaulted) through environment variable
2022-06-21 23:12:45.523 [INFO][8] startup/startup.go 928: Ensure default IPv4 pool is created. IPIP mode: Always, VXLAN mode: Never
2022-06-21 23:12:45.525 [ERROR][8] startup/startup.go 934: Failed to create default IPv4 IP pool: 10.244.0.0/16 error=resource does not exist: FelixConfiguration(default) with error: the server could not find the requested resource (post FelixConfigurations.crd.projectcalico.org)
2022-06-21 23:12:45.525 [WARNING][8] startup/startup.go 1214: Terminating
Calico node failed to start
Resolved now: I did not have a working CNI
I had issues with flannel (and calico), so gave up on them and used Kube-Router instead: https://github.com/cloudnativelabs/kube-router/blob/master/docs/user-guide.md
kubeadm reset
KUBECONFIG=/etc/kubernetes/admin.conf kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml