配置和启动Kubernetes服务
- 安装etcd服务
- 下载安装包
wget https://github.com/coreos/etcd/releases/download/v3.1.3/etcd-v3.1.3-linux-amd64.tar.gz
解压后将可执行文件复制到/urs/bin目录
tar xzvf etcd-v3.1.3-linux-amd64.tar.gz cd etcd-v3.1.3-linux-amd64 && cp etcd* /usr/bin/
配置开机启动etcd.service
vi /usr/lib/systemd/system/etcd.service
[Unit] Description=Etcd Server After=network.target [Service] Type=simple WorkingDirectory=/var/lib/etcd/ EnvironmentFile=-/etc/etcd/etcd.conf # set GOMAXPROCS to number of processors ExecStart=/usr/bin/etcd [Install] WantedBy=multi-user.target
-
创建工作目录
mkdir /var/lib/etcd
- 启动并加入开机列表
systemctl daemon-reload systemctl enable etcd.service systemctl start etcd.service
- kube-apiserver服务