Why is this kind configuration file broken and where do I get kind versions

Viewed 2256

I am trying to follow this tutorial to learn to use kind. The version I just installed using brew install is: kind version 0.11.1

The config file looks like this:

kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
  extraPortMappings:
  - containerPort: 30080
    hostPort: 80
    listenAddress: "0.0.0.0"
    protocol: TCP

Apparently that version is wrong because I get an error ERROR: failed to create cluster: unknown apiVersion: kind.sigs.k8s.io/v1alpha3 when I try to create the cluster: $ kind create cluster --name mycluster --config config/kind.config.yaml --wait 5m.

I found an example of some other version string, but when trying to add the spec block in that same tutorial I get a configuration error. I assume this means because the API broke between the version and the yaml I am using.

Why do I get the original "failed to create cluster" error, and where can I find documentation associating kind versions with yaml syntax?

2 Answers

The version needs to be set to apiVersion: kind.x-k8s.io/v1alpha4

Notice the change from kind.sigs.k8s.io to kind.x-k8s.io in addition to changing to v1alpha4.

I think you are using either a too old or too new kind CLI version and that is causing the problem you are witnessing.

I suggest upgrading to the latest kind CLI version to ensure your kind CLI binary is using the latest Config YAML apiVersion (v1alpha4 at the time of writing).

The configuration system is described here and the specifics of the Cluster type are described in the go struct documentation.

Related