【3】minikube离线版安装
目录
【1】minikube初体验
【2】minikube部署Traefik
【3】minikube离线版安装
介绍
前面两篇已经介绍了 minikube
及 Traefik
的安装使用过程,如果遇到离线环境或者仍然存在问题,请下载整理好的离线安装包。
注意:仅支持Centos/Redhat7.x版本系统! 链接:https://pan.baidu.com/s/1ODxYp-gSBg_Ty2VSd2EDyw
如若离线安装仍存在问题,可联系博主在线处理。
安装步骤
主机初始化
1.关闭selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
2.关闭防火墙
systemctl disable firewalld
3.校对时间
yum install -y ntpdate ; ntpdate -s ntp1.aliyun.com
4.修改主机名并申明
hostnamectl set-hostname --static minikube
echo "192.168.199.200 minikube" >> /etc/hosts
安装docker
将百度云盘下载的包上传到服务器,并解压。
tar xf minikube-kubernetes-v.1.23.3.tar.gz
cd minikube-kubernetes-v.1.23.3/docker/
sh install.sh
systemctl enable --now docker
docker version
安装minikube
cd minikube-kubernetes-v.1.23.3/
yum localinstall conntrack/*.rpm -y
tar xf minikube-kube.tgz -C /
cp bin/* /usr/local/bin/
/usr/bin/ls images/* | xargs -i docker load -i {}
初始化minikube
minikube start --driver=none --kubernetes-version=v1.23.3 --image-mirror-country='cn' --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'
...
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
设置kubectl自动补全
kubectl completion bash >> /etc/bash_completion.d/kubectl
source /etc/bash_completion.d/kubectl
kubectl get po -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-65c54cc984-wtxnb 1/1 Running 0 2m6s
kube-system etcd-minikube 1/1 Running 0 2m21s
kube-system kube-apiserver-minikube 1/1 Running 0 2m19s
kube-system kube-controller-manager-minikube 1/1 Running 0 2m19s
kube-system kube-proxy-dhsf6 1/1 Running 0 2m6s
kube-system kube-scheduler-minikube 1/1 Running 0 2m19s
kube-system storage-provisioner 1/1 Running 1 (95s ago) 2m18s
安装Traefik
kubectl apply -f traefik/route-traefik/
kubectl get po
NAME READY STATUS RESTARTS AGE
traefik-d8v5q 1/1 Running 0 12s