Closed tcdowney closed 3 years ago
We manually validated this by...
routecontroller
to 2 replicas and observed the logs for each Pod
.Route
resources. The other was not doing work because it did not have the lease. It logged something like: I0322 17:25:50.999788 1 leaderelection.go:243] attempting to acquire leader lease cf-system/cf-k8s-networking-routecontroller...
routecontroller
.
Summary
As part of upgrading Golang and other dependencies in routecontroller we uncovered a bug in how we were configuring LeaderElection. It was enabled on the
routecontroller
in #175193243, but had several issues.The first issue was due to https://github.com/kubernetes-sigs/controller-runtime/issues/445 requiring that
LeaderElectionID
andLeaderElectionNamespace
be explicitly set.We fixed this first issue in https://github.com/cloudfoundry/cf-k8s-networking/commit/a8d9323599bc3d43f3f7a2791d74aeb4f12d1cbb, but leader election is still failing since we don't have the necessary RBAC since it now is trying to use the
leases.coordination.k8s.io
resource.