注意 安装后占用本机资源较少,适合学习测试使用,不建议用于生产
前提条件
- 安装 docker
- 安装 kubectl 安装指南
方式一 minikube
minikube 安装指南
启动
minikube start
复制代码
集群中安装 ingress:
minikube addons enable ingress
复制代码
方式二 kind (Kubernets in docker)
kind 安装指南
Then spins up a kind cluster:
cat <<EOF | kind create cluster --image=kindest/node:v1.18.15 --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
复制代码
安装 ingress:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
复制代码
安装结果
我使用mac系统,使用方式二 通过kind安装
检查安装k8s健康状态
kubectl get cs
复制代码
查看结果
NAME STATUS MESSAGE ERROR
scheduler Unhealthy Get http://127.0.0.1:10251/healthz: dial tcp 127.0.0.1:10251: connect: connection refused
controller-manager Unhealthy Get http://127.0.0.1:10252/healthz: dial tcp 127.0.0.1:10252: connect: connection refused
etcd-0 Healthy {"health":"true"}
复制代码
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END