我已经在centos上安装了etcdkubernetes,现在我想安装kube-apiserver。我通过kube-apiserver安装了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
我从link的指南开始kube-apiserver
不幸的是,我失败了***error etcd certificate file not found in /etc/kubernetes/apiserver/apiserver.pem。但是我发现证书文件存在,如何成功运行kube-apiserver

最佳答案

我不知道你失败的原因。但是我建议您通过kubeadm安装kubernetes,这是一个很棒的k8s工具。如果通过k8s安装kubeadm,则kube-apiserver将作为k8s pod安装。通过link安装kubeadm的指南。
我运行命令kubectl get pods -A

[karl@centos-linux ~]$ kubectl get pods -A
NAMESPACE     NAME                                          READY   STATUS    RESTARTS   AGE
kube-system   coredns-66bff467f8-64pt6                      1/1     Running   6          4d18h
kube-system   coredns-66bff467f8-xpnsr                      1/1     Running   6          4d18h
kube-system   etcd-centos-linux.shared                      1/1     Running   6          4d18h
kube-system   kube-apiserver-centos-linux.shared            1/1     Running   6          4d18h
kube-system   kube-controller-manager-centos-linux.shared   1/1     Running   6          4d18h
kube-system   kube-flannel-ds-amd64-48stf                   1/1     Running   8          4d18h
kube-system   kube-proxy-9w8gh                              1/1     Running   6          4d18h
kube-system   kube-scheduler-centos-linux.shared            1/1     Running   6          4d18h
kube-apiserver-centos-linux.shared是一个kube-apiserver容器,已成功安装。

关于kubernetes - 如何在centos上安装kube-apiserver?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/62988090/

10-09 21:34