英文:
Getting unknown API version when starting kind cluster
问题
尝试在Intel OSX 13.3.1上运行Kind,只是为了更多地了解Kubernetes。
使用Homebrew安装了kubectl和kind。
kubectl版本1.25.4
kind版本0.18.0
Docker Desktop版本4.18.0
我可以使用kind create cluster
命令启动默认集群。
我查看了~/.kube/config
文件,其中有apiVersion: v1
。
我删除了这个集群。
尝试按照以下文件启动多节点集群的示例。该文件通过了yamllint检查。
kind: Cluster
apiVersion: kind.x-k8s.io/v1
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
并使用以下命令:
kind create cluster --config ~/.kube/kind_cluster.yml
但是遇到了以下错误:
ERROR: failed to create cluster: unknown apiVersion: kind.x-k8s.io/v1
有任何想法可能出了什么问题吗?
请注意,我已经尝试了许多基于各种其他“hellowworld”示例和搜索结果的apiVersion值,但没有成功。
英文:
Trying to get kind running on Intel OSX 13.3.1 just to learn more about kubernetes.
Installed kubectl and kind using homebrew.
kubectl version 1.25.4
kind version 0.18.0
Docker Desktop 4.18.0
I can stand up the default cluster with kind create cluster
I looked in the ~/.kube/config file and it has apiVersion: v1
I deleted this cluster
Tried to follow an example to start up a multi-node cluster with this file. The file passed yamllint.
kind: Cluster
apiVersion: kind.x-k8s.io/v1
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
and this command
kind create cluster --config ~/.kube/kind_cluster.yml
And got this error
ERROR: failed to create cluster: unknown apiVersion: kind.x-k8s.io/v1
Any idea what may be wrong?
Note that I have tried numerous apiVersion values based on various other “hellowworld” examples and goggle-fu output with no luck.
答案1
得分: 1
你的 API 版本应该是 kind.x-k8s.io/v1alpha4,根据这里的文档 https://github.com/kubernetes-sigs/kind/blob/329a451909597f481bd3d313d054e9852537e2b9/site/content/docs/user/configuration.md?plain=1#L19-L24
我会复制粘贴以避免链接失效。
一个最小有效的配置是:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
英文:
Your APIVersion should be kind.x-k8s.io/v1alpha4 as per the docs here https://github.com/kubernetes-sigs/kind/blob/329a451909597f481bd3d313d054e9852537e2b9/site/content/docs/user/configuration.md?plain=1#L19-L24
I'll copy paste to avoid link rot though
A minimal valid config is:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论