Ubuntu上使用microk8s注意问题
1、MicroK8s 安装
简洁的 MicroK8s 安装:
sudo snap install microk8s --classic
https://kubernetes.io/zh/blog/2019/11/26/使用-microk8s-在-linux-上本地运行-kubernetes/
2、安装过程中存在的问题
镜像问题:众所周知,k8s.gcr.io被墙了,所以需要先将镜像下载下来
!/bin/sh
images=(
pause:3.1
)
for imageName in ${images[@]} ; do
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/${imageName}
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName k8s.gcr.io/${imageName}
docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/${imageName}
docker save k8s.gcr.io/${imageName} > ${imageName}.tar
microk8s.ctr image import ${imageName}.tar
done
3、之后重启microk8s服务,kubernetes服务正常运行
microk8s stop
microk8s start
Roosevelt