Skip to content

Recipe for exposing Fleet server to outside of the Kubernetes cluster#8788

Merged
pebrc merged 2 commits intoelastic:mainfrom
pebrc:ext-fleet-agent-recipe
Aug 25, 2025
Merged

Recipe for exposing Fleet server to outside of the Kubernetes cluster#8788
pebrc merged 2 commits intoelastic:mainfrom
pebrc:ext-fleet-agent-recipe

Conversation

@pebrc
Copy link
Copy Markdown
Collaborator

@pebrc pebrc commented Aug 7, 2025

Configuring Fleet to be accessible from both inside as well as outside the Kubernetes cluster is a bit tricky. This recipe aims at highlighting some of the gotchas.

Opened as draft as I want to see if there are additional simplications (also I think exposing the other stack resources through Ingress might be a distraction that I need to reconsider)

@pebrc pebrc added the >docs Documentation label Aug 7, 2025
@prodsecmachine
Copy link
Copy Markdown
Collaborator

prodsecmachine commented Aug 7, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@pebrc pebrc force-pushed the ext-fleet-agent-recipe branch from a0d5010 to 13e16a7 Compare August 7, 2025 13:32
@pebrc pebrc force-pushed the ext-fleet-agent-recipe branch from 13e16a7 to 4e4dfdd Compare August 7, 2025 14:00
@pebrc pebrc marked this pull request as ready for review August 23, 2025 16:59
@pebrc
Copy link
Copy Markdown
Collaborator Author

pebrc commented Aug 23, 2025

also I think exposing the other stack resources through Ingress might be a distraction that I need to reconsider

After thinking about it: if Fleet is supposed to be exposed externally then Elasticsearch needs to be exposed as well. Kibana could be argued can be left out but typically user will access it from outside the cluster so I left it in.

I want to see if there are additional simplications

Unfortunately I don't recall what I had in mind there. I don't see any obvious simplification.

@barkbay
Copy link
Copy Markdown
Contributor

barkbay commented Aug 25, 2025

👀

Copy link
Copy Markdown
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Tested with Let's Encrypt and nginx ✅

Comment thread config/recipes/elastic-agent/fleet-ingress-setup.yaml Outdated
Comment thread config/recipes/elastic-agent/fleet-ingress-setup.yaml Outdated
@pebrc pebrc enabled auto-merge (squash) August 25, 2025 14:52
@pebrc pebrc merged commit 15e2c8d into elastic:main Aug 25, 2025
9 checks passed
pebrc added a commit to elastic/docs-content that referenced this pull request Sep 22, 2025
Depends on elastic/cloud-on-k8s#8788

Add a new recipe for ECK managed Fleet servers after a recent support
escalation that illustrated that users would benefit from additional
guidance on how to set this up.

> This example shows how to expose the Fleet Server to the outside world
using a Kubernetes Ingress resource. The Fleet Server is configured to
use custom TLS certificates, and all communications are secured with
TLS. The same Fleet Server is also accessible from within the cluster,
allowing agents to connect to it regardless of their location. Refer to
the comments in the `fleet-ingress-setup.yaml` file for more details on
how to set up the Ingress resource and TLS certificates to enable this
configuration.
@rhr323 rhr323 added the v3.2.0 label Oct 27, 2025
@rhr323 rhr323 changed the title External Fleet agent recipe Oct 27, 2025
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Oct 31, 2025
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [eck-operator](https://github.com/elastic/cloud-on-k8s) | minor | `3.1.0` -> `3.2.0` |

---

### Release Notes

<details>
<summary>elastic/cloud-on-k8s (eck-operator)</summary>

### [`v3.2.0`](https://github.com/elastic/cloud-on-k8s/releases/tag/v3.2.0)

[Compare Source](elastic/cloud-on-k8s@v3.1.0...v3.2.0)

### Elastic Cloud on Kubernetes 3.2.0

- [Quickstart guide](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s#eck-quickstart)

##### Release Highlights

##### Automatic pod disruption budget (Enterprise feature)

ECK now offers better out-of-the-box PodDisruptionBudgets that automatically keep your cluster available as Pods move across nodes. The new policy calculates the number of Pods per tier that can sustain replacement and automatically generates a PodDisruptionBudget for each tier, enabling the Elasticsearch cluster to vacate Kubernetes nodes more quickly, while considering cluster health, without interruption.

##### User Password Generation (Enterprise feature)

ECK will now generate longer passwords by default for the administrative user of each Elasticsearch cluster. The password is 24 characters in length by default (can be configured to a maximum of 72 characters), incorporating alphabetic and numeric characters, to make password complexity stronger.

##### Features and enhancements

- Enable certificate reloading for stack monitoring Beats [#&#8203;8833](elastic/cloud-on-k8s#8833) (issue: [#&#8203;5448](elastic/cloud-on-k8s#5448))
- Allow configuration of file-based password character set and length [#&#8203;8817](elastic/cloud-on-k8s#8817) (issues: [#&#8203;2795](elastic/cloud-on-k8s#2795), [#&#8203;8693](elastic/cloud-on-k8s#8693))
- Automatically set GOMEMLIMIT based on cgroups memory limits [#&#8203;8814](elastic/cloud-on-k8s#8814) (issue: [#&#8203;8790](elastic/cloud-on-k8s#8790))
- Introduce granular PodDisruptionBudgets based on node roles [#&#8203;8780](elastic/cloud-on-k8s#8780) (issue: [#&#8203;2936](elastic/cloud-on-k8s#2936))

##### Fixes

- Gate advanced Fleet config logic to Agent v8.13 and later [#&#8203;8869](elastic/cloud-on-k8s#8869)
- Ensure Agent configuration and state persist across restarts in Fleet mode [#&#8203;8856](elastic/cloud-on-k8s#8856) (issue: [#&#8203;8819](elastic/cloud-on-k8s#8819))
- Do not set credentials label on Kibana config secret [#&#8203;8852](elastic/cloud-on-k8s#8852) (issue: [#&#8203;8839](elastic/cloud-on-k8s#8839))
- Allow elasticsearchRef.secretName in Kibana helm validation [#&#8203;8822](elastic/cloud-on-k8s#8822) (issue: [#&#8203;8816](elastic/cloud-on-k8s#8816))

##### Documentation improvements

- Update Logstash recipes from to filestream input [#&#8203;8801](elastic/cloud-on-k8s#8801)
- Recipe for exposing Fleet server to outside of the Kubernetes cluster [#&#8203;8788](elastic/cloud-on-k8s#8788)
- Clarify secretName restrictions [#&#8203;8782](elastic/cloud-on-k8s#8782)
- Update ES\_JAVA\_OPTS comments and explain auto-heap behavior [#&#8203;8753](elastic/cloud-on-k8s#8753)

##### Dependency updates

- github.com/gkampitakis/go-snaps v0.5.13 => v0.5.15
- github.com/hashicorp/vault/api v1.20.0 => v1.22.0
- github.com/KimMachineGun/automemlimit => v0.7.4
- github.com/prometheus/client\_golang v1.22.0 => v1.23.2
- github.com/prometheus/common v0.65.0 => v0.67.1
- github.com/sethvargo/go-password v0.3.1 => REMOVED
- github.com/spf13/cobra v1.9.1 => v1.10.1
- github.com/spf13/pflag v1.0.6 => v1.0.10
- github.com/spf13/viper v1.20.1 => v1.21.0
- github.com/stretchr/testify v1.10.0 => v1.11.1
- golang.org/x/crypto v0.40.0 => v0.43.0
- k8s.io/api v0.33.2 => v0.34.1
- k8s.io/apimachinery v0.33.2 => v0.34.1
- k8s.io/client-go v0.33.2 => v0.34.1
- k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 => v0.0.0-20250604170112-4c0f3b243397
- sigs.k8s.io/controller-runtime v0.21.0 => v0.22.2
- sigs.k8s.io/controller-tools v0.18.0 => v0.19.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTUuNCIsInVwZGF0ZWRJblZlciI6IjQxLjE1NS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJjaGFydCJdfQ==-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/1911
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs Documentation v3.2.0

4 participants