Open apgapg opened 1 year ago
I had similar issue /api/fleet/enrollment_api_keys, status is 400
than found in kibana logs that xpack.fleet.agentPolicies were not created
example in kibana (as you use elastic/eck-stack you can override whole spec for Kibana resource https://github.com/elastic/cloud-on-k8s/blob/main/deploy/eck-stack/charts/eck-kibana/templates/kibana.yaml#L15 )
xpack.fleet.agentPolicies:
- name: Fleet Server on ECK policy
id: eck-fleet-server
...
- name: Elastic Agent on ECK policy
id: eck-agent
...
in agent fleet server
policyID: eck-agent
resolved an issue and generate token for fleet server
@pebrc maybe yoy can help here?
as after elasticsearch version upgrade Fleet server stop working
I try delete agents/integrations/policies/tokens https://url-kibana.com/app/fleet/policies https://url-kibana.com/app/fleet/enrollment-tokens
but now when I up fleet server it returns
Reconciliation error: failed to request https://elastic-search-kb-http.elasticsearch.svc:5601/api/fleet/enrollment_api_keys, status is 400)
if check https://url-kibana.com/app/fleet/enrollment-tokens there is no any tokens
in kibana logs
[2023-10-26T11:40:10.674+00:00][INFO ][plugins.fleet] Beginning fleet setup
[2023-10-26T11:40:11.065+00:00][INFO ][plugins.fleet] Fleet setup completed
[2023-10-26T11:40:12.101+00:00][INFO ][plugins.fleet] Fleet Usage: {"agents_enabled":true,"agents":{"total_enrolled":0,"healthy":0,"unhealthy":0,"offline":0,"inactive":0,"unenrolled":390,"total_all_statuses":390,"updating":0},"fleet_server":{"total_all_statuses":0,"total_enrolled":0,"healthy":0,"unhealthy":0,"offline":0,"updating":0,"num_host_urls":0}}
[2023-10-26T11:42:59.324+00:00][ERROR][plugins.fleet] Agent policy "fleet-server-policy" not found
but CRD resources created
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
...
mode: fleet
fleetServerEnabled: true
policyID: fleet-server-policy
---
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
...
mode: fleet
policyID: agent-policy
@apgapg As noted, agentPolicies
needs to be configured in Kibana for this to function properly
Check our default fleet example, and our eck-stack example.
@azhurbilo can we get a full set of manifests such that we can easily replicate your setup (pre-upgrade, and post-upgrade preferably) and try and understand the issue? Thanks.
Bug Report
I tried deploying ECK stack by using following steps:
helm repo add elastic https://helm.elastic.co && helm repo update
helm upgrade --install elastic-operator elastic/eck-operator -n elastic-system --create-namespace
. this deployed eck operator successfullyhelm upgrade --install eck-stack elastic/eck-stack -n elastic-stack --create-namespace --values ./values.yml
Here's the values.yml
I needed to change elasticsearchRefs and kibana ref as default were not establishing.
After above, elastic search and kibana pods are successfullt deployed, but i cant see the Fleet server pod.
I can see the fleet agent but no pod.
Here's the agent info
When i look back into ECK operator POD logs
I can see the following error:
failed to request https://eck-stack-eck-kibana-kb-http.elastic-stack.svc:5601/api/fleet/enrollment_api_keys, status is 400)
Not able to find what is the actual cause.
What did you expect to see?
A fleet server POD running.
What did you see instead? Under which circumstances?
No fleet server pod
Environment
ECK version:
Latest version as on https://artifacthub.io/packages/helm/elastic/eck-stack
Kubernetes information:
insert any information about your Kubernetes environment that could help us:
for each of them please give us the version you are using
v1.25.6