minikube 单机搭建k8s环境
准备
- docker
- centos7的虚拟机。系统
- bukectl
遇到的问题
问题一 docker cgroupfs
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/
解决办法:
echo “1” >/proc/sys/net/bridge/bridge-nf-call-iptables
问题二 docker cgroupfs recommenden is “systemd”
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/
解决办法
- vim /etc/docker/daemon.json
- 在文件中添加 “exec-opts”: [“native.cgroupdriver=systemd”],重启docker
问题二 swap
running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `—ignore-preflight-errors=…
解决办法:
swapoff -a
参考资料
安装和设置kubectl(官方)
Minikube - Kubernetes本地实验环境
minikube 安装过程附带报错解决办法
单核小鸡上的Minikube实践
单机部署minikube