-
Notifications
You must be signed in to change notification settings - Fork 42
[Fleet] Infra work / new test creation, for coming Fleet Server component #438
Comments
Discussion notes from meeting on setting up Fleet Server: general steps: step 1) Agent needs to be running as a daemon step 2) install (or enroll) command, pass in option --fleet_server with url + uid/pwd
then the running daemon is told to reexec (on linux and mac it injects into the same pid) - and it reads the yml and brings up the fleet-server subprocess if Kibana is not running, Fleet-server will wait, polling ES for the policy it should be on and confirming the index exists. wait for 2 mins, then times out. Fleet server will then allow enrollment to begin waits for 'degraded' state, then it enrolls (locally). rewrites fleet.yml - then the bootstrap flag is not included (set to false). and reexecs again (2nd time). must include the Fleet Server integration in Kibana policy, get that policy id from the enroll command on Kibana side, just a feature flag setup. not merged yet, but coming soon. :)
e2e-test steps / questions:
|
FYI - the basic process above should be discussed in: https://github.com/elastic/fleet-server/blob/master/README.md the {fleet-server-policy-id} will be generated by default when Kibana starts up with Fleet in 7.13 and beyond. so it's name / id can be queried like any other policy id. |
Is |
no, it is the URL/port of the Fleet Server process running on the edge (Agent). Any Agent CAN run a fleet server process, but only 1 is required. the journey of reading can continue if you want to dig into more architecture docs (which may be out of date) - https://github.com/elastic/obs-dc-team/issues/389 I'd like to pull in @blakerouse for expertise confirming what literal options we need to set up here. @nchaulet is the Engineer contributing on the Kibana transition side. Nicolas, it would help us to know which specific APIs are being moved out of Kibana to Fleet Server and what the new routes are. I don't know if we have that doc'ed already. |
@mdelapenya I don't see a |
@EricDavisX we will remove the agent endpoints (enroll, checkin and acks also the endpoint artifacts too) these endpoints will be move to fleet server. |
No, I meant the value of that flag: |
During the move, it would be great if we all contribute the changes to the e2e before the PRs are merged in upstream repos (Kibana/Beats) so that we do not chase the changes after they are pushed. I offer myself to guide through the code so that we can cooperate to achieve it |
I'm getting progress with this scenario (see #900), but I'd like to add more consistent verifications and use cases. @EricDavisX I'd appreciate your help here with the definition of the scenarios/steps. @blakerouse I'd like to know more about this scenario I want to add: @start-fleet-server
Scenario Outline: Deploying the <os> fleet-server agent
Given a "<os>" agent is deployed to Fleet with "tar" installer in fleet-server mode
When an "<os>" agent is deployed to Fleet with "tar" installer using the fleet-server
Then the agent is listed in Fleet as "online" How the second agent communicates to the first one? How does it discover the server (name and port)? |
@mdelapenya You have to give the the second agent the IP/hostname of the first agent for it to communicate. |
I need to learn more before I can help outline scenarios, if we want to make progress sooner we can get Blake's input. |
Any port needed? |
@mdelapenya by default the port for fleet server will be |
@nchaulet what is the api endpoint & params/body to use to make that call to set up the Fleet Server in Kibana? |
As noted prior in #900 we are discussing Fleet Server set up, let us try to keep the tech details just in one place to help solve the confusion / make-it-work. I am making notes, and have not seen it work yet, but I'm close and I know others have. Docker usage has been confirmed. Using a standard Agent (.zip, .tar.gz, etc) has not been yet. Things to NOTE that we need:
Note, I think the param 'fleet-server' is possibly mis-named. What the value for it is, however, is the connection to Elastic Search, which the Fleet server process needs (to pass down in policy to the other Agents). The other Agents connect to the Fleet-Server with the Kibana side setting for 'Fleet Server' in the settings 'gear' icon in the UI, the same location where we are currently setting the Kibana / ES connection urls. This is where port 8220 is used. Indeed the only thing running on 9200 is the Elasticsearch. for Docker usage, this is what I see as the most up to date info in the Fleet Server repo: For non-Docker usage, the call will be something more 'normal' looking like it does when you enroll an Agent currently. I will post back to this thread when I have confirmed what works. I think I'm close. Update: TBD |
You should NOT use the The |
As I mentioned in the implementation PR (see #900 (comment))
When I want to bootstrap the fleet server in a host
Then I run the FOO command with FLAGS and VALUES
Given a fleet-server already bootstrapped
When I enroll a second agent in Fleet using the fleet-server
Then the agent is "online" in Fleet |
How do we do that programmatically?
Do we need both? |
@jalvz You do not need 3 if you are enrolled the Agent with Fleet Server into the Default Fleet Server policy. You only need 2, the enrollment token needs to be to the Default Fleet Server policy. |
I posted a note in the other issue, hopefully providing canonical install steps. |
I think we can close this, as #1078 was merged. Please reopen if needed Thanks! |
I added the above issue as a continuation of overall support we need / intend: this was acceptably closed out as initial support and usage, but we never reviewed and determined test depth / coverage desires at full depth. |
will add more notes as it is clearer... main tracking issue: integrations-dev/issues/389
What we know now:
... An Agent running as Fleet Server will or will not be still a regular 'Agent' as well?
The text was updated successfully, but these errors were encountered: