安装minikube
最后发布时间 : 2024-02-27 14:45:59
浏览量 :
minikube搭建
https://minikube.sigs.k8s.io/docs/start/
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
sudo usermod -aG docker $USER && newgrp docker
# 启动集群
minikube start
# 查看节点。kubectl 是一个用来跟 K8S 集群进行交互的命令行工具
kubectl get node
# 停止集群
minikube stop
# 清空集群
minikube delete --all
# 安装集群可视化 Web UI 控制台
minikube dashboard
minikube delete
minikube start --listen-address=0.0.0.0 --apiserver-ips=192.168.10.30
vim ~/.kube/config
apiVersion: v1
clusters:
- cluster:
certificate-authority: /home/wy/.minikube/ca.crt
extensions:
- extension:
last-update: Sun, 24 Dec 2023 22:00:07 CST
provider: minikube.sigs.k8s.io
version: v1.32.0
name: cluster_info
server: https://192.168.0.178:32774
name: minikube
contexts:
- context:
cluster: minikube
extensions:
- extension:
last-update: Sun, 24 Dec 2023 22:00:07 CST
provider: minikube.sigs.k8s.io
version: v1.32.0
name: context_info
namespace: default
user: minikube
name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
user:
client-certificate: /home/wy/.minikube/profiles/minikube/client.crt
client-key: /home/wy/.minikube/profiles/minikube/client.key
sudo rm -rf /etc/containerd/config.toml
Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Alternatively, if you are the root user, you can run:
export KUBECONFIG=/etc/kubernetes/admin.conf
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join 10.110.1.11:6443 --token ho5t8z.xx \
--discovery-token-ca-cert-hash sha256:xxx