-
Notifications
You must be signed in to change notification settings - Fork 138
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 kustomise template for hints auto discover #5643
base: main
Are you sure you want to change the base?
Add kustomise template for hints auto discover #5643
Conversation
This pull request does not have a backport label. Could you fix it @MichaelKatsoulis? 🙏
|
|
deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone/kustomization.yaml
Show resolved
Hide resolved
deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone/kustomization.yaml
Show resolved
Hide resolved
runAsUser: 0 | ||
volumeMounts: | ||
- name: elastic-agent-state | ||
mountPath: /usr/share/elastic-agent/state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you extend the integration k8s tests by adding a new one with hints enabled? it would be nice to check that the agent and all components are starting and reporting healthy with this feature enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which tests are you referring to Panos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had in mind these tests https://github.com/elastic/elastic-agent/blob/main/testing/integration/kubernetes_agent_standalone_test.go#L63 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you !! I wanted to double check as we dont actually own them.
But I created an issue here: #5660. We can discuss internally for prioritisation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT the k8s ownership is shared, and the agent repo now has k8s integration tests. So ideally anything that has to do with different k8s deployments should be covered by a test but sure discuss #5660 and try to couple this integration test with this PR
I'm not sure I fully understand the intent of this PR, but shouldn't we also be modifying https://github.com/elastic/elastic-agent/blob/main/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml? |
@swiatekm no the main standalone manifest should not be affected The users should run a command like the following and make an installation of agent+k8s integration+system integration+kube-state-metrics up and running: kubectl kustomize https://github.com/MichaelKatsoulis/elastic-agent/deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone\?ref\=kustomize_templates_hints_autodiscover | sed -e "s/JUFQSV9LRVkl/UTWamNtcGFkdz09/g" -e "s/%ES_HOST%/https:\/\/e56ee37c53644df6940a8ae217ab5960.us-central1.gcp.cloud.es.io:443/g" -e "s/%CA_TRUSTED%/ca_trusted_fingerprint/g" -e "s/%ONBOARDING_ID%/12345/g" | kubectl apply -f Please read some more info here |
Tested successfully the PR with a current Elastic Cloud setup. Prereq: Go to Stack Management > API Keys and create a new key Important use the beats format key Create the encoded value by running: echo -n oB1lTZIBdpMiLQUgtFM4:Z1bs7_ufTuOj5O8pg0Sxmg | base64
b0IxbFRaSUJkcE1pTFFVZ3RGTTQ6WjFiczdfdWZUdU9qNU84cGcwU3htZw== Then run the following: kubectl kustomize https://github.com/MichaelKatsoulis/elastic-agent/deploy/kubernetes/elastic-agent-kustomize/ksm-hints/elastic-agent-standalone\?ref\=kustomize_templates_hints_autodiscover | sed -e "s/JUFQSV9LRVkl/b0IxbFRaSUJkcE1pTFFVZ3RGTTQ6WjFiczdfdWZUdU9qNU84cGcwU3htZw==/g" -e "s/%ES_HOST%/https:\/\/<CloudURL>:443/g" -e "/{CA_TRUSTED}/c\ " > k2.yaml Replace the image referneces: Then run Metrics and logs collection is successfull. I will run some more tests with autodiscovery templates and annotations in pods. |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Quality Gate passedIssues Measures |
What does this PR do?
This PR adds a Kustomize template to enable hints based auto discovery by default in standalone elastic agent.
It mainly adds a initcontainer 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.
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
./changelog/fragments
using the changelog toolDisruptive 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