小编Ant*_*ope的帖子

kubectl apply yield forbidden,检索当前配置时出错

按照步骤创建单个主集群,我能够成功初始化主集群,但是在应用时出现禁止错误,有人遇到过同样的情况吗?谢谢!

我做了以下

1. disable selinux in /etc/selinux/config, and reboot
2. comment out KUBELET_NETWORK_ARGS in 
         /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
3. export no_proxy=$no_proxy,<master-ip> 
4. export KUBECONFIG=/etc/kubernetes/kubelet.conf in .bash_profile
Run Code Online (Sandbox Code Playgroud)

初始化成功后,尝试申请时

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息

Error from server (Forbidden): error when retrieving current configuration of:
&{0xc42048ab40 0xc421a83730  
flannel https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml 0xc42109cc20  false}
from server for: "https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml": 
clusterroles.rbac.authorization.k8s.io "flannel" is forbidden: 
User "system:node:<master-server-name>" 
cannot get clusterroles.rbac.authorization.k8s.io at the cluster scope
Run Code Online (Sandbox Code Playgroud)

kubernetes

5
推荐指数
1
解决办法
6601
查看次数

标签 统计

kubernetes ×1