From 0e2e31ae736dacfcf9015b5976e4a5b6e4961116 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Tue, 10 Dec 2024 11:35:11 -0500 Subject: [PATCH] Enable leader election in the operator The operator no longer runs leader-for-life election so enable leader-with-lease via the CLI arg in the pod spec. Signed-off-by: Tom Pantelis --- .../templates/operator-deployment.yaml | 4 ++-- submariner-operator/templates/rbac.yaml | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/submariner-operator/templates/operator-deployment.yaml b/submariner-operator/templates/operator-deployment.yaml index 5f84969c..ff9f0d29 100644 --- a/submariner-operator/templates/operator-deployment.yaml +++ b/submariner-operator/templates/operator-deployment.yaml @@ -27,8 +27,8 @@ spec: name: {{ template "submariner.fullname" . }} spec: containers: - - command: - - submariner-operator + - args: + - --leader-elect env: - name: WATCH_NAMESPACE valueFrom: diff --git a/submariner-operator/templates/rbac.yaml b/submariner-operator/templates/rbac.yaml index 488b1ca3..790fc9c7 100644 --- a/submariner-operator/templates/rbac.yaml +++ b/submariner-operator/templates/rbac.yaml @@ -87,6 +87,17 @@ rules: - servicediscoveries/finalizers verbs: - update + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - delete --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1