Results:
There is a typo in the leaf docs that has been partially fixed here: this is how to add the component to a react-app.
yarn add @leaf-platform/service-discovery-provider
It worked. I used the answers provided by Terry to configure the new kubernetes-backed service-registry with two functional services. In both services I answered āyesā to the yeoman question: āshould this service be discoverableā which has the effect of making the service capable of being a service registry. I then pointed my react-app at a randomly chosen service.
A particularly nice piece of functionality is the use of the JS parameter āconfiguredServicesā on the RegisteredServiceProvider component. This letās you register older data services that used the REST based SR.
<RegisteredServiceProvider
interval={null}
serviceRegistryPath="state-vector-staging-fs/rest"
user={DEFAULT_USER}
defaultService="ui-support-service"
preRequest={preRequest}
configuredServices={k8services}
requireSelectedService
>
Where k8Services is set like
const k8services = window.ENV?.CONFIGURED_SERVERS || {};
And defined in my environment.js like
'tspi-ds.launch-to-orbit': {
annotations: {
'data-service.leidos-leaf.com/event-service-uri':
'ws://websocket-service/web-socket/event-query',
'leaf-tools.leidos-leaf.com/live-metadata-editing': 'true',
'leaf-tools.leidos-leaf.com/non-live-metadata-editing': 'false',
'leaf-tools.leidos-leaf.com/rule-editing': 'false',
'leaf-tools.leidos-leaf.com/rule-viewing': 'false',
'service.leidos-leaf.com/base-uri': 'http://localhost/tspi-ds/rest',
},
available: true,
capabilities: ['Data Store'],
endpoints: {
oasEndpointJson: '/app/openapi.json',
oasEndpointYaml: '/app/openapi.yaml',
},
name: 'tspi-ds',
namespace: 'launch-to-orbit',
serviceKey: 'tspi-ds.launch-to-orbit',
},
Findings
- It seems you can run both REST/Kubernetes service registries simultaneously, but each will have a different view of what is, and is not available.
- I receive CORS errors when the service acting as service registry is not in the same namespace as the react-app. This could be a configuration issue, but I donāt recall having this issue with the old REST based one.
Attachments
Here is the conversation I had in Slack with Terry,