terraform-provider-kops icon indicating copy to clipboard operation
terraform-provider-kops copied to clipboard

Setting "zone" in the subnet spec should not be required

Open ederst opened this issue 2 years ago • 0 comments

After trying out the provider - by converting config of ours to the one required by it - I get the following error:

kops:index/cluster:Cluster resource 'cc-test-eu-ash-15-provider-test-cluster' has a problem: Missing required argument: The argument "subnet.0.zone" is required, but no definition was found.. Examine values at 'Cluster.Subnets[0].Zone'.

However, it is definitely possible to provision clusters with subnets not having any zone set, for example:

apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
spec:
  subnets:
  - cidr: 192.168.0.0/16
    id: some-id
    name: nodes
    type: Private

Then the zoning info can be in the InstanceGroup, for example:

apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
spec:
  subnets:
  - nodes
  zones:
  - Zone1
  - Zone2

I suspect this is due to the provider needing the zone set to something different than None/nothing.

AFAIK kOps code needs either zone set in subnets or zones in the respective InstanceGroups.

Disclaimer:

  • I have not looked that deeper into the issue right now, but I will tomorrow, and provide more input (outtatime right now).
  • I have not used terraform for it, but converted it to a pulumi provider to make it work for our setup (I try to convert from a self-written dynamic pulumi provider which wraps around the kops binary to your provider).

ederst avatar Feb 21 '23 17:02 ederst