hashicorp / terraform-k8s

Terraform Cloud Operator for Kubernetes
https://learn.hashicorp.com/tutorials/terraform/kubernetes-operator?in=terraform/kubernetes
Mozilla Public License 2.0
454 stars 71 forks source link

Multiple instances of an operator in the same namespace will share the same leaderelection ID #139

Open bcbrockway opened 2 years ago

bcbrockway commented 2 years ago

Community Note

terraform-k8s & Kubernetes Version

terraform-k8s: 1.1.0 Kubernetes: 1.21

Expected Behavior

We want to deploy operator instances in a different namespace to the one they manage. This is so that developers who have control over that namespace are able to deploy Workspace CRDs into it but are unable to see/manage the Terraform operator instance.

The leader election ID should be set dynamically and should be unique per instance of the helm chart.

Actual Behavior

The leader election ID is hard-coded so all instances of the operator will share the same ID.

Steps to Reproduce

Deploy 2 instances of the operator into the same namespace that both monitor 2 different namespaces. Only one will be monitoring its namespace (the one that won the election).