0%

使用minikube部署k8s

前置条件

docker(略)

拉取镜像

需要科学上网

如果不能科学上网,可以在https://hub.docker.com拉取镜像然后打tag

1
2
docker pull yaokun/kube-apiserver-amd64:v1.16.4
docker tag yaokun/kube-apiserver-amd64:v1.16.4 k8s.gcr.io/kube-apiserver-amd64:v1.16.4

conntrack-tools

1
yum install conntrack-tools -y

Docker配置HTTP代理

修改都从docker配置

1
vi /usr/lib/systemd/system/docker.service

添加以下配置

1
2
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:10809"

重启docker

1
2
systemctl daemon-reload
systemctl restart docker

验证配置

1
systemctl show --property=Environment docker

下载minikube

1
2
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

启动集群

1
minikube start --vm-driver=none

安装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
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
-------------    本文结束  感谢您的阅读    -------------