Kubernetes1.8以后kubelet连接api-server问题
Kubernetes1.8以后版本,kubelet命令去掉--api-servers选项,参考官方kubelet
1.8 --kubeconfig string Path to a kubeconfig file, specifying how to connect to the API server. (default "/var/lib/kubelet/kubeconfig") 1.7 --kubeconfig string Path to a kubeconfig file, specifying how to connect to the API server. --api-servers will be used for the location unless --require-kubeconfig is set. (default "/var/lib/kubelet/kubeconfig")
1.8以后如何配置kubelet连接api-server呢?有两种方法
方法一,使用kubectl config
kubectl config set-cluster kubernetes \--server=http://127.0.0.1:8080
方法二,使用--kubeconfig,修改/etc/kubernetes/kubelet
KUBELET_ARGS="--kubeconfig=/var/lib/kubelet/kubeconfig --cgroup-driver=systemd --fail-swap-on=false"