Apicurio / srs-fleet-manager

Implementation of the Managed Service Registry Service API (aka control plane API).
Apache License 2.0
4 stars 13 forks source link

Service Registry service Fleet Manager

Quickstart

To build and run the application in the dev mode, execute:

mvn clean install quarkus:dev -Ddev

Notes:

To build a dev application image, run:

mvn clean install -Ddev -Dquarkus.container-image.build=true

which can be executed using:

docker run -p 8080:8080 {user}/srs-fleet-manager-core:0.1.0-SNAPSHOT

Building SR-MSA for production use

The application depends on an Apicurio Registry Tenant Manager client. This dependency is not published at the moment, so you have to build the Tenant Manager and the dependency as follows:

git clone git@github.com:Apicurio/apicurio-registry.git
cd apicurio-registry
make build-tenant-manager

Now, you can build the Service API:

mvn clean install -Dquarkus.container-image.build=true

The production deployment of the application requires:

See dist/openshift/README.md for information about deploying the required components on OpenShift.

Deploy Postgresql locally

docker run -p 5432:5432 -e 'POSTGRES_PASSWORD=postgres' -d postgres
docker run --network host -p 8080:8080 -e 'SERVICE_API_DATASOURCE_URL=jdbc:postgresql://localhost:5432/postgres' {user}/srs-fleet-manager-core:0.1.0-SNAPSHOT

Configuring auth

In order to configure security you must configure the following values:

Option Env. variable
Enable authentication AUTH_ENABLED
Authentication server url KEYCLOAK_URL
Authentication realm KEYCLOAK_REALM
Authentication client KEYCLOAK_API_CLIENT_ID

Configuring tenant manager security

When security is enabled, the application will also expect the following values to be configured to be able to connect to the tenant-manager in a secure manner:

Option Env. variable
Tenant manager auth server url TENANT_MANAGER_AUTH_SERVER_URL
Tenant manager auth realm TENANT_MANAGER_AUTH_SERVER_REALM
Tenant manager auth client TENANT_MANAGER_AUTH_CLIENT_ID
Tenant manager auth secret TENANT_MANAGER_AUTH_SECRET

Examples

The following are several commands for working with the Service API

curl -X POST -H "Content-Type: application/json" \
  -d '{"tenantManagerUrl":"http://tm1.app.example.com"}' \
  http://localhost:8080/api/serviceregistry_mgmt/v1/admin/registryDeployments
 curl http://localhost:8080/api/serviceregistry_mgmt/v1/admin/registryDeployments
curl -X POST -H "Content-Type: application/json" \
  -d '{}' \
  http://localhost:8080/api/serviceregistry_mgmt/v1/registries
curl http://localhost:8080/api/serviceregistry_mgmt/v1/registries
curl http://localhost:8080/api/serviceregistry_mgmt/v1/admin/tasks

Didact demo

Open VSCode on this project, go to demo/demo.didact.md file and use Ctrl + Shift + V to open the Didact view. You need to be logged to an Openshift 4 cluster to run the demo.