裸机上的Kubernetes集群设置

时间:2020-02-04 10:58:54

标签: docker kubernetes centos7

我正在尝试在裸机上设置3个节点kubernetes集群(1个主节点和2个工作节点)。我正在关注以下用于设置https://www.linuxtechi.com/install-kubernetes-1-7-centos7-rhel7/的链接 和https://phoenixnap.com/kb/how-to-install-kubernetes-on-centos

除了上述链接中提到的先决条件外,我还禁用了swap(systemctl stop firewalld),禁用了selinux策略(sudo setenforce 0)和更新的Iptables设置

cat  < /etc/sysctl.d/master_node_name
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system

但是,一旦我开始kubeadm init --apiserver-advertise-address 192.168.140.48(在主节点上) 我在docker中为k8s_kube-controller-manager遇到以下错误:

E0204 1 leaderelection.go:330 error retrieving resource lock kube-system/kube-controller-manager: Get https://192.168.140.48:6443/api/v1/namespaces/kube-system/endpoints/kube-controller-manager?timeout=10s: Forbidden

,对于docker k8s_kube-scheduler如下

E0204 1 reflector.go:123 k8s.io/client-go/informers/factory.go:134: Failed to list *v1.Node: Get https://192.168.140.48:6443/api/v1/nodes?limit=500&resourceVersion=0: Forbidden
E0204 10:45:44.629865       1 reflector.go:123] k8s.io/kubernetes/cmd/kube-scheduler/app/server.go:250: Failed to list *v1.Pod: Get https://192.168.140.48:6443/api/v1/pods?fieldSelector=status.phase%21%3DFailed%2Cstatus.phase%21%3DSucceeded&limit=500&resourceVersion=0: Forbidden

任何帮助将不胜感激。预先感谢。

0 个答案:

没有答案