Kubernetes FAQs
crictl images Command Execution Failed
-
Applicable Version: Kubernetes 1.35.3, kernel version < 4.11
-
Error Message:
FATA[0000] validate service connection: validate CRI v1 image API for endpoint "unix:///run/containerd/containerd.sock": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService -
Solution:
Disable the
enable_unprivileged_portsandenable_unprivileged_icmpsettings in containerd:# Check the current configurationgrep -nE 'unprivileged_(icmp|port)' /etc/containerd/config.toml# Set both options to falsesed -i \-e 's/^\(\s*enable_unprivileged_ports\s*=\s*\)true/\1false/' \-e 's/^\(\s*enable_unprivileged_icmp\s*=\s*\)true/\1false/' \/etc/containerd/config.toml# Verify the changesgrep -nE 'unprivileged_(icmp|port)' /etc/containerd/config.tomlsystemctl restart containerd-
After restarting, run the following command to verify plugin status. All plugins showing
okindicates normal operation:ctr plugin ls | grep -E 'cri|io.containerd.grpc.v1.cri'Expected output
io.containerd.cri.v1 images - okio.containerd.cri.v1 runtime linux/amd64 okio.containerd.grpc.v1 cri - ok
-
Calico Installation Failed
-
Applicable Version: Kubernetes 1.35.3
-
Error Message:
kubectl -n kube-system logs calico-node-xxx -c upgrade-ipamThis program can only be run on AMD64 processors with v2 microarchitecture support. -
Cause: The CPU does not support the x86-64-v2 architecture. Starting from Calico v3.31.1, only x86-64-v2 and above architectures are supported. Reference: Calico GitHub Issue #11352
-
Solution: Switch to Calico 3.30.7
-
Download and extract the installation package, then import the images
wget https://pdpublic.mingdao.com/private-deployment/offline/common/kubernetes-1.35.3/calico-3.30.7-yaml-images-amd64.tar.gztar xzvf calico-3.30.7-yaml-images-amd64.tar.gzcd calico-3.30.7-yaml-images-amd64gunzip -d calico-3.30.7-images-amd64.tar.gzctr -n k8s.io image import calico-3.30.7-images-amd64.tar -
Move calico.yaml to the installation directory
Run this command from within the
calico-3.30.7-yaml-images-amd64directorymv calico.yaml /usr/local/kubernetes/ -
Modify the configuration file
-
Replace the image registry address
sed -ri 's|image: docker.io/calico|image: 127.0.0.1:5000|g' /usr/local/kubernetes/calico.yamlgrep image: /usr/local/kubernetes/calico.yamlExample output
image: 127.0.0.1:5000/cni:v3.30.7image: 127.0.0.1:5000/cni:v3.30.7image: 127.0.0.1:5000/node:v3.30.7image: 127.0.0.1:5000/node:v3.30.7image: 127.0.0.1:5000/kube-controllers:v3.30.7 -
Configure the Pod CIDR
sed -ri '/# - name: CALICO_IPV4POOL_CIDR/,/# value: ".*"/ {s/# - name: CALICO_IPV4POOL_CIDR/- name: CALICO_IPV4POOL_CIDR/s/# value: ".*"/ value: "10.244.0.0\/16"/}' /usr/local/kubernetes/calico.yamlgrep -C 2 CALICO_IPV4POOL_CIDR /usr/local/kubernetes/calico.yamlExample output
# chosen from this range. Changing this value after installation will have# no effect. This should fall within `--cluster-cidr`.- name: CALICO_IPV4POOL_CIDRvalue: "10.244.0.0/16"# Disable file logging so `kubectl logs` works. -
Configure the CNI binary path
sed -i '/- name: cni-bin-dir/,/type:/s|path: .*|path: /usr/local/kubernetes/cni/bin|' /usr/local/kubernetes/calico.yamlgrep -C 2 cni-bin-dir /usr/local/kubernetes/calico.yamlExample output
name: host-local-net-dir- mountPath: /host/opt/cni/binname: cni-bin-dirsecurityContext:privileged: true--volumeMounts:- mountPath: /host/opt/cni/binname: cni-bin-dir- mountPath: /host/etc/cni/net.dname: cni-net-dir--path: /proc# Used to install CNI.- name: cni-bin-dirhostPath:path: /usr/local/kubernetes/cni/bin
-
-
Deploy Calico
kubectl apply -f /usr/local/kubernetes/calico.yaml
-
calico-node Pod Health Check Failed
-
Applicable Version: Kubernetes 1.35.3
-
Error Message:
Warning Unhealthy 115s kubelet Readiness probe errored and resulted in unknown state: rpc error: code = Unknown desc = failed to exec in container: failed to start exec "...": OCI runtime exec failed: exec failed: unable to start container process: error adding pid 23804 to cgroups: Unknown method 'AttachProcessesToUnit' or interface 'org.freedesktop.systemd1.Manager' -
Cause: The system does not support the
systemdcgroup driver; the cgroup drivers of containerd and kubelet are incompatible. -
Solution:
Switch the containerd cgroup driver from
systemdtocgroupfsand reinitialize the cluster:-
Modify the containerd configuration
sed -i 's/SystemdCgroup = true/SystemdCgroup = false/g' /etc/containerd/config.tomlgrep -n "SystemdCgroup" /etc/containerd/config.tomlsystemctl restart containerd -
Append the kubelet cgroup configuration to
kubeadm-config.yaml, then re-runkubeadm initto reinitializecd /usr/local/kubernetes/cat >> kubeadm-config.yaml <<'EOF'---apiVersion: kubelet.config.k8s.io/v1beta1kind: KubeletConfigurationcgroupDriver: cgroupfsEOF
-