mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-10 06:24:09 +09:00
The operator Deployment ships a single replica but always passes --leader-elect to the manager. On one replica leader election adds no HA value: a transient apiserver/etcd lease-renewal blip makes controller-runtime self-terminate (os.Exit on "leader election lost"), which crashloops the manager and surfaces at install time as a Deployment stuck in Failed. Gate --leader-elect on the replica count via a manager.replicaCount value (default 1). The single-replica install now rides out control-plane latency instead of crashlooping, and scaling to more than one replica re-enables leader election automatically for genuine HA. Also set the Deployment strategy to Recreate on a single replica: with leader election off, a default RollingUpdate would briefly run two managers (maxSurge) during an operator upgrade, both reconciling without lease coordination. Recreate closes that window at zero availability cost, while installs scaled past one replica keep RollingUpdate. The change to the vendored opensearch-operator 2.8.0 chart is carried in patches/leaderElection.diff and re-applied by 'make update' so it survives a chart refresh. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
15 lines
682 B
YAML
15 lines
682 B
YAML
opensearch-operator:
|
|
manager:
|
|
# Number of operator replicas. Leader election is enabled automatically only
|
|
# when this is greater than 1. On a single replica leader election adds no HA
|
|
# value but lets a transient apiserver/etcd lease-renewal blip self-terminate
|
|
# the manager (controller-runtime exits on "leader election lost"), which
|
|
# surfaces at install time as a crashlooping, Failed Deployment.
|
|
replicaCount: 1
|
|
# Enable cluster-wide mode to watch all namespaces
|
|
watchNamespace: ""
|
|
kubeRbacProxy:
|
|
image:
|
|
# gcr.io/kubebuilder/kube-rbac-proxy was sunset; use the original upstream
|
|
repository: "quay.io/brancz/kube-rbac-proxy"
|