推荐在centos7+上面安装Kubernetes,测试在centos6.x上安装Kubernetes可能会有各种异常问题。在centos7+上安装Kubernetes步骤如下:
- 关闭centos防火墙
systemctl disable firewalld
systemctl stop firewalld
- 安装etcd和kubernetes
该步骤会默认安装docker。所以建议在原机器上没有安装Docker,否则可能会有冲突导致安装失败。
yum install -y etcd kubernetes
- 修改/etc/kubernetes/apiserver
vim /etc/kubernetes/apiserver
将KUBE_ADMISSION_CONTROL选项中的ServiceAccount删除掉。
- 按顺序启动相关服务
systemctl start etcd
systemctl start docker
systemctl start kube-apiserver
systemctl start kube-controller-manager
systemctl start kube-scheduler
systemctl start kubelet
systemctl start kube-proxy
- 查看相关情况
ps -ef | grep kube
出现以下界面表示Kubernetes安装并且启动成功: