4

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?

Aaron
  • 3,249
  • 4
  • 35
  • 51

2 Answers2

7

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.

Jay
  • 71
  • 3
2

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.

whites11
  • 12,008
  • 3
  • 36
  • 53
  • From the docs: "This config merely specifies that we are configuration a KIND cluster (kind: Cluster) and that the version of KIND's config we are using is v1alpha4 (apiVersion: kind.x-k8s.io/v1alpha4)" Ok, but that doesn't tell me what these strings mean? How do I know what version supports what syntax? – Aaron Jun 28 '21 at 16:55
  • 1
    Did you check the other link? The go doc page? – whites11 Jun 28 '21 at 18:05
  • is there no longer a Deployment kind in version v1alpha4? I am trying to follow this example https://www.appvia.io/blog/tutorial-deploy-kubernetes-cluster and the deploy manifest shows kind as Deployment which I don't see documented in the go docs. – Aaron Jul 08 '21 at 09:56
  • I get error - no matches for kind "Cluster" in version "kind.x-k8s.io/v1alpha4". Yes its in the go doc, but that's just documentation. There is something amiss here, I suspect some configuration that needs doing, that isn't documented.. – Andy Lorenz Mar 04 '22 at 17:29