Skip to Content

Datacollection Module

Datacollection is installed from the regulator chart. The chart also runs MDM (Master Data Management), which keeps the reporting entities and entity groups. MDM registers with IAM as MDM-Module, next to DataCollection-Module.

The installation of Datacollection itself, including its sizing, databases and backups, is described in the Datacollection documentation. This page lists the values that connect it to the RSH platform.

Boundaries and install order

Datacollection serves both boundaries: the supervision centre on the internal boundary and the portal on the external one. It registers with both IAM instances, so install it after <INTERNAL_RELEASE> and <EXTERNAL_RELEASE>.

Values

Set the values below so that Datacollection and MDM sign in through IAM, register with both IAM instances, and reach NATS. Other keys stay at the chart default. Print the chart’s own values with helm show values <DATACOLLECTION_CHART> --version <DATACOLLECTION_VERSION>.

The file has these blocks:

  • global and keycloak turn off the user management and the Keycloak of the chart, so that users sign in through IAM.
  • regulator-platform sets the supervision-centre hosts, the registration with IAM under rsh, and the NATS address.
  • regulator-portal sets the portal host and the registration of the portal.
  • platform-api connects the bundled Platform API to NATS.

<DATACOLLECTION_RELEASE>-values.yaml:

global: keycloak: confidentialClientId: rsh-datacollection-confidential-client userManagement: enabled: false keycloak: enabled: false regulator-platform: frontend: ingress: hostname: <HUB_HOST> relayGateway: ingress: hostname: <RELAY_GATEWAY_HOST> rsh: enabled: true rshModuleName: DataCollection-Module rshKeycloakClient: rsh-datacollection-api hubHostUrl: https://<HUB_HOST> portalHostUrl: https://<PORTAL_HOST> mdmModuleName: MDM-Module mdmKeycloakClient: rsh-mdm-api hubMdmUrl: https://<HUB_HOST> portalMdmUrl: https://<PORTAL_HOST> hubGetEntitiesUrl: https://<HUB_HOST>/api/v1/rsh/entities/hub portalGetEntitiesUrl: https://<PORTAL_HOST>/api/v1/rsh/entities/portal natsUrl: <NATS_URL> regulator-portal: portal: ingress: hostname: <PORTAL_HOST> relayGateway: url: https://<RELAY_GATEWAY_HOST> rsh: enabled: true rshModuleName: DataCollection-Module mdmModuleName: MDM-Module platform-api: enabled: true global: imageRegistry: <IMAGE_REGISTRY> api: messaging: url: <NATS_URL>

Configure sign-in in two more blocks of the same values file, under global. Each block tells Datacollection which issuer to accept tokens from, which client the browser signs in with, and where to fetch the keys that validate the tokens.

  • global.hubExternalOidc points the supervision centre at the internal IAM.
  • global.portalExternalOidc points the portal at the external IAM.
  • Both blocks set enabled: true.
  • Both blocks set confidentialClientId: rsh-datacollection-confidential-client.
  • Both blocks set userPath: preferred_username.
  • Both blocks set disableJwksSecurity: false.

The table lists the keys whose values differ between the two blocks:

KeyInternal, hubExternalOidcExternal, portalExternalOidc
issuer<INTERNAL_ISSUER><EXTERNAL_ISSUER>
frontendClientIdrsh-datacollection-supervisioncenterrsh-datacollection-portal
oidcJwksUri<INTERNAL_ISSUER>/protocol/openid-connect/certs<EXTERNAL_ISSUER>/protocol/openid-connect/certs
keycloak.url, keycloak.realmhttps://<INTERNAL_KEYCLOAK_HOST>, <INTERNAL_REALM>https://<EXTERNAL_KEYCLOAK_HOST>, <EXTERNAL_REALM>
scope, endSessionEndpoint, enableStrictDiscoveryValidationopenid, <INTERNAL_ISSUER>/protocol/openid-connect/logout, trueNot set

These points apply to the values above:

  • keycloak.enabled: false and global.userManagement.enabled: false hand sign-in to IAM.
  • The chart defaults of rsh.rshKeycloakClient and rsh.mdmKeycloakClient are data-collection-module-client and mdm-module-client, so both are set.
  • An endpoint whose URL is empty is not registered.

Also set these values, because their chart defaults break the installation:

  • analytics-init.databaseConnections is empty. The regulator and mdm connections are required, and they read the Secrets regulator-app and mdm-app. The fact connection reaches Trino through <TRINO_HOST>.
  • global.storage.bucket defaults to the release namespace, and the chart does not create the bucket. The login can come from global.storage.existingSecret (keys username and password).
  • global.image.user and global.image.password create the Secret docker-credentials, which pods use only when it is also listed in global.image.pullSecrets.
  • platform-api.api.storage.url stays an in-cluster MinIO address until it is set. An installation that uses module file exchange sets the URL and bucket of the shared storage; the login comes from api.storage.existingSecret, or from api.storage.username and api.storage.password.

Also set the content repository, mail and the remaining hosts in the same file:

  • global.gitlab.hostname is <CONTENT_GIT_HOST> and global.gitlab.contentGroup is <CONTENT_GROUP>, with the token in global.gitlab.apiToken or in the Secret global.gitlab.existingSecret (key apiToken); see Module content.
  • regulator-platform.smtp.user is <SMTP_USER>.
  • smtp.password and regulator-platform.xbrlProcessor.abra.licence are values only.
  • The other hosts (<MOBILE_HOST>, <SUPERSET_HOST>, <JUPYTER_HOST>, <WORKFLOW_HOST>, <SCHEMA_GENERATOR_HOST>, <TRINO_HOST>) are ingress hostnames; see Hosts and certificates.

Installation

Install the release with the values file from the previous section:

helm upgrade -i <DATACOLLECTION_RELEASE> <DATACOLLECTION_CHART> \ --version <DATACOLLECTION_VERSION> \ -n <INTERNAL_NAMESPACE> \ -f <DATACOLLECTION_RELEASE>-values.yaml \ --set-file global.caCert=<CA_BUNDLE_FILE> \ --wait --wait-for-jobs --timeout 10m

--wait-for-jobs waits until rsh-init has registered the module. --set-file global.caCert is needed only when the ingress certificates are signed by a CA that is not publicly trusted.

Registration

The chart registers Datacollection with both IAM instances in the Job rsh-init-<appVersion>. The Job runs only when regulator-platform.rsh.enabled is true. It fails when one of the IAM instances does not answer.

  • The credentials of the registration clients are stored in <DATACOLLECTION_RELEASE>-rsh-client-credentials.
  • The secrets of the confidential clients are stored in hub-keycloak-client-secrets and portal-keycloak-client-secrets.
  • rsh-init creates only clients that do not exist yet. Change an existing client in IAM.

After the installation, check in both IAM instances:

ItemValue
Application IDsDataCollection-Module (rsh.rshModuleName) and MDM-Module (rsh.mdmModuleName)
Registration clientsrsh-datacollection-api (rsh.rshKeycloakClient) and rsh-mdm-api (rsh.mdmKeycloakClient)
Platform API instancedata-collection. The chart sets this name, and rsh-init calls http://data-collection-platform-api, so one release runs per namespace with that name.

Datacollection sends its registrations through that Platform API instance and reads IAM’s answers from JetStream through rsh.natsUrl.

  • platform-api.global.imageRegistry is the registry of the Platform API image, which is published with the RSH platform, so its path can differ from global.image.registry.
  • Its pull Secret is platform-api.global.imagePullSecrets. global.image.pullSecrets does not apply to this subchart.

IAM calls the endpoints below to read the roles, entities and entity groups of Datacollection. The chart builds each address from the values set above: the endpoint path is appended to the base URL of its boundary, and only the boundaries in rsh.boundaries are registered.

Application IDCapabilityBase URLEndpoint
DataCollection-ModulegetRolesrsh.hubHostUrl (internal), rsh.portalHostUrl (external)/api/v1/rsh/hub/roles (internal), /api/v1/rsh/portal/roles (external)
MDM-ModulegetRolesrsh.hubMdmUrl (internal), rsh.portalMdmUrl (external)/api/v1/rsh/hub/mdm/roles (internal), /api/v1/rsh/portal/mdm/roles (external)
BothgetEntitiesNone; the value is the full URLrsh.hubGetEntitiesUrl (internal), rsh.portalGetEntitiesUrl (external)
BothgetEntityGroupsrsh.hubHostUrl (internal), rsh.portalHostUrl (external)/api/v1/rsh/entity_groups
BothgetEntityGroupMembershipsrsh.hubHostUrl (internal), rsh.portalHostUrl (external)/api/v1/rsh/entity_groups/hierarchy
  • entityEndpointsEnabled: false stops the registration of getEntities and getEntityGroups. getEntityGroupMemberships is still registered.
  • With the default true, both registrations offer the entity endpoints, so MDM provides the global entities context; see Global entities.
  • MDM receives the entities that Licensing publishes on hub.entity.

IAM clients

rsh-init creates these clients in IAM so that the supervision centre, the portal and the module itself can sign in. The chart’s default clients are not used.

rsh.iamClientsConfig replaces the chart default.

  • The chart default is abacus360, confidential-client, superset and form-editor on the internal boundary, and abacus360 and confidential-client on the external one.
  • Its client IDs match global.hubExternalOidc.frontendClientId, global.portalExternalOidc.frontendClientId and global.keycloak.confidentialClientId.

Set rsh.iamClientsConfig to the full definition:

regulator-platform: rsh: iamClientsConfig: hub-clients.yaml: | clients: - clientId: "rsh-datacollection-supervisioncenter" name: "RSH DCS - Supervision Center" publicClient: true protocol: openid-connect directAccessGrantsEnabled: true enabled: true serviceAccountsEnabled: false standardFlowEnabled: true implicitFlowEnabled: false bearerOnly: false consentRequired: false redirectUris: - "*" webOrigins: - "*" protocolMappers: - name: "confidential-client-audience" protocol: "openid-connect" protocolMapper: "oidc-audience-mapper" consentRequired: false config: included.client.audience: "rsh-datacollection-confidential-client" id.token.claim: "true" lightweight.claim: "false" access.token.claim: "true" introspection.token.claim: "true" - name: "Audience Mapper" protocol: "openid-connect" protocolMapper: "oidc-audience-mapper" consentRequired: false config: included.client.audience: "rsh-datacollection-supervisioncenter" id.token.claim: "false" access.token.claim: "true" - name: "Impersonator Username" protocol: "openid-connect" protocolMapper: "oidc-usersessionmodel-note-mapper" consentRequired: false config: user.session.note: "IMPERSONATOR_USERNAME" id.token.claim: "true" access.token.claim: "true" claim.name: "impersonator.username" jsonType.label: "String" - name: "Impersonator User ID" protocol: "openid-connect" protocolMapper: "oidc-usersessionmodel-note-mapper" consentRequired: false config: user.session.note: "IMPERSONATOR_ID" id.token.claim: "true" access.token.claim: "true" claim.name: "impersonator.id" jsonType.label: "String" defaultClientScopes: - "web-origins" - "acr" - "phone" - "roles" - "profile" - "basic" - "email" - "custom-permissions_token-exchange" optionalClientScopes: - "address" - "organization" - "offline_access" - "groups" - "custom-permissions_instant" - "microprofile-jwt" access: view: true configure: true manage: true - clientId: "rsh-datacollection-confidential-client" name: "RSH DCS - Operaton" publicClient: false protocol: openid-connect directAccessGrantsEnabled: true serviceAccountsEnabled: true enabled: true standardFlowEnabled: true implicitFlowEnabled: false bearerOnly: false consentRequired: false redirectUris: - "*" attributes: client_credentials.use_refresh_token: "true" standard.token.exchange.enabled: "true" - clientId: "rsh-datacollection-form-editor" name: "RSH DCS - Supervision Center - Form Editor" publicClient: true protocol: openid-connect directAccessGrantsEnabled: true enabled: true serviceAccountsEnabled: false standardFlowEnabled: true implicitFlowEnabled: false bearerOnly: false consentRequired: false redirectUris: - "*" webOrigins: - "*" users: - serviceAccountClientId: "rsh-datacollection-confidential-client" clientRoles: realm-management: - "query-groups" - "query-users" - "view-users" portal-clients.yaml: | clients: - clientId: "rsh-datacollection-portal" name: "RSH DCS - Portal" publicClient: true protocol: openid-connect directAccessGrantsEnabled: true enabled: true serviceAccountsEnabled: false standardFlowEnabled: true implicitFlowEnabled: false bearerOnly: false consentRequired: false redirectUris: - "*" webOrigins: - "*" protocolMappers: - name: "confidential-client-audience" protocol: "openid-connect" protocolMapper: "oidc-audience-mapper" consentRequired: false config: included.client.audience: "rsh-datacollection-confidential-client" id.token.claim: "true" lightweight.claim: "false" access.token.claim: "true" introspection.token.claim: "true" - name: "Audience Mapper" protocol: "openid-connect" protocolMapper: "oidc-audience-mapper" consentRequired: false config: included.client.audience: "rsh-datacollection-portal" id.token.claim: "false" access.token.claim: "true" - name: "Impersonator Username" protocol: "openid-connect" protocolMapper: "oidc-usersessionmodel-note-mapper" consentRequired: false config: user.session.note: "IMPERSONATOR_USERNAME" id.token.claim: "true" access.token.claim: "true" claim.name: "impersonator.username" jsonType.label: "String" - name: "Impersonator User ID" protocol: "openid-connect" protocolMapper: "oidc-usersessionmodel-note-mapper" consentRequired: false config: user.session.note: "IMPERSONATOR_ID" id.token.claim: "true" access.token.claim: "true" claim.name: "impersonator.id" jsonType.label: "String" defaultClientScopes: - "web-origins" - "acr" - "phone" - "roles" - "profile" - "basic" - "email" - "custom-permissions_token-exchange" optionalClientScopes: - "address" - "organization" - "offline_access" - "groups" - "custom-permissions_instant" - "microprofile-jwt" access: view: true configure: true manage: true - clientId: "rsh-datacollection-confidential-client" name: "RSH DCS - gateway" publicClient: false protocol: openid-connect directAccessGrantsEnabled: true serviceAccountsEnabled: true enabled: true standardFlowEnabled: true implicitFlowEnabled: false bearerOnly: false consentRequired: false redirectUris: - "*" attributes: client_credentials.use_refresh_token: "true" standard.token.exchange.enabled: "true" users: - serviceAccountClientId: "rsh-datacollection-confidential-client" clientRoles: realm-management: - "query-groups" - "query-users" - "view-users"
Warning

Redirect URIs and web origins

The definitions above allow every redirect URI and web origin ("*"). A production environment restricts redirectUris and webOrigins to the hosts that sign in through each client, for example https://<HUB_HOST>/* and https://<HUB_HOST> for rsh-datacollection-supervisioncenter. rsh-init does not update existing clients, so set the restriction before the first installation, or make it in IAM afterwards.

Hosts and certificates

Give each host below a DNS name and a certificate, and publish it to the portal users or keep it on the internal network:

  • <PORTAL_HOST> is published to the portal users.
  • <HUB_HOST> and the hosts behind the platform proxy (<SUPERSET_HOST>, <JUPYTER_HOST>, <WORKFLOW_HOST>) are reached from the internal network only.
  • <MOBILE_HOST>, <RELAY_GATEWAY_HOST>, <SCHEMA_GENERATOR_HOST> and <TRINO_HOST> are further ingress hostnames. Environment Parameters names each host.
  • Each ingress takes its certificate from cert-manager through the cert-manager.io/cluster-issuer annotation, or from global.ingress.tlsSecretName. With tlsSecretName: "", each ingress uses <ingress-name>.<DATACOLLECTION_DOMAIN>-application-tls.
  • On OpenShift the ingresses have no TLS section; see OpenShift Differences.

Storage and database

Datacollection keeps its own files in the bucket of global.storage. The databases are the CloudNativePG clusters regulator and mdm, which the chart creates on global.storageClass unless global.externalDatabases points at existing databases.