-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
The elasticsearch core service has three service status levels defined today:
critical
This happens when Kibana has connected to a cluster which has one or more nodes with incompatible versions.
degraded
This happens when Kibana has connected to a cluster which has one or more nodes with incompatible versions, and Kibana is configured with elasticsearch.ignoreIncompatibleVersions: true. This is a dev-only setting which allows Kibana to start up even if it's connected to an incompatible cluster.
available
This happens when Kibana has connected to a cluster with fully compatible nodes.
The Spaces plugin waits for elasticsearch to become available before attempting to create the default space:
kibana/x-pack/plugins/spaces/server/default_space/default_space_service.ts
Lines 74 to 82 in bf04235
| const isElasticsearchReady = status.elasticsearch.level === ServiceStatusLevels.available; | |
| const isSavedObjectsReady = status.savedObjects.level === ServiceStatusLevels.available; | |
| if (!isElasticsearchReady || !isSavedObjectsReady) { | |
| return of({ | |
| level: ServiceStatusLevels.unavailable, | |
| summary: 'required core services are not ready', | |
| } as ServiceStatus); | |
| } |
This works for pretty much everyone, but we run into problems when Kibana is configured with elasticsearch.ignoreIncompatibleVersions: true, since the elasticsearch service never reaches the available status when connected to an incompatible cluster.
The result is we never create the Default space, which leads to users getting the dreaded application privileges must refer to at least one resource error.
Given that, I have a couple of questions:
- In general, should consumers attempt to work with services which are in a
degradedstate? It's hard to know why a service is degraded to know whether or not to attempt a particular action. For this specific service, and specific degradation reason, it makes sense for Spaces to attempt to create the default space, but that's relies on an implementation detail that this is the only reason the service would ever enter thedegradedstate. - If Kibana is configured to ignore incompatible versions, should we really be reporting a
degradedstate? Or wouldavailablebe more appropriate? This is a genuine question, I'm not sure what the best approach here would be. I could make arguments for both sides.
cc @dgieselaar @elastic/kibana-security