New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All nodes but the first one gets "unauthorized" #22

Closed
anton-johansson opened this Issue Jan 7, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@anton-johansson
Copy link
Contributor

anton-johansson commented Jan 7, 2019

I have three nodes:

  • k8s-worker-01
  • k8s-worker-02
  • k8s-worker-03

When starting the kubelet on the first one, it all works good. But on the other two nodes, I get the following errors:

Jan 07 11:41:52 k8s-worker-02 kubelet[7251]: E0107 11:41:52.642553    7251 kubelet_node_status.go:94] Unable to register node "k8s-worker-02" with API server: nodes is forbidden: User "system:anonymous" cannot create resource "nodes" in API group "" at the cluster scope
Jan 07 11:41:52 k8s-worker-02 kubelet[7251]: E0107 11:41:52.537626    7251 kubelet.go:2266] node "k8s-worker-02" not found
Jan 07 11:41:52 k8s-worker-02 kubelet[7251]: E0107 11:41:52.637743    7251 kubelet.go:2266] node "k8s-worker-02" not found

... along with a bunch other, all complaining about unauthorized user "system:anonymous".

Is this something you've seen before? I've tried manually using the certificates on the nodes, and that works:

$ curl \
    --cacert /etc/kubernetes/pki/ca.pem \
    --cert /etc/kubernetes/pki/cert.pem \
    --key /etc/kubernetes/pki/key.pem \
    https://k8s-master-01.viskanint.local:6443/api/v1/nodes
@anton-johansson

This comment has been minimized.

Copy link
Contributor

anton-johansson commented Jan 7, 2019

Found the issue, fix coming up!

anton-johansson added a commit to anton-johansson/kubernetes-the-right-way that referenced this issue Jan 7, 2019

@amimof amimof closed this in #23 Jan 8, 2019

amimof added a commit that referenced this issue Jan 8, 2019

Use the correct hostname in kubelet's kubeconfig (#23)
Closes #22

* Use the correct hostname in kubelet's kubeconfig

* Apply `kubectl` role on masters and nodes and let them make kubeconfigs

* Fixed var when not longer in loop

* Using templating to generate kubeconfigs instead of kubectl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment