【发布时间】:2022-02-11 07:19:51
【问题描述】:
我做了一个基本的 kubernetes 安装,并添加了 hello-world pod。当我尝试 kubectl exec 时,出现以下错误。
kubectl logs hello-world-pod1
Error from server (Forbidden): pods "hello-world-pod1" is forbidden: User "system:node:kubnode1" cannot get resource "pods/log" in API group "" in the namespace "default"
kubectl exec -it hello-world-pod1 -- /bin/sh
Error from server (Forbidden): pods "hello-world-pod1" is forbidden: User "system:node:kw1" cannot create resource "pods/exec" in API group "" in the namespace "default"
没有任何特殊安装,只是基本说明,并且无法访问基本 pod 的外壳,我研究了互联网但找不到任何解决方案或错误来源。
【问题讨论】:
-
您正在使用 kubelet 的 kubeconfig。尝试使用正确的 kubeconfig 运行。
-
这听起来像是 Kubernetes RBAC 问题,您必须联系集群管理员。
-
它的标准安装,我可以在其中找到正确的 kubeconfig
标签: docker kubernetes