Ubuntu16.04安装K8s步骤
系统:Ubuntu16.04系统配置修改1.禁用swapswapoff -a同时把/etc/fstab包含swap那行记录删掉。2.关闭防火墙systemctl stop firewalldsystemctl disable firewalld3.禁用Selinuxapt install selinux-utilssetenforce 04.安装dock...
系统:Ubuntu16.04
系统配置修改
1.禁用swap
swapoff -a
同时把/etc/fstab包含swap那行记录删掉。
2.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
3.禁用Selinux
apt install selinux-utils
setenforce 0
1)先安装相关工具
apt-get update && apt-get install -y apt-transport-https curl
2)添加密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
3)安docker
apt-get install docker.io -y
4)查版本
docker version
5)启动docker service
systemctl enable docker
systemctl start docker
systemctl status docker
6)使用阿里云加速器
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"],
"live-restore": true
}
7)重起docker服务
systemctl daemon-reload
systemctl restart docker
1)添加秘钥
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
2)添加Kubernetes软件源
$ cat /etc/apt/sources.list
系统安装源
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
# kubeadm及kubernetes组件安装源
deb https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial main
deb http://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main
3)安装
# apt-get update && apt-get install -y kubelet kubeadm kubectl
# systemctl enable kubelet
或者
apt-get install -y kubelet kubeadm kubectl --allow-unauthenticated
更多推荐
所有评论(0)