Hi there,
banging my head against a wall for a few ours now...
Using elastic-agent 7.16.2(docker image) in k8s and i want to disable certain providers as well as the leader election.
But the agent will always try to read the leader status.
Config status:
bash-4.2$ elastic-agent -c /etc/elastic-agent.yml inspect
agent:
logging:
level: debug
monitoring:
enabled: false
logs: false
metrics: false
reload:
enabled: false
outputs:
default:
hosts:
- elasticsearch.efk:9200
password: REMOVED
type: elasticsearch
username: logagent-radius-felix
path:
config: /usr/share/elastic-agent
data: /usr/share/elastic-agent/data
home: /usr/share/elastic-agent/data/elastic-agent-3c518f
logs: /usr/share/elastic-agent
providers:
agent:
enabled: false
docker:
enabled: false
host:
enabled: false
kubernetes:
enabled: false
kubernetes_leaderelection:
enabled: false
runtime:
arch: amd64
os: linux
osinfo:
family: redhat
major: 7
minor: 9
patch: 2009
type: linux
version: 7 (Core)
Starting the agent:
bash-4.2$ elastic-agent -c /etc/elastic-agent.yml
I0808 14:40:16.686029 105 leaderelection.go:243] attempting to acquire leader lease cust-felix/elastic-agent-cluster-leader...
E0808 14:40:16.698908 105 leaderelection.go:325] error retrieving resource lock cust-felix/elastic-agent-cluster-leader: leases.coordination.k8s.io "elastic-agent-cluster-leader" is forbidden: User "system:serviceaccount:cust-felix:default" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "cust-felix"
elastic-agent.yml:
bash-4.2$ cat /etc/elastic-agent.yml
outputs:
default:
type: elasticsearch
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
username: '${ELASTICSEARCH_USERNAME}'
password: '${ELASTICSEARCH_PASSWORD}'
providers:
host:
enabled: false
agent:
enabled: false
docker:
enabled: false
kubernetes:
enabled: false
kubernetes_leaderelection:
enabled: false
agent:
monitoring:
enabled: false
logs: false
metrics: false
reload:
enabled: false
logging:
level: debug
I've also tried to adjust the leader name but it will not be read...
With version 8.3.3 it's working but we have to go with 7.16.2 for now