-
Notifications
You must be signed in to change notification settings - Fork 248
Dashboards readiness probe #117
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
Conversation
Signed-off-by: Alan Mangashev <[email protected]>
Signed-off-by: Alan Mangashev <[email protected]>
Hi @TheAlgo, @peterzhuamazon, @smlx ! |
Hi @Sebor thanks for the PR could you please create an issue and link to this PR? Thanks. |
Hi @peterzhuamazon! |
Are you talking about your own testing? |
No I mean LINT check here, in PR (Lint and Test Charts / lint-test (pull_request) ):
|
Seem like it. Good catch here. |
@mprimeaux any inputs? ^^ |
@Sebor I was wondering, do we really want to log on to opensearch in the readiness check? A simple call to the root (or base path) will give you a 302 (redirect to login), and it will at least verify that that Opensearch Dashboards is responding. What are your thoughts on this? |
Hi @sastorsl!
That's why test fails. I.e. it is common behavior of dashboards and not readiness probe |
@Sebor you are quite right. |
@DandyDeveloper @TheAlgo any idea how to proceed with this PR? Thanks. |
I need to investigate and approve if things look good later today. Also, we'll need to pull in master to add the other tests. |
Yes some investigation is required here to confirm the behaviour |
I can propose "dirty" workaround: to add flag to disable\enable readiness probe in chart (disabled by default). For example in readinessProbe:
enabled: false What do you think? |
@Sebor I don't like the dirty option here, because it's technically working around the issue. I'm not entirely opposed to adding a Consider this is testing for readiness, a better option would be to include opensearch as a dependency in the workflow and deploy a single node cluster alongside the opensearch-dashboards, so we have a working stack and a "full test" of your readiness probes. |
@Sebor any progress to follow up with what @DandyDeveloper has mentioned above? |
Hi @peterzhuamazon! |
@DandyDeveloper could you clear up what is the next step that @Sebor can proceed with this PR? Thanks. |
@Sebor @peterzhuamazon I was hoping other opinions would weigh in. I think we should be completely testing this otherwise we're going to get issues down the road. To implement this properly, we need to have a proper CI mechanism that matches the default values. This means;
|
I feel it is difficult to remove the dependency of dashboards for readiness unless we don't want to go with the standard way to get the health for dashboards. We can find some other variant which can help determine readiness but that can be ambiguous and will require some POC to be done. Just thinking out loud. What if we can in our CI first install OpenSearch and then do OpenSearch Dashboards everytime we have a change in OpenSearch Dashboards. Opinions? |
@TheAlgo I don't like adding a dependency of having Opensearch deployed, especially in the CI, for the Opensearch Dashboard tests to run. Its a simple solution, but we're worse off long term. |
Is there any resource which is available in OpenSearch Dashboards even if OpenSearch is not available? An image, favicon, html file, anything? |
Simple text only: $ curl -vL 127.1:5601
* Trying 127.0.0.1:5601...
* Connected to 127.0.0.1 (127.0.0.1) port 5601 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:5601
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 503 Service Unavailable
< retry-after: 30
< content-type: text/html; charset=utf-8
< cache-control: private, no-cache, no-store, must-revalidate
< content-length: 45
< Date: Tue, 23 Nov 2021 14:29:43 GMT
< Connection: keep-alive
<
* Connection #0 to host 127.0.0.1 left intact
OpenSearch Dashboards server is not ready yet and 503 HTTP response code |
It seems this PR has been stuck for too long. Thanks. |
@peterzhuamazon I don't have an alternative option to how this could be better at this point. I think deeper considerations are needed on pulling the trigger on this. Adding the CI dependency is not a great idea to me. Having an option to disable this in the CI also just hides the problem. What about raising this on the engineering side to see if a better mechanism for readiness (unauthenticated) can be made available in Opensearch Dashboards, one that also doesn't depend on the upstream Opensearch to confirm readines? |
Repeating my question of last...
|
I attempted to call various resources such as
But there is one thing, and that is the port is listening, and actually determines that a HTTP response code 503 is a valid response. When you connect to an invalid port curl returns errorcode 7 It is highly inconclusive - BUT there is something listening if you get at least a return code 0 from curl. However I agree with @DandyDeveloper , this is really something the opensearch-dashboards team should look into or answer.
|
@CEHENKLE Can someone from Dashboards team give some guidance here? |
@tmarkley @kavilla Could use some help here for dashboards. |
Hey! OpenSearch Dashboards depends on OpenSearch to do anything so with that said having OpenSearch running is a major part of the startup process for OpenSearch Dashboards. If there is no OpenSearch then it won't try to serve up anything. So arguably, 503 is the correct code and implementing something so that it returns a 200 seems no different than:
I think the correct solution would be adding the dependency. |
To actually be able to do something OpenSearch Dashboards requires Opensearch. Still, there is a need to determine if OpenSearch Dashboard itself is ready. "The troops are ready, just waiting for the general, Sir!" |
@sastorsl As the OpenSearch Dashboards code base exists now, the server fails to start and is not ready in any way if OpenSearch is not running. Do we need to further discuss that point in this PR? Maybe we should be asking what the purpose of this readiness probe is? As a maintainer of Dashboards I don't believe this is as trivial as adding a "health" API because it wouldn't properly represent the state of the application. If anything we should be checking the health of OpenSearch before Dashboards is started. |
@tmarkley there are comments as to why a minimum test of OpenSearch Dasboards is both desirable and necessary but I'll try to summarize.
OpenSearch Dashboards requires the backend / OpenSearch to function properly, but still it is a standalone application and should be able to simply report that it is up but that is is missing it's backend. OpenSearch Dashboards going down when OpenSearch goes down also adds to what must be restarted / checked. When automating deployment it makes sense to have separate deployment pipelines for OpenSearch and OpenSearch Dashboards since there are two helm charts and they receive updates at uneven intervals. This also means that at first deploy Dashboards might be ready first - and probably is, but then it goes down and up until OpenSearch comes up which needlessly stresses systems and also adds to what ops have to follow up / search for errors in. These are real life experiences in my case, and I would guess for others as well. |
@sastorsl Thanks for that information, that helps clarify a few things for me. I think these are reasonable requests, but they're going to require some discussion about the path forward for OpenSearch Dashboards. Dashboards is a standalone application is some ways, but historically it's always been coupled to ES/OpenSearch. I don't immediately know the scope required to change this status quo, but again I don't think it's trivial. Do you mind opening an Issue in the OpenSearch Dashboards repo so that we can discuss the options, gauge community interest, and determine the scope of changes that might be required to reach this desired state? |
@tmarkley Just thinking out loud. At the end OpenSearch Dashboards is a Node JS Server so ideally there should be a way out to check the health of it. This thing might be helpful in creating Kubernetes operator as well I feel 🤔 |
Yeah, I agree that it's a reasonable thing to expect. A method for that just doesn't currently exist. |
Description
Add k8s readiness probe to opensearch-dashboards helm chart
Related issues
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.