# Kubernetes API permission error log of Fleet server pod

**URL:** <https://discuss.elastic.co/t/kubernetes-api-permission-error-log-of-fleet-server-pod/296261>\
**Category:** Elastic Observability\
**Tags:** fleet\
**Created:** [February 4, 2022, 7:44am UTC](https://discuss.elastic.co/t/kubernetes-api-permission-error-log-of-fleet-server-pod/296261 "2022-02-04T07:44:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![duclm2609](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@duclm2609](https://discuss.elastic.co/u/duclm2609)\
**Post date:** [February 4, 2022, 7:44am UTC](https://discuss.elastic.co/t/kubernetes-api-permission-error-log-of-fleet-server-pod/296261/1 "2022-02-04T07:44:54Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Alchemy86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alchemy86/32/109762_2.png) [@Alchemy86](https://discuss.elastic.co/u/Alchemy86)\
**Post date:** [August 17, 2022, 9:10am UTC](https://discuss.elastic.co/t/kubernetes-api-permission-error-log-of-fleet-server-pod/296261/2 "2022-08-17T09:10:10Z")

</div>

Hi, We are having the exact same issue. Dont suppose you know / remember if and how this was resolved? Thanks!

---

<div class="post-metadata">

**Author:** ![Alchemy86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alchemy86/32/109762_2.png) [@Alchemy86](https://discuss.elastic.co/u/Alchemy86)\
**Post date:** [August 17, 2022, 9:40am UTC](https://discuss.elastic.co/t/kubernetes-api-permission-error-log-of-fleet-server-pod/296261/3 "2022-08-17T09:40:22Z")

</div>

Resolved:

> <https://stackoverflow.com/questions/73385850/fleet-server-in-elastic-error-elastic-agent-cluster-leader-is-forbidden/73386150#73386150>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:34am UTC](https://discuss.elastic.co/t/kubernetes-api-permission-error-log-of-fleet-server-pod/296261/4 "2022-11-04T08:34:05Z")

</div>


