- A+
所属分类:K8S
需要先将hostname添加到/etc/hosts
1.安装docker~
1 2 3 4 5 6 7 8 9 10 11 |
yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo yum-config-manager --enable docker-ce-nightly yum install docker-ce docker-ce-cli containerd.io systemctl start docker systemctl enable docker |
2.开启镜像加速,并且设置docker driver为systemd
1 2 3 4 5 6 7 8 9 10 |
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "exec-opts": ["native.cgroupdriver=systemd"], "registry-mirrors": ["https://npluwflg.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker |
3.修改内核参数,不然安装报错
1 2 3 4 5 6 |
vim /etc/sysctl.conf #新增 net.bridge.bridge-nf-call-iptables = 1 net.bridge.bridge-nf-call-ip6tables = 1 ##然后执行 sysctl -p |
4.安装minikube
1 2 3 4 5 |
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \ && chmod +x minikube sudo mkdir -p /usr/local/bin/ sudo install minikube /usr/local/bin/ |
5.启动kubernetes集群
1 2 |
minikube start --registry-mirror=https://registry.docker-cn.com --kubernetes-version v1.17.0 --driver=none --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers' |
等。。。。
5.安装kubectl
1 |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl |
测试
1 2 3 4 |
[root@host-172-16-56-107 ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION host-172-16-56-107 Ready master 31m v1.17.0 |
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫