Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to cover the container flow. #1075

Closed
merlixelastic opened this issue May 16, 2024 · 14 comments
Closed

Add documentation to cover the container flow. #1075

merlixelastic opened this issue May 16, 2024 · 14 comments
Assignees
Labels
request Team:Docs Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@merlixelastic
Copy link

merlixelastic commented May 16, 2024

Description

We discovered a scenario where deploying Elastic agent with Fleet server integration need to have certificate to connect to Kibana.
This is setup apparently with variable KIBANA_CA or KIBANA_FLEET_CA.
I believe the code (reference in resources below) is related to the installation of Elastic agent with Fleet server on Kubernetes or docker.

Resources

The code related to this is here

I'm not seeing mention of setting up certificate between Elastic agent to Kibana in our documentation here and there.

This was discovered when we investigated error:
Kibana fetch policy failed: http GET request to https://kibana-multi:5601/api/fleet/agent_policies fails: fail to execute the HTTP GET request: Get "https://kibana-multi:5601/api/fleet/agent_policies": x509: certificate signed by unknown authority.

Collaboration

TBD. The docs and product team will work together to determine the best path forward.

Point of contact.

Main contact: @merlixelastic

Stakeholders: @lucabelluccini

@lucabelluccini
Copy link
Contributor

This item has been discussed on 3rd June with Julien & Pierre

@lucabelluccini
Copy link
Contributor

lucabelluccini commented Jun 10, 2024

Notable points:

@ycombinator ycombinator added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Jun 10, 2024
@kilfoyle
Copy link
Contributor

kilfoyle commented Jul 16, 2024

Thanks for reporting this @merlixelastic and for the clarifications @lucabelluccini.

So I think we need to:

@michel-laterman could you perhaps provide the steps for number 1? I have no idea about the K8s setup at all, so if you don't mind putting something in a draft document I'd be happy to port that into the Deployment models page.

@nimarezainia just for your awareness.

@kilfoyle
Copy link
Contributor

kilfoyle commented Jul 17, 2024

Regarding requirement 1, @nimarezainia and I discussed this and are thinking that we can update the Elastic Agent install instruction pages for Kubernetes and for Docker, to add the additional settings required to run agent as a Fleet Server. I've opened a PR with the proposed changes: #1184

@michel-laterman I'm guessing a bit at what I think the settings are so please take a look and let us know if anything needs fixing. We would still need to document setting up certificates between Elastic Agent and Kibana, which I guess would best fit in Configure SSL/TLS for self-managed Fleet Servers.

@michel-laterman
Copy link
Contributor

We have documentation for container env vars that fleet-server uses during bootstrapping; however these are under the elastic-agent install instructions: https://www.elastic.co/guide/en/fleet/current/agent-environment-variables.html#env-prepare-kibana-for-fleet

I think we can re-organize some pages to make it more clear that we expect an end user to only deploy a fleet-server as an agent component and better utilize the agent installation instructions.

Additionally we should go over the env vars, i'm not certain if KIBANA_FLEET_SETUP still applies to agents in containers anymore

@kilfoyle
Copy link
Contributor

Thanks @michel-laterman. I'll wait for your suggestions on this, as well as for #1184 "Add Fleet Server install steps on K8s and Docker".

If/when the Elastic Agent install pages have everything required to install Fleet Server, we probably just need to mention that somewhere in the Deployment models section.

@lucabelluccini
Copy link
Contributor

lucabelluccini commented Jul 31, 2024

Regarding the KIBANA_FLEET* env vars, please note we had users (see private issue created by Xavier) where the enrollment was failing.

@kilfoyle
Copy link
Contributor

kilfoyle commented Sep 19, 2024

Looks like we're nearing completion on this:


@michel-laterman Can you please help with number 3, and also review my small PR for number 1?

@merlixelastic, @lucabelluccini, @nimarezainia Let me know if you think we're missing anything.

@michel-laterman
Copy link
Contributor

KIBANA_FLEET_SETUP has been removed for a while: elastic/elastic-agent#2910

We're missing some env vars in our public docs (as well as from the output of the container help command):

  • FLEET_FORCE - same as the --force flag
  • ELASTIC_AGENT_CERT & ELASTIC_AGENT_CERT_KEY - paths to mtls cert and key the agent will use to connect to fleet-server. (corresponding var for passphrase is missing)
  • FLEET_SERVER_CLIENT_AUTH - set fleet-server mtls settings, one of: none (default), optional, required
  • FLEET_SERVER_ES_CERT & FLEET_SERVER_ES_CERT_KEY - fleet-server -> es mTLS cert paths. (corresponding var for passphrase is missing)
  • FLEET_SERVER_INSECURE_HTTP - expose fleet-server as an http server
  • FLEET_HEADER - I think this one is headers the agent will send to fleet-server
  • FLEET_KIBANA_HEADER - headers used when contacting Kibana
  • FLEET_SERVER_TIMEOUT - how long elastic-agent will wait for fleet-server to checkin as healthy
  • FLEET_DAEMON_TIMEOUT - how long fleet-server will wait during the bootstrap process for elastic-agent

@kilfoyle
Copy link
Contributor

Nice catch @michel-laterman! I'll add the above env vars to the docs page.

@kilfoyle
Copy link
Contributor

@michel-laterman I've opened this PR to add the missing settings. For easier reviewing, I've opened this gdoc and everyone from this issue should have access.

@nimarezainia FYI

@kilfoyle
Copy link
Contributor

kilfoyle commented Oct 8, 2024

@merlixelastic and @lucabelluccini I've just merged this PR to add the environment variables for container setup that hadn't already been documented. That completes the list of "To dos" in this comment, so I think this issue can be closed now.

If we've missed anything, please let us know and I can open a new docs issue. Thanks!

And thanks @michel-laterman for the help on this!

@kilfoyle kilfoyle closed this as completed Oct 8, 2024
@lucabelluccini
Copy link
Contributor

Thank you @kilfoyle

My only comment/follow up is @michel-laterman reports the code was removed elastic/elastic-agent#2910, but we had a user hitting the error below when enrolling an Elastic Agent / Fleet Server on 8.13 on a container/kubernetes installation:

Kibana fetch policy failed: http GET request to https://kibana-multi:5601/api/fleet/agent_policies fails: fail to execute the HTTP GET request: Get "https://kibana-multi:5601/api/fleet/agent_policies": x509: certificate signed by unknown authority.

At this point I wonder if we should open a separate issue to investigate.

@kilfoyle
Copy link
Contributor

kilfoyle commented Oct 9, 2024

At this point I wonder if we should open a separate issue to investigate.

@lucabelluccini It's a great question but it's not something I would know how to investigate, so I'd really appreciate if this could go into a separate issue in the ingest-dev repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Team:Docs Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

5 participants