minikube也是需要docker环境的,首先看一下docker
下载docker.repo源到本地
通过repo里面查找最新的docker
开始安装docker
修改docker 下载加速地址, systemctl deamon-reload
下载minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
初始化的时候还是卡主了
root@k8s-test ~]# minikube start --driver=docker --force image-mirror=registry.cn-hangzhou.aliyuncs.com/google_containers
* minikube v1.31.2 on Anolis 8.4
! minikube skips various validations when --force is supplied; this may lead to unexpected behavior
* Using the docker driver based on existing profile
* The "docker" driver should not be used with root privileges. If you wish to continue as root, use --force.
* If you are running minikube within a VM, consider using --driver=none:
* https://minikube.sigs.k8s.io/docs/reference/drivers/none/
* Tip: To remove this root owned cluster, run: sudo minikube delete
X The requested memory allocation of 2200MiB does not leave room for system overhead (total system memory: 2798MiB). You may face stability issues.
* Suggestion: Start minikube with less memory allocated: 'minikube start --memory=2200mb'
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Restarting existing docker container for "minikube" ...
* Preparing Kubernetes v1.27.4 on Docker 24.0.4 ...
* Configuring bridge CNI (Container Networking Interface) ...
* Verifying Kubernetes components...
- Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: default-storageclass, storage-provisioner
* kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
[root@k8s-test ~]# minikube kubcetl -- get pods -A
嫌慢的话带阿里的地址
[root@k8s-test ~]# minikube kubectl -- get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5d78c9869d-krtnx 1/1 Running 1 (2m7s ago) 22h
kube-system etcd-minikube 1/1 Running 1 (2m7s ago) 22h
kube-system kube-apiserver-minikube 1/1 Running 1 (2m7s ago) 22h
kube-system kube-controller-manager-minikube 1/1 Running 1 (2m7s ago) 22h
kube-system kube-proxy-rtl58 1/1 Running 1 (2m7s ago) 22h
kube-system kube-scheduler-minikube 1/1 Running 1 (2m7s ago) 22h
kube-system storage-provisioner 1/1 Running 3 (73s ago) 22h
这样就起来了
[root@k8s-test ~]# alias kubectl="minikube kubectl --"
不用每次都minikube了