作者:mobiledu2502891413 | 来源:互联网 | 2023-01-06 10:59
我正在尝试按照以下文档创建一个kubernetes集群:https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
首先,我在VirtualBox中使用Vagrant在Coreos(1520.9.0)上安装了带有docker镜像的kubeadm:
docker run -it \
-v /etc:/rootfs/etc \
-v /opt:/rootfs/opt \
-v /usr/bin:/rootfs/usr/bin \
-e K8S_VERSION=v1.8.4 \
-e CNI_RELEASE=v0.6.0 \
xakra/kubeadm-installer:0.4.7 coreos
这是我的kubeadm init:
kubeadm init --pod-network-cidr=10.244.0.0/16
运行命令时:
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml
它返回:
clusterrole "flannel" configured
clusterrolebinding "flannel" configured
serviceaccount "flannel" configured
configmap "kube-flannel-cfg" configured
daemonset "kube-flannel-ds" configured
但如果我检查"kubectl get pods --all-namespaces"
它返回:
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system etcd-coreos1 1/1 Running 0 18m
kube-system kube-apiserver-coreos1 1/1 Running 0 18m
kube-system kube-controller-manager-coreos1 0/1 CrashLoopBackOff 8 19m
kube-system kube-scheduler-coreos1 1/1 Running 0 18m
随着journalctl -f -u kubelet
我可以看到这个错误:Unable to update cni config: No networks found in /etc/cni/net.d
我怀疑这个命令有问题 kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml
有没有办法知道为什么这个命令不起作用?我可以从任何地方获取一些日志吗?