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

[8.x](backport #5643) [Kubernetes] Add kustomize template for hints auto discover #5772

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 14, 2024

What does this PR do?

This PR

  1. adds a Kustomize template to enable hints based auto discovery by default in standalone elastic agent.
    It adds a init container block in elastic agent daemonset.
    For all the rest resources needed for the deployment of elastic agent it relies on the resources from the default kustomize templates.
  2. Updates the volume mount of the init container and adds a shared volume between init and main container for storing the input templates. This allows for removal of root privileges in init container which can be a security vulnerability.

Why is it important?

To enable users of the Observability Kubernetes quickstart to make use of hints auto discovery without the need of configuring and redeploying their manifests.

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

How to test this PR locally

Follow instructions of https://github.com/elastic/elastic-agent/tree/main/deploy/kubernetes/elastic-agent-kustomize/default#remote-usage-of-kustomize-templates

Use https://github.com/MichaelKatsoulis/elastic-agent/deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone\?ref\=kustomize_templates_hints_autodiscover for the kustomization file link.

Related issues


This is an automatic backport of pull request #5643 done by [Mergify](https://mergify.com).

* Add template for hints

* Create fragment

* fixing comments for provider

* removing container_logs

* Remove root capabilites from initcontainer

* Update kustomize patches for hints

* Update changelog fragment

* Update configmap for standalone agent

---------

Co-authored-by: Andrew Gizas <andreas.gkizas@elastic.co>
(cherry picked from commit eedce01)

# Conflicts:
#	deploy/kubernetes/elastic-agent-kustomize/default/elastic-agent-standalone/base/elastic-agent-standalone-daemonset.yaml
#	deploy/kubernetes/elastic-agent-kustomize/ksm-autosharding/elastic-agent-standalone/base/elastic-agent-standalone-daemonset.yaml
#	deploy/kubernetes/elastic-agent-kustomize/ksm-autosharding/elastic-agent-standalone/extra/elastic-agent-standalone-statefulset.yaml
#	deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
@mergify mergify bot requested review from a team as code owners October 14, 2024 07:05
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Oct 14, 2024
@mergify mergify bot requested review from gizas and tetianakravchenko and removed request for a team October 14, 2024 07:05
@mergify mergify bot requested review from swiatekm and pchila and removed request for a team October 14, 2024 07:05
Copy link
Contributor Author

mergify bot commented Oct 14, 2024

Cherry-pick of eedce01 has failed:

On branch mergify/bp/8.x/pr-5643
Your branch is up to date with 'origin/8.x'.

You are currently cherry-picking commit eedce01997.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1727790202-kustomize-templates-with-hints.yaml
	modified:   deploy/kubernetes/Makefile
	modified:   deploy/kubernetes/elastic-agent-kustomize/default/README.md
	new file:   deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone/elastic-agent-standalone-daemonset-configmap.yaml
	new file:   deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone/kustomization.yaml
	new file:   deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone/kustomization.yaml.original
	modified:   deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deploy/kubernetes/elastic-agent-kustomize/default/elastic-agent-standalone/base/elastic-agent-standalone-daemonset.yaml
	both modified:   deploy/kubernetes/elastic-agent-kustomize/ksm-autosharding/elastic-agent-standalone/base/elastic-agent-standalone-daemonset.yaml
	both modified:   deploy/kubernetes/elastic-agent-kustomize/ksm-autosharding/elastic-agent-standalone/extra/elastic-agent-standalone-statefulset.yaml
	both modified:   deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link
Contributor Author

mergify bot commented Oct 14, 2024

This pull request has not been merged yet. Could you please review and merge it @MichaelKatsoulis? 🙏

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

@MichaelKatsoulis MichaelKatsoulis merged commit 11509dd into 8.x Oct 14, 2024
9 checks passed
@MichaelKatsoulis MichaelKatsoulis deleted the mergify/bp/8.x/pr-5643 branch October 14, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants