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] fix disabling cluster role and service account #6004

Merged

Conversation

pkoutsovasilis
Copy link
Contributor

What does this PR do?

This PR resolves two key issues:

  1. It enables disabling cluster role creation without needing to specify an existing role name.
  2. It allows falling back to the default service account by disabling service account creation without specifying an existing one.

Additionally, it updates the nginx custom integration example to demonstrate how to deploy an elastic agent with Kubernetes providers, leader election, cluster role, and service account creation all disabled.

Why is it important?

These changes are essential for improving the configuration flexibility of the deployment process. By allowing cluster role creation to be disabled without requiring the specification of an existing role name, users gain the ability to simplify permissions management. This is particularly useful in environments where pre-configured roles or restricted permissions are mandated.

Furthermore, the option to fall back to the default service account without creating a new one or specifying an existing account name enhances compatibility with Kubernetes setups that have stringent service account policies or rely on default configurations. This ensures smoother integration and reduces the complexity for users deploying the elastic agent in a wide variety of Kubernetes environments.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

N/A

How to test this PR locally

Follow the updated nginx custom integration example

Related issues

N/A

@pkoutsovasilis pkoutsovasilis added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify labels Nov 12, 2024
@pkoutsovasilis pkoutsovasilis self-assigned this Nov 12, 2024
@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner November 12, 2024 15:57
@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

@blakerouse blakerouse 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.

@pkoutsovasilis pkoutsovasilis merged commit a0111f1 into elastic:main Nov 13, 2024
10 of 16 checks passed
@pkoutsovasilis pkoutsovasilis deleted the helm/fix_clusterrole_serviceaccount branch November 13, 2024 10:53
mergify bot pushed a commit that referenced this pull request Nov 13, 2024
* fix: allow disabling cluster role creation without needing to specify an existing one

* fix: fallback to default service account when creation is disabled and no existing one is specified

* fix: update nginx custom integration to disable all k8s agent providers

(cherry picked from commit a0111f1)

# Conflicts:
#	deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml
mergify bot pushed a commit that referenced this pull request Nov 13, 2024
* fix: allow disabling cluster role creation without needing to specify an existing one

* fix: fallback to default service account when creation is disabled and no existing one is specified

* fix: update nginx custom integration to disable all k8s agent providers

(cherry picked from commit a0111f1)

# Conflicts:
#	deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml
pkoutsovasilis added a commit that referenced this pull request Nov 13, 2024
…account (#6008)

* [helm] fix disabling cluster role and service account (#6004)

* fix: allow disabling cluster role creation without needing to specify an existing one

* fix: fallback to default service account when creation is disabled and no existing one is specified

* fix: update nginx custom integration to disable all k8s agent providers

(cherry picked from commit a0111f1)

# Conflicts:
#	deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml

* fix: resolve conflicts

---------

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
pkoutsovasilis added a commit that referenced this pull request Nov 13, 2024
…ccount (#6009)

* [helm] fix disabling cluster role and service account (#6004)

* fix: allow disabling cluster role creation without needing to specify an existing one

* fix: fallback to default service account when creation is disabled and no existing one is specified

* fix: update nginx custom integration to disable all k8s agent providers

(cherry picked from commit a0111f1)

# Conflicts:
#	deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml

* fix: resolve conflicts

---------

Co-authored-by: Panos Koutsovasilis <panos.koutsovasilis@elastic.co>
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 backport-8.16 Automated backport with mergify bug Something isn't working 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.

4 participants