-
Notifications
You must be signed in to change notification settings - Fork 148
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
Adding kustomize templates for k8s onboarding #4754
Conversation
This pull request does not have a backport label. Could you fix it @gizas? 🙏
NOTE: |
...kustomize/onboarding/default/elastic-agent-managed/base/elastic-agent-managed-daemonset.yaml
Outdated
Show resolved
Hide resolved
...gent-kustomize/default/elastic-agent-standalone/base/elastic-agent-standalone-daemonset.yaml
Show resolved
Hide resolved
I am a bit confused. What is the different between |
@gizas one other thing came up about the elastic agent version. Right now in the template, version is set to non-existing 8.15.0. Can we somehow ensure that we always have a valid version there, or alternatively expose it as well as a variable, so for onboarding use-case we can set it on our side? |
@mykolaharmash the way it works is that the Makefile computes the agent image version based on this file: elastic-agent/version/version.go Line 7 in a6dba3d
So all the daemonset file has the elastic-agent:8.15.0 inside. This is the only place where I see that this image exists So i guess another sed like: sed -e "s/elastic-agent:8.15.0/elastic-agent:VERSION/g" can do the magic. Also, I think this is only now a problem until we merge the PR. After that we wont have the problem and the CI will make sure that this is always correct. And the user can choose the version with the following use of ref: |
Updating my answer above, I think needs to be mandatory for kibana UI onboarding to update the link like |
@gizas Just to make sure - is there an automation that there is a version of the template for every stack version? Or is this something that needs to be done manually? We should make sure that this won't break in the next version. |
Yes as part of this PR, I have added this in the ci: |
Got it, thank you! I'll update the onboarding logic so that URL always has the version ref |
@cmacknz or @blakerouse if no other objection can you please approve this? We will need one more to merge |
Quality Gate passedIssues Measures |
@gizas one more things about the Elastic Agent version, am I correct that even after your change is merged, we still need to wait for Agent v8.15.0 to be released in order to use the new template in onboarding? Because if we reference |
Good point @mykolaharmash , ideally we could backport this so it will work for 8.14.x as well on serverless before the 8.15 release which is still some time in the future? |
@mykolaharmash I added backport-v8.14.0 label. Thanks! @elastic/elastic-agent-control-plane team can I have an approval please? |
@blakerouse / @andrzej-stencel could you please review here? |
* adding first templates for onboarding * adding secrtegenerator with env * adding readme for kustomize and updating ci script * Update deploy/kubernetes/elastic-agent-kustomize/default/README.md Co-authored-by: Craig MacKenzie <[email protected]> * Update deploy/kubernetes/elastic-agent-kustomize/default/README.md Co-authored-by: Craig MacKenzie <[email protected]> * Update deploy/kubernetes/elastic-agent-kustomize/default/README.md Co-authored-by: Craig MacKenzie <[email protected]> * manifest update with make * removing package variables from makefile * adding note for echo -n flag * changing DATASTRAM_ID to ONBOARDING_ID --------- Co-authored-by: Craig MacKenzie <[email protected]> (cherry picked from commit eca8da7)
* adding first templates for onboarding * Update deploy/kubernetes/elastic-agent-kustomize/default/README.md Co-authored-by: Craig MacKenzie <[email protected]> * manifest update with make * removing package variables from makefile * adding note for echo -n flag * changing DATASTRAM_ID to ONBOARDING_ID --------- Co-authored-by: Craig MacKenzie <[email protected]> (cherry picked from commit eca8da7) Co-authored-by: Andrew Gizas <[email protected]>
Depends on: elastic/elastic-agent#4754 Depends on: #186106 Closes: #182407 ## Summary Adds a Kubernetes onboarding quick start flow using `kubectl kustomize` command. ![CleanShot 2024-06-18 at 15 10 27@2x](https://github.com/elastic/kibana/assets/793851/522d2481-6a0e-43d3-b9ef-d09ee9953b3c) ## How to test 1. Run Kibana and ES locally (make sure to expose ES on 0.0.0.0 so elastic agent can reach it from within a container, I use this command `yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E http.host=0.0.0.0`) 2. Setup a test cluster with [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Fx86-64%2Fstable%2Fbinary+download) 3. Open Kibana and navigate to the Onboarding screen 4. Make sure Kubernetes quick start card is visible under the infrastructure category and click on it 5. Copy the command snippet 6. Paste the command into a terminal, but don't run it yet 7. Replace `localhost` in the command with you local IP `ipconfig getifaddr en0` 8. In case elastic/elastic-agent#4754 was not merged yet, you'd need to also clone the elastic-agent repo and replace the template URL with a local path to the `elastic-agent-kustomize/default/elastic-agent-standalone` folder. 9. Run the command and make sure all resources were created 10. Go back to Kibana, after ~1 minute UI should identify that the data was ingested 11. Click on the cluster overview link and make sure it works --------- Co-authored-by: Elastic Machine <[email protected]>
Depends on: elastic/elastic-agent#4754 Depends on: elastic#186106 Closes: elastic#182407 ## Summary Adds a Kubernetes onboarding quick start flow using `kubectl kustomize` command. ![CleanShot 2024-06-18 at 15 10 27@2x](https://github.com/elastic/kibana/assets/793851/522d2481-6a0e-43d3-b9ef-d09ee9953b3c) ## How to test 1. Run Kibana and ES locally (make sure to expose ES on 0.0.0.0 so elastic agent can reach it from within a container, I use this command `yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E http.host=0.0.0.0`) 2. Setup a test cluster with [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Fx86-64%2Fstable%2Fbinary+download) 3. Open Kibana and navigate to the Onboarding screen 4. Make sure Kubernetes quick start card is visible under the infrastructure category and click on it 5. Copy the command snippet 6. Paste the command into a terminal, but don't run it yet 7. Replace `localhost` in the command with you local IP `ipconfig getifaddr en0` 8. In case elastic/elastic-agent#4754 was not merged yet, you'd need to also clone the elastic-agent repo and replace the template URL with a local path to the `elastic-agent-kustomize/default/elastic-agent-standalone` folder. 9. Run the command and make sure all resources were created 10. Go back to Kibana, after ~1 minute UI should identify that the data was ingested 11. Click on the cluster overview link and make sure it works --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 141e619)
What does this PR do?
WHAT: Introduces the onboarding templates of kustomize for k8s observability
WHY: #4657
Checklist
./changelog/fragments
using the changelog toolHow to test this PR locally
cd elastic-agent-kustomize/default kubectl apply -k elastic-agent-managed or kubectl apply -k elastic-agent-standalone
Examples of online references:
Testing for onboarding procedure
Managed:
Standalone
Eg.
Note: API_KEY should be given as bas64 encoded values from Kibana
Base 64 encoding decding:
Images
Successful enrollement in managed
Successful Installation of kube-state-metrics and
Related issues