I'm trying to deploy Fleet server as a deployment on Kubernetes. The server agent enrolls successfully to fleet but the log pod keep flooding with the following error:
E0204 14:39:51.873097 8 leaderelection.go:325] error retrieving resource lock elk-stack/elastic-agent-cluster-leader: leases.coordination.k8s.io "elastic-agent-cluster-leader" is forbidden: User "system:serviceaccount:elk-stack:default" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "elk-stack"
From my understanding, I only need leader election if I deploy Elastic Agent as a daemonset to collect cluster-wide metrics. But here I'm trying to deploy a fleet server instead.
How to disable leader election in fleet server or to get rid of the error log?