我使用以下命令执行kubeinit (我正在尝试在RHEL 7.6上设置Kubernetes )
kubeadm init --apiserver-advertise-address=15.217.230.99 --pod-network-cidr=15.232.10.195/27我想用棉布网络。由于我不能使用192.168.0.0/16网络,所以我必须从calico.yaml中提取https://docs.projectcalico.org/v3.9/manifests/calico.yaml,然后修改CALICO_IPV4POOL_CIDR,使其值为15.232.10.195/27 (首先,我不知道这里是否正确。当我尝试使用命令(作为sudo用户)应用文件时,我对Kubernetes非常陌生,并试图设置我的第一个集群:
kubectl apply -f ./calico.yaml我得到以下错误:
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused
unable to recognize "./calico.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused我的api服务器运行在端口6443上。这就是我在kubeadm连接令牌中看到的由kubeadm init生成的。
有人能帮我纠正一下我的错误吗?除了192.168.0.0/16之外,还可以使用其他的网络掩码吗?我不能用它,因为它已经在我们的网络中使用了。
除了集群上的linux节点之外,我还想加入Windows节点。Calico网络是一种正确的方法还是推荐是另一回事。在初始化集群上的网络之前,我想知道,这样我就可以做正确的处理。
谢谢
发布于 2019-11-22 21:05:34
在挣扎了几个小时之后,我发现kubectl应用命令需要作为常规用户而不是根用户运行。确保您正在为我们复制. .kube/config文件的用户执行该命令,否则在执行该命令后它将无法工作,我看到我的主程序已经准备好了。
发布于 2020-01-19 15:41:48
按照以下步骤克服这一问题:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/confighttps://stackoverflow.com/questions/58998354
复制相似问题