streamnative / terraform-provider-streamnative

Terraform Provider for StreamNative
Other
1 stars 0 forks source link

Location needs to be a required parameter #61

Open mitch-hamm opened 1 month ago

mitch-hamm commented 1 month ago

Currently location is marked as optional but omitting it from a BYOC deployment will cause the pods to be unable to schedule

maxsxu commented 1 month ago

@mitch-hamm Can you discuss with @fantapsody first and he has some thoughts about this issue. /cc @sxie5000

fantapsody commented 1 month ago

This is likely a bug in the control plane for zonal pulsar cluster. The location should be ignorable when poolMemberRef is specified on the PulsarCluster. The problem is, in the control plane implementation, there is an optimization to set node affinity on cluster pods to explicitly run pods in a specific zone for zonal clusters if the location on the pulsar cluster is specified in the zone format like us-west-2a: https://github.com/streamnative/cloud-api-server/blob/18f9e43936da8759f452aaf5cb7fa98b1e773da7/internal/container/affinity.go#L53

image

And there is a bug in the IsZone() check that an empty string will also be treated as a zonal location and the node selector will be set improperly.

I think we should fix this check in the control plane. On the other hand, there're a few problems in the zonal cluster implementation and we don't allow customers to create zonal clusters on the cloud console for now, should we disable zonal cluster support in the terraform for now as well?