创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
问题
calico-node 无法启动
calico-kubeconfig 里面server 为啥包含[ ]字符
操作系统信息
海光Hygon C86 7380cpu物理机,Ubuntu 22.04.5 LTS,128C/256G
Kubernetes版本信息
将 kubectl version
命令执行结果贴在下方
root@localhost:~/kubesphere# kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.16", GitCommit:"cbb86e0d7f4a049666fac0551e8b02ef3d6c3d9a", GitTreeState:"clean", BuildDate:"2024-07-17T01:53:56Z", GoVersion:"go1.22.5", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.16", GitCommit:"cbb86e0d7f4a049666fac0551e8b02ef3d6c3d9a", GitTreeState:"clean", BuildDate:"2024-07-17T01:44:26Z", GoVersion:"go1.22.5", Compiler:"gc", Platform:"linux/amd64"}
容器运行时
将 docker version
/ crictl version
/ nerdctl version
结果贴在下方
root@localhost:~/kubesphere# crictl version
Version: 0.1.0
RuntimeName: containerd
RuntimeVersion: v1.7.13
RuntimeApiVersion: v1
Calico-node日志
root@localhost:~/kubesphere# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
calico-kube-controllers-6d7dfcb56d-tjkj4 0/1 ContainerCreating 0 10m
calico-node-chk57 0/1 CrashLoopBackOff 6 (4m53s ago) 10m
coredns-5d6688d45b-9tj4m 0/1 ContainerCreating 0 10m
coredns-5d6688d45b-tzgk8 0/1 ContainerCreating 0 10m
kube-apiserver-k8s-master 1/1 Running 0 10m
kube-controller-manager-k8s-master 1/1 Running 0 10m
kube-proxy-hs6b7 1/1 Running 0 10m
kube-scheduler-k8s-master 1/1 Running 0 10m
nodelocaldns-k2hz7 1/1 Running 0 10m
root@localhost:~/kubesphere# kubectl logs calico-node-chk57 -n kube-system
Defaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), mount-bpffs (init)
root@localhost:~/kubesphere# kubectl logs calico-node-chk57 -n kube-system -c upgrade-ipam
2024-11-05 04:16:32.472 [INFO][1] ipam_plugin.go 79: migrating from host-local to calico-ipam...
2024-11-05 04:16:32.481 [INFO][1] migrate.go 66: checking host-local IPAM data dir dir existence...
2024-11-05 04:16:32.481 [INFO][1] migrate.go 68: host-local IPAM data dir dir not found; no migration necessary, successfully exiting...
2024-11-05 04:16:32.481 [INFO][1] ipam_plugin.go 109: migration from host-local to calico-ipam complete node="k8s-master"
root@localhost:~/kubesphere# kubectl logs calico-node-chk57 -n kube-system -c install-cni
2024-11-05 04:16:33.588 [INFO][1] cni-installer/<nil> <nil>: Running as a Kubernetes pod
2024-11-05 04:16:33.620 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/bandwidth
2024-11-05 04:16:33.775 [INFO][1] cni-installer/<nil> <nil>: File is already up to date, skipping file="/host/opt/cni/bin/calico"
2024-11-05 04:16:33.885 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/calico
2024-11-05 04:16:34.030 [INFO][1] cni-installer/<nil> <nil>: File is already up to date, skipping file="/host/opt/cni/bin/calico-ipam"
2024-11-05 04:16:34.137 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/calico-ipam
2024-11-05 04:16:34.146 [INFO][1] cni-installer/<nil> <nil>: File is already up to date, skipping file="/host/opt/cni/bin/flannel"
2024-11-05 04:16:34.151 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/flannel
2024-11-05 04:16:34.179 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/host-local
2024-11-05 04:16:34.208 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/loopback
2024-11-05 04:16:34.238 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/portmap
2024-11-05 04:16:34.266 [INFO][1] cni-installer/<nil> <nil>: Installed /host/opt/cni/bin/tuning
2024-11-05 04:16:34.266 [INFO][1] cni-installer/<nil> <nil>: Wrote Calico CNI binaries to /host/opt/cni/bin
2024-11-05 04:16:34.266 [INFO][1] cni-installer/<nil> <nil>: CNI plugin version: v3.27.4
2024-11-05 04:16:34.266 [INFO][1] cni-installer/<nil> <nil>: /host/secondary-bin-dir is not writeable, skipping
2024-11-05 04:16:34.266 [WARNING][1] cni-installer/<nil> <nil>: Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
2024-11-05 04:16:34.280 [INFO][1] cni-installer/<nil> <nil>: Using CNI config template from CNI_NETWORK_CONFIG environment variable.
{
2024-11-05 04:16:34.281 [INFO][1] cni-installer/<nil> <nil>: Created /host/etc/cni/net.d/10-calico.conflist
2024-11-05 04:16:34.281 [INFO][1] cni-installer/<nil> <nil>: Done configuring CNI. Sleep= false
"name": "k8s-pod-network",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "calico",
"log_level": "info",
"log_file_path": "/var/log/calico/cni/cni.log",
"datastore_type": "kubernetes",
"nodename": "k8s-master",
"mtu": 0,
"ipam": {
"type": "calico-ipam"
},
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
}
},
{
"type": "portmap",
"snat": true,
"capabilities": {"portMappings": true}
},
{
"type": "bandwidth",
"capabilities": {"bandwidth": true}
}
]
}
root@localhost:~/kubesphere# kubectl logs calico-node-chk57 -n kube-system -c mount-bpffs
2024-11-05 04:16:34.690 [INFO][1] init-best-effort/startup.go 445: Early log level set to info
2024-11-05 04:16:34.691 [INFO][1] init-best-effort/calico-init_linux.go 57: Checking if BPF filesystem is mounted.
2024-11-05 04:16:34.691 [INFO][1] init-best-effort/calico-init_linux.go 69: BPF filesystem is mounted.
2024-11-05 04:16:34.691 [INFO][1] init-best-effort/calico-init_linux.go 92: Checking if cgroup2 filesystem is mounted.
2024-11-05 04:16:34.692 [INFO][1] init-best-effort/calico-init_linux.go 111: Cgroup2 filesystem is mounted.
Calico-kubeconfig
# Kubeconfig file for Calico CNI plugin.
apiVersion: v1
kind: Config
clusters:
- name: local
cluster:
server: https://[10.233.0.1]:443
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJWm55L2lpdFpyRFF3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRFeE1EVXdOREV4TURoYUZ3MHpOREV4TURNd05ERTJNRGhhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURnUGczVFdRL3Joak9GNXI4WUxja2Y3SjhyV3VHY01sUUhsTUYyWSsxZ09TNENDT045amVWbGU4SkQKTVYvdFIxYXB0Y2cvMmRRZ0dRNG5XT3VvdGUvR1AwNHFrc3NNNmV5d0V4T1I2clNiZ2tHQnhKeTlJZXc5YzJqSApxVThYa2pNZjFjNWV3ZmpLUFlIelcxQVRQOFpWTE1qbUo2TFExRWpMQVpaOURpTmVnam1xQ2tLajJ4bEdvOXJ0CmxQTFV3ZHBwZWs3bSsxUE0ycmI5NEtkaGUxTnNldXFGMnJmMEJERklkYTY2d0VtUlVramEvM2NXSnJNdHlUSUMKTFZrRDJmK2RqNDNmQitXNmxMMTBtTUNTZVF3aGd3NXUrUmVnMFJwZFRXU0lhZG9iMWErNVRxbEpJKzg4NmF3OAp2Q2NKRmlTTkVqa1BheFhiY2NmRmFkaHlJM29wQWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJUYXlXaE5P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