kelseyhightower / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way. No scripts.
Apache License 2.0
40.73k stars 13.96k forks source link

CoreDNS (Forbidden): Forbidden (user=kubernetes, verb=get, resource=nodes, subresource=proxy) ( pods/log coredns-8494f9c688-4mhgx) #712

Closed redsigma closed 1 year ago

redsigma commented 2 years ago

After i applied the coredns 1.8 yaml deployment, the pods are stuck in ContainerCreating

The logs show the following error:

Error from server: Get "https://node.vm-centos-node1:10250/containerLogs/kube-system/coredns-8494f9c688-4mhgx/coredns": dial tcp: lookup node.vm-centos-node1 on 192.168.120.1:53: no such host

I have added the hostnames and their ips in /etc/hosts on master nodes (not sure if this is the correct approach) , and then this error showed up

Error from server (Forbidden): Forbidden (user=kubernetes, verb=get, resource=nodes, subresource=proxy) ( pods/log coredns-8494f9c688-4mhgx)

I am using kube 1.21.0 but i am doing all of the steps in a libvirt virtual machine with 5 nodes (2 worker, 1 master, 3 etcd, 1 loadbalancer)

If somebody could explain why it is not working or what have i missed. Or maybe some ways to debug this problem

cheungsuifai commented 1 year ago

have you change the the kube-apiserver startup script to enable RBAC authorization mode with

“--authorization-mode=Node,RBAC”
redsigma commented 1 year ago

I had the RBAC authorization added to the startup script.

I no longer have the setup files but I believe the problem was also related to the specs of the virtual machines being too low (1 cpu , 2gb ram).

I am also gonna close this issue because there's no point in keeping it if I no longer have the files.

PS: In the end I switched to kubeadm with amazon EC2 instances to get the job done.