It seems you don't have valid credentials for your kubectl client. It depends on how is auth configured in your cluster, what you need for auth.
Most tools, though, install credentials for kubectl when you run them. How did you install the cluster? On Friday, March 17, 2017, Caokun (Jack, Platform) <caokun...@huawei.com> wrote: > Hello experts, > > I have the issue on kubernetes > > http://stackoverflow.com/questions/42853991/error-from- > server-forbidden-the-server-does-not-allow-access-to-the-requested > > when run some command ,error occur: > > /home/kubernetes/cluster/ubuntu/binaries# ./kubectl version > > Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", > GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", > GitTreeState:"clean", BuildDate:"2017-03-07T23:53:09Z", > GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"} > > Error from server (Forbidden): the server does not allow access to the > requested resource > > /home/kubernetes/cluster/ubuntu/binaries# ./kubectl run helloworld > --image=canal-cni:latest --port=8888 > > Error from server (Forbidden): the server does not allow access to the > requested resource (post replicationcontrollers) > > > > os information > > NAME="Ubuntu" > > VERSION="16.04 LTS (Xenial Xerus)" > > ID=ubuntu > > ID_LIKE=debian > > PRETTY_NAME="Ubuntu 16.04 LTS" > > VERSION_ID="16.04" > > HOME_URL="http://www.ubuntu.com/" > > SUPPORT_URL="http://help.ubuntu.com/" > > BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" > > UBUNTU_CODENAME=xenial > > > > Linux SZV1000240235 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 > UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > > install refer doc: > > https://kubernetes.io/docs/getting-started-guides/ubuntu/manual/ > > > > other infor > > root@SZV1000240235:/home/kubernetes/cluster/ubuntu/binaries# ./kubectl > get nodes > > the server doesn't have a resource type "nodes" > > root@SZV1000240235:/home/kubernetes/cluster/ubuntu/binaries# ./kubectl > get pods > > the server doesn't have a resource type "pods" > > ./kube-apiserver > > --service-cluster-ip-range=10.1.0.1/24 > > --etcd-servers=http://127.0.0.1:4001 > > --advertise-address=100.109.165.127 > > --bind-address=100.109.165.127 > > --insecure-bind-address=100.109.165.127 > > --v=4 > > log infor > > W0317 15:16:55.425419 130979 storage_extensions.go:137] third party > resource sync failed: the server does not allow access to the requested > resource (get thirdpartyresources.extensions) > > E0317 15:17:00.119963 130979 controller.go:162] unable to sync kubernetes > service: the server does not allow access to the requested resource (post > services) > > W0317 15:17:06.226957 130979 storage_extensions.go:137] third party > resource sync failed: the server does not allow access to the requested > resource (get thirdpartyresources.extensions) > > E0317 15:17:11.745722 130979 controller.go:162] unable to sync kubernetes > service: the server does not allow access to the requested resource (post > services) > > W0317 15:17:17.069298 130979 storage_extensions.go:137] third party > resource sync failed: the server does not allow access to the requested > resource (get thirdpartyresources.extensions) > > E0317 15:17:24.228106 130979 controller.go:162] unable to sync kubernetes > service: the server does not allow access to the requested resource (post > services) > > W0317 15:17:28.683806 130979 storage_extensions.go:137] third party > resource sync failed: the server does not allow access to the requested > resource (get thirdpartyresources.extensions) > > E0317 15:17:36.439742 130979 controller.go:162] unable to sync kubernetes > service: the server does not allow access to the requested resource (post > services) > > > > > > > > > > related issue > > https://github.com/kubernetes/kubernetes/issues/43276 > > What's wrong with my configuration? > > thanks a lot > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kubernetes-users+unsubscr...@googlegroups.com > <javascript:_e(%7B%7D,'cvml','kubernetes-users%2bunsubscr...@googlegroups.com');> > . > To post to this group, send email to kubernetes-users@googlegroups.com > <javascript:_e(%7B%7D,'cvml','kubernetes-users@googlegroups.com');>. > Visit this group at https://groups.google.com/group/kubernetes-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.