我正试图在ubuntu上建立一个裸金属库伯内特斯星系团。
遵循一步一步的指南(https://www.youtube.com/watch?v=UWg3ORRRF60),我成功地安装了kubernetes主人,并得到了成功的消息:“您的Kubernetes主人已经成功地初始化了!”初始化集群后,使用'kubeadm init --pod=10.0.0.0/16-apiserver-address=10.0.20‘命令。
现在,下一步是部署一个pod网络,因此我使用了calico,运行了以下命令:
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml --validate=false我得到了输出:
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ConfigMap" in version "v1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "Service" in version "v1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "DaemonSet" in version "extensions/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ServiceAccount" in version "v1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"
unable to recognize "https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml": no matches for kind "ServiceAccount" in version "v1"我的kubectl版本输出是:
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:53:20Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Error from server (NotFound): the server could not find the requested resource会感谢任何帮助,甚至一些自我调试的建议。谢谢。
发布于 2018-08-13 16:30:00
如本post。中所述,您必须为您的pod和apiserver广告地址使用单独的范围,请尝试删除群集,并以不同的网络配置重新安装它:
从以下方面开始:
运行此命令可以通过“kubeadm”或“kubeadm”恢复对此主机所做的任何更改。 kubeadm复位
然后再次插入集群(IP地址是一个安全的例子)。
kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=10.0.0.20 另外,如果您正在运行该功能,就像教程中在主节点上链接的那样,您可以跳过-apiserver广告地址,因为它使用当前机器的默认网关。
从kubeadm 文档运行标准命令
要使kubectl为非根用户工作,请运行以下命令,这些命令也是
kubeadm init输出的一部分:
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
或者,如果您是
root用户,则可以运行:
export KUBECONFIG=/etc/kubernetes/admin.conf
之后,为卡利科安装网络外接程序:
为了使网络策略正确工作,需要将
--pod-network-cidr=192.168.0.0/16传递给kubeadm init。注意,Calico只在amd64上工作。
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml您也可以从头开始使用官方的Kubernetes文件来介绍如何安装kubeadm。
发布于 2020-01-19 13:56:24
如果kubernete版本高于1.16,请使用下面的链接安装棉布。
kubectl apply -f https://docs.projectcalico.org/v3.9/manifests/calico.yaml请检查节点状态以确认是否安装成功。

核心和棉布应处于运行状态。

https://stackoverflow.com/questions/51802925
复制相似问题