首页 > 解决方案 > 为什么我在集群中看不到工作节点?

问题描述

我正在运行一个带有种类的集群 - 一个工作节点。

但是,当我这样做时,我kubectl get nodes看不到节点,而是看到“善良的控制平面”——这对我来说毫无意义,控制平面是一个节点??

工作节点必须正在运行,因为我可以kubectl exec --stdin --tty <name of the pod> /bin/sh看到运行我的应用程序的容器内部。

这是一些奇怪的 WSL2 交互吗?或者我只是做错了什么?

标签: kuberneteskind

解决方案


control-plane is just a name. If you just run kind create cluster, its default is to create a single-node cluster with the name control-plane. From your description, everything is working properly.

One of kind's core features is the ability to run a "multi-node" cluster, but all locally in containers. If you want to test your application's behavior if, for example, you drain its pods from a node, you can run a kind cluster with one control-plane node (running etcd, the API server, and other core Kubernetes processes) and three worker nodes; let the application start up, then kubectl drain worker-1 and watch what happens. The documentation also notes that this is useful if you're developing on Kubernetes itself and need a "multi-node" control plan to test HA support.


推荐阅读