-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Onboarding] k8s quickstart flow #186380
[Onboarding] k8s quickstart flow #186380
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
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.
Looking great!
Code review
I like how much you simplified the REST APIs. I've got a couple questions how that ties into the other flows and non-functional requirements like telemetry below but nothing major.
Let me know if you want to discuss synchronously or do the merging of #186106 together in case there are conflicts.
Testing feedback
I could not get the end-to-end to work. My elastic-agent-standalone
pod is in a failed state so there might be an issue with the kustomize template:
root@minikube:/usr/share/elastic-agent# elastic-agent status
State: FAILED
Message: could not create the map from the configuration: missing field accessing 'outputs'
Fleet State: STOPPED
Fleet Message: Not enrolled into Fleet
Components: (none)
UX feedback
I appreciate that from a technical perspective we're polling for data to arrive as soon as the page is opened but from a user perspective it's confusing to not even having read the first step and already seeing a loading spinner in step 2.
I would suggest to hide the loading spinner until a window.blur
event has been detected. The user has to switch to the terminal to run the command so in the absence of any other signal this should be a good indicator that they have copy and pasted the command and are in the process of running it.
...servability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx
Outdated
Show resolved
Hide resolved
<EuiLink | ||
data-test-subj="observabilityOnboardingDataIngestStatusViewDashboardLink" | ||
href={dashboardLocator?.getRedirectUrl({ | ||
dashboardId: CLUSTER_OVERVIEW_DASHBOARD_ID, |
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.
Can this be hard coded or could the ID change?
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.
At first I implemented a logic to search for dashboard ID by it's title as there seemed to be no other way to reliably reference it, but then I saw that dashboard IDs are hardcoded in a few places in Fleet plugin. Those ID seem to be pard of the dashboard definition and don't change, in the integration code there are multiple iterations on a single dashboard without the ID being changed, so I assume it's save to use it on or side as well.
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.
That's interesting, I assumed these need to be loaded in dynamically.
@kpollich Are the installed dashboard IDs returned by Fleet packages static? We need a way of determining which dashboard should be the main one we direct users to, after log data has been successfully ingested, so hard coding an ID for each integration would make that easy.
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.
They are defined via the integration package, so theoretically they could change on package update. Changing this ID would also affect bookmarks etc., so they should normally stay stable.
It feels OK to rely on this, especially if we already do it in other places - if it breaks, we could consider it a bug in the integration. But also interested in @kpollich s opinion here.
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.
Actually, there might be a case where the id is different when multiple spaces are involved - not sure how this case is normally handled...
...vability_onboarding/public/application/onboarding_flow_form/use_custom_cards_for_category.ts
Outdated
Show resolved
Hide resolved
.../observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx
Outdated
Show resolved
Hide resolved
...ck/plugins/observability_solution/observability_onboarding/server/routes/kubernetes/route.ts
Show resolved
Hide resolved
...ck/plugins/observability_solution/observability_onboarding/server/routes/kubernetes/route.ts
Outdated
Show resolved
Hide resolved
That's a great suggestion, thank you! |
Could you please show the |
b158a7f
to
11cca5f
Compare
@elasticmachine merge upstream |
.../observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx
Show resolved
Hide resolved
Trying to run this gave me is there something else we need to do on the kustomize side? |
...servability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx
Show resolved
Hide resolved
fe227ce
to
dbe4503
Compare
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
@mykolaharmash I tried to run this from the created serverless instance. It doesn't start shipping data, the container comes up but it logs this:
and also
Could you give some instructions to test this? I used a local minikube v1.32.0 |
cc @gizas maybe you have an idea about these errors - the first one could be related to serverless specifically, but we still need to figure out what it's about, the second one seems to be some configuration error? kube-state-metrics is running fine. |
OK, one part of the problem is definitely this:
I ran the kustomize command without applying it and this is in there. Do we need another search/replace to make this work? Still not sure about the second error... |
|
Hello @flash1293 , @mykolaharmash , I was running some tests locally.
Unfortunately not as kustomize does not accept conditions or logic to apply something based on checks. What we can do is to consider creating another folder with specific configuration and apply sth like I dont like this idea so much, but if we think that a new folder will include many of our cases we can consider creating it
kubectl kustomize https://github.com/elastic/elastic-agent/deploy/kubernetes/elastic-agent-kustomize/default/elastic-agent-standalone | sed -e "s/JUFQSV9LRVkl/YlV3eVlteHdRVUpEVVZwcGEzQlpTWEZNVFhJNlV6bFdlV05CVDJwUldVTXRRVGR0ZFd3NGJWbDZRUT09/g" -e "s/%ES_HOST%/https:\/\/elasticsearch:9200/g" -e "/{CA_TRUSTED}/c\ " | kubectl apply -f- The
As you can see here we enable the controllermanager dataset in elastic agent standalone manifest. There are clusters where the controlmanger access is not allowed by default and should be configured. So I suspect that in this case the access to controlmanager is not configured in your minikube. @mykolaharmash, @flash1293 maybe we should consider also to remove it controlmanager and kube-scheduler from default standalone manifests? Those datastreams are disabled by default in managed agent policy For this error for now: kubcetl kustomize https://github.com/elastic/elastic-agent/deploy/kubernetes/elastic-agent-kustomize/default/elastic-agent-standalone > manifest.yaml And then we edit the manifest and remove kubernetes.controllermanager |
@mykolaharmash could you look into this?
As long as it doesn't break the rest, it might be OK. I don't know how common this problem is, you are the expert here. |
This error should not break the rest. The rest datastreams should continue receiving metrics/logs FYI see AKS, EKS, GKE where kube-scheduler and kube-controller-manager components are not available. So basically in all major cloud providers But on the other, that is the notion of standalone, that users need to adjust it per cluster. We enable all and they should tune it |
…y-onboarding-k8s-quickstart-flow
Tested again on serverless and it works as expected 🎉 |
One nit I noticed: When going to the dashboard, it shows data from all connected Kubernetes clusters (if there are multiple). We could pre-filter the dashboard by the onboarding id to only show the data from the current onboarding. Not a blocker though for sure. |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
|
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.
LGTM
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 <elasticmachine@users.noreply.github.com> (cherry picked from commit 141e619)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
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 <elasticmachine@users.noreply.github.com>
Depends on: elastic/elastic-agent#4754
Depends on: #186106
Closes: #182407
Summary
Adds a Kubernetes onboarding quick start flow using
![CleanShot 2024-06-18 at 15 10 27@2x](https://private-user-images.githubusercontent.com/793851/340687656-522d2481-6a0e-43d3-b9ef-d09ee9953b3c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0NjAzMjgsIm5iZiI6MTcyMjQ2MDAyOCwicGF0aCI6Ii83OTM4NTEvMzQwNjg3NjU2LTUyMmQyNDgxLTZhMGUtNDNkMy1iOWVmLWQwOWVlOTk1M2IzYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzMxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDczMVQyMTA3MDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMDE2NGMwNjFkMTBjMTk0NDBmMDlkM2IyNWZlZTllMzY0YWI5NGVkODI3Yzg1MzI2NTgzN2YxYzllNTJmMWVkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.zHqwquVyT-2d2e43B84NIP6wu5PQ95yOSS_8M8vUIyE)
kubectl kustomize
command.How to test
yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E http.host=0.0.0.0
)localhost
in the command with you local IPipconfig getifaddr en0
elastic-agent-kustomize/default/elastic-agent-standalone
folder.