System Enviornment
- Calico Version: v3.25.0
- Kubeadm Version: 1.25
- Ubuntu 18.04.5 LTS
- Containerd Version: 1.6.16
- Docker Version: 23.0.0
Deploy K8S with CNI (Calico)
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.200.11
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/tigera-operator.yaml
wget https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/custom-resources.yaml
Modify custom-resources.yaml (Change CIDR to 10.244.0.0/16)
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
name: default
spec:
# Configures Calico networking.
calicoNetwork:
# Note: The ipPools section cannot be modified post-install.
ipPools:
- blockSize: 26
cidr: 10.244.0.0/16
encapsulation: VXLANCrossSubnet
natOutgoing: Enabled
nodeSelector: all()
---
# This section configures the Calico API server.
# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
name: default
spec: {}
I am struggling with the fact that the calico-kube-controllers and coredns pods are showing as pending status.
After I Googled this issue, I found that containerd could no longer listen to CNI events. Restarting containerd could fix this problem.
sudo systemctl restart containerd
It seems to have worked out!
Reference
安装之后一直coredns pending · Issue #834 · labring/sealos (github.com)