Kubernetes node message Unable to authenticate the request due to an error: invalid bearer token

7/24/2018

In my v1.11.1 cluster I have added new node by creating the new token (kubeadm token create --print-join-command). Node joined the cluster successfully and in Ready Status. In the log file I see below message.

Why its throwing this message? How to resolve this issue?

Jul 24 08:45:45 node03 kubelet: E0724 08:45:45.326489    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token
Jul 24 08:46:00 node03 kubelet: E0724 08:46:00.327264    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token
Jul 24 08:46:03 node03 kubelet: E0724 08:46:03.353306    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token
Jul 24 08:46:15 node03 kubelet: E0724 08:46:15.324814    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token
Jul 24 08:46:30 node03 kubelet: E0724 08:46:30.324926    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token
Jul 24 08:46:33 node03 kubelet: E0724 08:46:33.353238    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token
Jul 24 08:46:45 node03 kubelet: E0724 08:46:45.324950    2580 server.go:222] Unable to authenticate the request due to an error: invalid bearer token

Thanks Sr

Update

bootstrap-kubelet.conf

apiVersion: v1
clusters:
- cluster:
    server: https://kubeapi:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: tls-bootstrap-token-user
  name: tls-bootstrap-token-user@kubernetes
current-context: tls-bootstrap-token-user@kubernetes
kind: Config
preferences: {}
users:
- name: tls-bootstrap-token-user
  user:
    token: l8um3f.ll9xxgxbhmiv6ivn

kubelet.conf

apiVersion: v1
clusters:
- cluster:
    server: https://kubeapi:6443
  name: default-cluster
contexts:
- context:
    cluster: default-cluster
    namespace: default
    user: default-auth
  name: default-context
current-context: default-context
kind: Config
preferences: {}
users:
- name: default-auth
  user:
    client-key: /var/lib/kubelet/pki/kubelet-client-current.pem

Process running like this

/usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=cgroupfs --cni-bin-dir=/opt/cni/bin --cni-conf-dir=/etc/cni/net.d --network-plugin=cni
-- sfgroups
kubernetes

0 Answers