kubernetes: Kubelet won't read apiserver from kubeconfig
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No
What keywords did you search in Kubernetes issues before filing this one? kubelet kubeconfig
Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug report
Kubernetes version (use kubectl version
):
Client Version: version.Info{Major:“1”, Minor:“4”, GitVersion:“v1.4.3+coreos.0”, GitCommit:“7819c84f25e8c661321ee80d6b9fa5f4ff06676f”, GitTreeState:“clean”, BuildDate:“2016-10-17T21:19:17Z”, GoVersion:“go1.6.3”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“4”, GitVersion:“v1.4.3+coreos.0”, GitCommit:“7819c84f25e8c661321ee80d6b9fa5f4ff06676f”, GitTreeState:“clean”, BuildDate:“2016-10-17T21:19:17Z”, GoVersion:“go1.6.3”, Compiler:“gc”, Platform:“linux/amd64”}
Environment:
-
Cloud provider or hardware configuration:
-
OS (e.g. from /etc/os-release): Ubuntu Xenial 16.04
-
Kernel (e.g.
uname -a
): Linux node1 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux -
Install tools: Kargo (Ansible-based)
-
Others:
What happened: –api-servers option is deprecated for kubelet, so I am now trying to deploy with simply using --kubeconfig=/etc/kubernetes/node-kubeconfig.yaml
The error in kubelet log is:
W1114 12:00:28.684692 31989 server.go:383] No API client: no api servers specified
What you expected to happen: Kubelet should start and register itself to my kube apiserver
How to reproduce it (as minimally and precisely as possible):
Execution call:
hyperkube kubelet --v=2 --address=10.90.0.2 --hostname-override=node1 --allow-privileged=true --cluster_dns=10.233.0.2 --cluster_domain=cluster.local --kubeconfig=/etc/kubernetes/node-kubeconfig.yaml --pod-manifest-path=/etc/kubernetes/manifests --resolv-conf=/etc/resolv.conf --pod-infra-container-image=gcr.io/google_containers/pause-amd64:3.0 --network-plugin=cni --network-plugin-dir=/etc/cni/net.d
kubeconfig:
kind: Config
clusters:
- name: local
cluster:
certificate-authority: /etc/kubernetes/ssl/ca.pem
server: https://node1:443
users:
- name: kubelet
user:
client-certificate: /etc/kubernetes/ssl/node.pem
client-key: /etc/kubernetes/ssl/node-key.pem
contexts:
- context:
cluster: local
user: kubelet
name: kubelet-cluster.local
current-context: kubelet-cluster.local
Anything else do we need to know: Kubelet works fine with --api-servers specified, but not when reading the server field in kubeconfig. The results are the same when trying to connect to http or https-based apiserver.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 21 (12 by maintainers)
Commits related to this issue
- k8s: Fix kubelet, add RBAC and pass e2e tests Due to a few several small connected patches for the fedora atomic driver, this patch includes 4 smaller patches. Patch 1: k8s: Do not start kubelet and... — committed to openstack/magnum by strigazi 6 years ago
- k8s: Fix kubelet, add RBAC and pass e2e tests Due to a few several small connected patches for the fedora atomic driver, this patch includes 4 smaller patches. Patch 1: k8s: Do not start kubelet and... — committed to openstack/magnum by strigazi 6 years ago
Another update. If you specify --kubeconfig, but omit --api-servers and --require-kubeconfig, kubelet won’t connect to any apiserver. If you add --require-kubeconfig, it works. Is that expected behavior?
Yes. The plan is to completely remove --api-servers and default --require-kubeconfig to true in 1.7