ubutu搭建k8s环境master节点

配置下载源仅供参考

 cat sources.list |grep -v '#'

deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial main restricted
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial main restricted

deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates main restricted

deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial universe
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates universe

deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial multiverse
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial multiverse
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates multiverse
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates multiverse

deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse


deb http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security main restricted
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security main restricted
deb http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security universe
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security universe
deb https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial main
apt-get install docker.io`
docker -v

安装kubeadm,kubelet,kubectl三个模块
kubeadm : 用来初始化集群的指令

kubelet : 在集群中的每个节点上用来启动 pod 和 container 等

kubectl: 用来与集群通信的命令行工具

apt-get update && apt-get install -y apt-transport-https curl
apt-get install -y kubelet kubeadm kubectl --allow-unauthenticated


设置开机自启动

sudo systemctl enable kubelet && sudo systemctl start kubelet
#重置kubeadm
root@iZ2zeitsosbk244anybs5yZ:/etc/apt# kubeadm reset
 kubeadm init --apiserver-advertise-address=172.17.0.1  --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.22.2  --service-cidr=10.1.0.0/16  --pod-network-cidr=10.244.0.0/16

—CgroupDriver变量表示使用哪个Cgroup驱动,有两种驱动,分别是cgroupfs和systemd,默认使用cgroupfs

docker info |grep -i cgroup
Cgroup Driver: cgroupfs
cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf`
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --cgroup-driver=cgroupfs"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值