- 1、 Install Kind and kubctl (安装Kind和kubctl) 参考官网的教程
-
2、 创建指定端口的集群
- 2.1 编辑配置文件 'kind-example-config.yaml'
kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 networking: # WARNING: It is _strongly_ recommended that you keep this the default # (127.0.0.1) for security reasons. However it is possible to change this. apiServerAddress: "0.0.0.0" # By default the API server listens on a random open port. # You may choose a specific port but probably don't need to in most cases. # Using a random port makes it easier to spin up multiple clusters. apiServerPort: 6443 nodes: - role: control-plane extraPortMappings: - containerPort: 30001 hostPort: 30001 listenAddress: "0.0.0.0" protocol: tcp - containerPort: 30002 hostPort: 30002 listenAddress: "0.0.0.0" protocol: tcp - containerPort: 30003 hostPort: 30003 listenAddress: "0.0.0.0" protocol: tcp - containerPort: 30004 hostPort: 30004 listenAddress: "0.0.0.0" protocol: tcp - containerPort: 30005 hostPort: 30005 listenAddress: "0.0.0.0" protocol: tcp
- 2.2 根据配置文件创建集群
kind create cluster --config kind-example-config.yaml --name mycluster
-
3、安装k8s dashboard
- 3.1 下载配置文件
wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
- 3.2 编辑配置文件
- 3.3 根据配置文件执行安装
kubectl apply -f recommended.yaml
- 4、校验dashboard是否拉起
kubectl get deployments -n kubernetes-dashboard
- 5、校验端口是否启用
netstat -tlnp
> 能够看到30001端口在用,就是没毛病的
- 6、访问dashboard地址 https://www.xxx.top/k8s > 能够到达这一步,就说明上面流程都没有问题
Top comments (0)