minikube 的 kubernetes 入门教程-kubeSphere
KubeSphere 是在 Kubernetes 之上构建的以应用为中心的多租户容器平台,提供全栈的 IT 自动化运维的能力,简化企业的 DevOps 工作流。
KubeSphere 提供了运维友好的向导式操作界面,帮助企业快速构建一个强大和功能丰富的容器云平台。
一、安装之前准备
andy@ThinkPad:~$ kubectl get pod,svc -n kube-system
NAME READY STATUS RESTARTS AGE
pod/coredns-5dd5756b68-zqvmp 1/1 Running 12 (10h ago) 27d
pod/etcd-minikube 1/1 Running 12 (10h ago) 27d
pod/kube-apiserver-minikube 1/1 Running 12 (10h ago) 27d
pod/kube-controller-manager-minikube 1/1 Running 12 (10h ago) 27d
pod/kube-proxy-lnnd8 1/1 Running 12 (10h ago) 27d
pod/kube-scheduler-minikube 1/1 Running 12 (10h ago) 27d
pod/metrics-server-7c66d45ddc-6dm2z 1/1 Running 7 (10h ago) 25h
pod/storage-provisioner 1/1 Running 25 (46s ago) 27dNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 27d
service/metrics-server ClusterIP 10.100.208.149 <none> 443/TCP 25handy@ThinkPad:~$ kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
standard (default) k8s.io/minikube-hostpath Delete Immediate false 27dandy@ThinkPad:~$ free -htotal used free shared buff/cache available
Mem: 15Gi 3.2Gi 9.0Gi 186Mi 3.9Gi 12Gi
Swap: 0B 0B 0Bandy@ThinkPad:~$ kubectl top pods -n kube-system
NAME CPU(cores) MEMORY(bytes)
coredns-5dd5756b68-zqvmp 3m 53Mi
etcd-minikube 27m 269Mi
kube-apiserver-minikube 73m 308Mi
kube-controller-manager-minikube 24m 118Mi
kube-proxy-lnnd8 1m 61Mi
kube-scheduler-minikube 4m 60Mi
metrics-server-7c66d45ddc-6dm2z 5m 52Mi
storage-provisioner 3m 10Mi
二、安装KubeSphere
$ kubectl create namespace kubesphere-system$ helm install kubesphere kubesphere/ks-installer --namespace kubesphere-system -f values.yaml
NAME: kubesphere
LAST DEPLOYED: Thu Oct 2 21:04:13 2025
NAMESPACE: kubesphere-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:export NODE_PORT=$(kubectl get --namespace kubesphere-system -o jsonpath="{.spec.ports[0].nodePort}" services ks-console)export NODE_IP=$(kubectl get nodes --namespace kubesphere-system-o jsonpath="{.items[0].status.addresses[0].address}")echo http://$NODE_IP:$NODE_PORT$ kubectl get pods -n kubesphere-system -w
kubesphere/ks-installer:v3.2.1 镜像不存在或已被移除(KubeSphere v3.2.1 是旧版,社区已转向 v3.4.x)。此外,KubeSphere 官方 Docker Hub 镜像源已下架(项目闭源影响),导致拉取失败。
解决方案:更换国内资源,包括:
- Docker Hub 镜像加速器:加速从 Docker Hub 拉取镜像。
- KubeSphere 镜像仓库替换:使用阿里云等国内镜像源替换官方镜像(registry.cn-beijing.aliyuncs.com/kubesphereio/)。
- Helm 仓库:官方 Helm repo 已不可靠,可切换到阿里云镜像或手动下载。