-
Notifications
You must be signed in to change notification settings - Fork 42
Remove dependency on Fleet Default policy #2039
Comments
@mdelapenya @adam-stokes hello, could someone confirm that e2e tests are not relying on the default agent policies in Fleet?
|
I'm looking at the code and will post here my findings, but my initial thoughts are with you: we are creating a policy before each test scenario so that it's the one used by the agent for any operation. I'd say it's OK to merge that PR, and if it breaks the e2e, let's cooperate in the fix 😃 |
This seems an error in the kibana build, which I'm not familiar with. We created #2086 to address the changes in the requirements to run kibana in the e2e tests, which does not need ARM. Is this your use case? |
@mdelapenya no, I don't need ARM specifically |
Thanks @juliaElastic for your explanation here. Now that #2064 is merged, the I'll create a PR to pre-configure the policy with: xpack.fleet.packages:
- name: fleet_server-1
version: latest
xpack.fleet.agentPolicies:
- name: Fleet Server policy
id: fleet-server-policy
description: Fleet server policy
namespace: default
package_policies:
- name: Fleet Server
package:
name: fleet_server-1 Thanks! |
After adding that, I'm receiving this error while setting up Fleet:
|
@mdelapenya oh sorry, the example was not correct,
|
After updating to that value, the error happens on Kibana side:
I'm currently testing with package name = |
@mdelapenya please try with |
Yes, now the initialisation of Kibana works with: xpack.fleet.packages:
- name: fleet_server
version: latest
xpack.fleet.agentPolicies:
- name: Test preconfigured policy
id: "test-preconfigured"
data_output_id: output-123
monitoring_output_id: output-123
monitoring_enabled: ["logs", "metrics"]
package_policies:
- package:
name: system
name: sytem-1
- name: Fleet Server policy
id: fleet-server-policy
description: Fleet server policy
namespace: default
package_policies:
- name: Fleet Server
package:
name: fleet_server But the Fleet Server setup fails:
|
@mdelapenya it doesn't mean the setup failed, only that there is no fleet server connected. Can you try enrolling a fleet server? |
The code automatically adds the fleet-server passing the Policy ID on server's startup. These are the server logs:
It seems the policy does not have the input:
|
@mdelapenya which version of kibana are you using? we fixed a bug like this recently: elastic/kibana#124363 |
In our local tests, we are using |
Proposal
Fleet is making a change to remove Default policies from setup, in order to make policy creation with integrations explicit: elastic/kibana#108456
Some of the e2e tests seem to rely on default policies:
e2e-testing/internal/kibana/policies.go
Line 34 in 2b5f31e
The request is to change this logic to create required policies first through the API or preconfiguration.
EDIT:
GetDefaultPolicy
function does not seem to be used, and there was an issue some time back to remove the reference on default policy: #281So it might not be needed to change anything, the request is to confirm that nothing breaks.
Here is an example on creating a policy with API:
Alternatively the policy can be added to
kibana.yml
config as preconfiguration:Example preconfig for Fleet Server policy:
And use it in docker command or elastic-agent install command to enroll Fleet Server:
-e FLEET_SERVER_POLICY_ID=fleet-server-policy
--fleet-server-policy=fleet-server-policy
The text was updated successfully, but these errors were encountered: