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

[helm] add support for creating services for agent presets #6002

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

pkoutsovasilis
Copy link
Contributor

@pkoutsovasilis pkoutsovasilis commented Nov 12, 2024

What does this PR do?

This PR introduces support for automatically creating Kubernetes services for specific Elastic Agent presets through the Helm chart. It adds a structured and scalable mechanism for managing and exposing agent instances within the Kubernetes cluster. This enhancement allows users to define service configurations (e.g., type, ports) for push-based integrations like NetFlow.

Key changes:

  1. Added logic in the Helm chart to generate services for agent presets when specified in values.yaml.
  2. Introduced configuration examples for creating a NodePort service linked to a NetFlow agent preset.
  3. Updated schema definitions in values.schema.json to support new service and port configuration options.

Why is it important?

This enhancement simplifies the deployment and operational management of push-based integrations by allowing users to define and scale agent services directly through Helm configurations. By enabling Kubernetes service generation, this change:

  • Streamlines access to agent instances.
  • Supports various service types (e.g., ClusterIP, NodePort, LoadBalancer) to accommodate diverse user needs.

Checklist

  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files

Disruptive User Impact

This PR does not introduce disruptive changes, as service creation is optional and requires explicit configuration by users in values.yaml. By default, no services will be created unless configured.

How to test this PR locally

Follow the example introduced in this PR

Related issues

@pkoutsovasilis pkoutsovasilis added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog backport-8.x Automated backport to the 8.x branch with mergify labels Nov 12, 2024
@pkoutsovasilis pkoutsovasilis self-assigned this Nov 12, 2024
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@pkoutsovasilis pkoutsovasilis force-pushed the helm/service_support branch 2 times, most recently from a83b27a to ccb0581 Compare December 30, 2024 05:59
@pkoutsovasilis pkoutsovasilis marked this pull request as ready for review December 30, 2024 06:45
@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner December 30, 2024 06:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Something that jumps out at me in this PR is that we're making essentially the same change in the ECK and K8s templates. Could we unify that?

@pkoutsovasilis
Copy link
Contributor Author

This is true there is enough overlapping between the two, but there are enough small differences that make me wonder if merging them is gonna add value; namely deployment, statefulset, daemonset are ECK CRDs, the agent config (secret) is referenced in the CRD and all the mounts of that are handled by the ECK operator, thus, the pod template has a different flow. But sure in the future we could investigate merging them, does this make sense? 🙂

@pkoutsovasilis pkoutsovasilis merged commit ed4f923 into elastic:main Jan 1, 2025
9 checks passed
@pkoutsovasilis pkoutsovasilis deleted the helm/service_support branch January 1, 2025 11:35
mergify bot pushed a commit that referenced this pull request Jan 1, 2025
pkoutsovasilis added a commit that referenced this pull request Jan 2, 2025
…ent presets (#6463)

* feat: implement support for creating services for agent presets (#6002)

(cherry picked from commit ed4f923)

* 2025 notice

* fix: render examples

---------

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
Co-authored-by: Michal Pristas <michal.pristas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify enhancement New feature or request skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[helm] Create Kubernetes Service for Agent Presets
3 participants