minikube还是选用国内阿里社区提供的方法比较简单,具体链接如下:
https://developer.aliyun.com/article/221687
- 安装kubectl
可以现在本地下载好安装文件,远程拷贝到服务器
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- 安装minikube
curl -Lo minikube https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.13.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
3.启动minikube
minikube start --driver=none # --driver=docker/kvm2 比较复杂
报错及解决
- minikube start 报错
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
解决方案
echo "1" >/proc/sys/net/bridge/bridge-nf-call-iptables
- https://IP:8443 访问报错
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
"reason": "Forbidden",
"details": {
},
"code": 403
}
解决方案
kubectl create clusterrolebinding test:anonymous --clusterrole=cluster-admin --user=system:anonymous
网友评论