I have installed etcd
and kubernetes
on centos, now I wanna install kube-apiserver
. I installed kube-apiserver
by snap
.
sudo yum install epel-release
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install kube-apiserver
I start kube-apiserver
with the guide by this link.
Unfortunately, I got failed with ***error etcd certificate file not found in /etc/kubernetes/apiserver/apiserver.pem
. But I found that the certificate file exists, how to run the kube-apiserver
successfully?
2
Answers
I suggest using standard tool such as Kubeadm to install kubernetes on centos.
kubeadm init
will generate necessary certificates and install all the kubernetes control plane components including Kubernetes API Server.Following this guide you should be able to install a single control plane cluster of kubernetes.
Kubeadm supports kubernetes cluster with multiple control plane node as well as cluster with completely separate ETCD nodes.
I don’t know the reason of your failure. But I suggest you to install kubernetes by
kubeadm
, it’s a greatk8s
tool. If you installk8s
bykubeadm
, thekube-apiserver
will be installed as a k8s pod. The guide to install kubeadm via this link.I run the command
kubectl get pods -A
,kube-apiserver-centos-linux.shared
is a kube-apiserver pod, it is installed successfully.