使用minikube搭建k8s单节点集群
程序员文章站
2022-03-07 11:13:00
...
在国内不*,通过minikube快速搭建k8s单节点环境。
- 下载kubectl:
# curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
# mv kubectl /usr/local/bin/ && chmod +x /usr/local/bin/kubectl
# kubectl version
- 下载安装minikube:
# curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-1.5.2.rpm && sudo rpm -ivh minikube-1.5.2.rpm
# minikube config set vm-driver none
# minikube start
- 报错:
* Unable to pull images, which may be OK: running cmd: "/bin/bash -c \"sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml\"": command failed: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.16.2:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml"
stdout:
stderr: failed to pull image "k8s.gcr.io/kube-apiserver:v1.16.2": output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
解决报错:
# minikube start --registry-mirror=https://registry.docker-cn.com --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
或
# minikube start --image-mirror-country=cn
两条命令都可以成功创建k8s单节点集群。
- 查看单节点集群信息:
# kubectl cluster-info
Kubernetes master is running at https://192.168.30.128:8443
KubeDNS is running at https://192.168.30.128:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
下一篇: ps简单制作金属环实例教程
推荐阅读
-
使用minikube快速部署k8s集群
-
使用kubeadm搭建k8s集群
-
二、使用kubeadm搭建k8s集群
-
kafka系列一:单节点伪分布式集群搭建
-
Kafka部署及使用(单节点/集群) kafkasinkzookeeperBrokerConsumer
-
Kafka单节点伪分布式集群搭建实现过程详解
-
序【2】zookeeper节点搭建(单节点模式 || docker搭建zookeeper集群 [bridge模式|host模式] )
-
kafka系列一:单节点伪分布式集群搭建
-
k8s学习二:k8s集群搭建——单master多node简易部署
-
『中级篇』Minikube快速搭建K8S单节点环境(61)