BAAS configuration
Scope of this page
The chart exposes almost all of Dgraph’s configuration: two components (zero
and alpha), a backup system, and every Dgraph flag through extraFlags
and configFile. This page documents the OIDC settings, the scope map, and the
chart values likely to need changing.
For everything else — Dgraph flags, cluster sizing, sharding, enterprise features — see the Dgraph documentation:
Application configuration
baas has no single configuration value: each section below says which chart value its settings go into.
OIDC authentication
How baas validates users’ OIDC tokens and decides what each user may do from
the scope map. Set these through the chart’s alpha.extraEnvs.
| Value | Description |
|---|---|
BAAS_OIDC_URL[Required] |
|
BAAS_OIDC_REALM[Required when BAAS_OIDC_ENABLE_GENERIC_OIDC is false] |
|
BAAS_OIDC_CLIENT_ID[Required] |
|
OIDC_SECRET[Required] |
|
BAAS_OIDC_SYNC_ROLES |
|
BAAS_OIDC_SCOPEMAP[Required] |
|
BAAS_OIDC_CA_FILE |
|
BAAS_OIDC_ENABLE_GENERIC_OIDC |
|
BAAS_OIDC_CUSTOM_AUDIENCE |
|
BAAS_OIDC_CUSTOM_ROLES_KEY |
|
BAAS_OIDC_CUSTOM_PERMISSIONS_KEY |
|
alpha.scopemap
The scope map defines who may do what, and is the one piece of this chart you
are most likely to edit. The scope map is a single JSON document, rendered into an
…-alpha-scopemap ConfigMap and mounted at /dgraph/additional-config.
| Value | Description |
|---|---|
alpha.scopemap[Required] |
|
The document has three top-level fields:
| Field | Description |
|---|---|
rules | List of rules, each granting the roles it names a set of actions on a set of resources. The fields of a rule are in the next table. |
resources | Named groups of GraphQL types, as a map of group name to a list of type names. A type has to be in a group for any rule to reach it. The default groups are listed below. |
jurisdictions | Every jurisdiction a rule can grant, as dot-separated names such as site1.area2. The default set is just default. |
Each rule has these fields:
| Field | Description |
|---|---|
id | Identifier of the rule. |
description | What the rule is for. |
roles | Roles the rule applies to. A user matches when their token carries any of them: a libreBaas client role in Keycloak, or a value of the claim named by BAAS_OIDC_CUSTOM_ROLES_KEY with generic OIDC. |
resources | Types the rule covers. * covers every group, <group>.* every type in one group, <group>.<Type> one type in that group, and a type name on its own covers that type. |
actions | Operations the rule allows, from query, mutation, delete, and subscription. * allows all four. |
jurisdictions | Jurisdictions the rule grants for its resources and actions, taken from the top-level jurisdictions list. * matches every remaining level, so site1.* covers every jurisdiction under site1. They reach the schema’s @auth rules through the Jurisdiction macro. |
The default scope map groups the types as follows. Each group also lists the
matching …AggregateResult types, and most include Comment and
HierarchyScope.
| Group | Types |
|---|---|
admin | A single entry, admin. |
audit | None. |
bpmn | None. |
libre | Platform types: access permissions, comments, environment variables, secrets, signatures and signature reasons, menus, and Libre services. |
material | Material lots and sublots, and their properties. |
operations-definition | Operations definitions and segments, their material bills and parameter specifications, and the equipment, material, personnel, and physical asset specifications. |
operations-schedule | Operations schedules and requests, segment requirements and parameters, and the equipment, material, personnel, and physical asset requirements. |
operations-performance | Operations performance, responses, and capabilities, segment responses and data, and the equipment, material, personnel, and physical asset actuals and capabilities. |
process-segment | Process segments, their dependencies, parameters, and versions. |
resources | The resource model: equipment, material classes, definitions, and lots, personnel, physical assets, operational locations, data sources and subscriptions, events and operations events, units of measure, and resource relationship networks. |
test | Test specifications, criteria, results, and property measurements. |
work-definition | Work masters and directives, workflow specifications, state models, forms, and the workflow’s runtime types, such as timers, messages, and errors. |
work-schedule | Work schedules and requests, job lists and orders, and work calendars. |
work-performance | Work performance and responses, and job responses and their data. |
The default scope map contains one rule: admin can do everything
everywhere. Anything more granular has to be added. Adding a new GraphQL type to
the schema also means adding it to a group here, or no rule can reach it.
A scope map with one rule, letting the operator role query the types grouped
under resources:
alpha:
scopemap:
scopemap.json: |
{
"rules": [
{
"id": "rule-001",
"description": "Operators can read resources",
"roles": ["operator"],
"resources": ["resources.*"],
"actions": ["query"],
"jurisdictions": ["*"]
}
],
"jurisdictions": ["default"],
"resources": {
"resources": ["Equipment", "EquipmentClass"]
}
}alpha.cdc
Change data capture, which publishes every mutation to one destination, chosen by
alpha.cdc.sink.
| Value | Description |
|---|---|
alpha.cdc.enabled |
|
alpha.cdc.sink |
|
alpha.cdc.topic |
|
alpha.cdc.nats[Required when alpha.cdc.sink is nats] |
|
alpha.cdc.replicas |
|
alpha.cdc.kafka.brokers[Required when alpha.cdc.sink is kafka] |
|
alpha.cdc.kafka.saslUser |
|
alpha.cdc.kafka.saslPassword |
|
alpha.cdc.kafka.saslMechanism |
|
alpha.cdc.kafka.caCert |
|
alpha.cdc.kafka.clientCert |
|
alpha.cdc.kafka.clientKey |
|
alpha.cdc.solace.host[Required when alpha.cdc.sink is solace] |
|
alpha.cdc.solace.vpn |
|
alpha.cdc.solace.user |
|
alpha.cdc.solace.password |
|
alpha.cdc.solace.topic |
|
alpha.cdc.solace.trustStore |
|
alpha.cdc.http[Required when alpha.cdc.sink is http] |
|
alpha.cdc.file[Required when alpha.cdc.sink is file] |
|
Mutations published to Kafka with SASL:
alpha:
cdc:
enabled: true
sink: kafka
topic: dgraph-cdc
kafka:
brokers: redpanda:9092
saslUser: cdc
saslPassword: ExamplePassword123
saslMechanism: SCRAM-SHA-256Helm chart values
The shared values documented in shared-helm-values.md do not
apply to this chart, which nests everything under zero, alpha,
backups, and global. The values below are the ones likely to need changing.
Image
| Value | Description |
|---|---|
image.registry |
|
image.repository |
|
image.tag |
|
image.pullPolicy |
|
image.pullSecrets |
|
Alpha
| Value | Description |
|---|---|
alpha.replicaCount |
|
alpha.configFile |
|
alpha.extraFlags |
|
alpha.extraEnvs[Required] |
|
alpha.extraEnvFrom |
|
alpha.secrets.useExistingSecret |
|
alpha.secrets.secretName[Required when alpha.secrets.useExistingSecret is true] |
|
alpha.secrets.secretKey[Required when alpha.secrets.useExistingSecret is true] |
|
alpha.caFile |
|
alpha.persistence.size |
|
alpha.persistence.storageClass |
|
alpha.resources |
|
alpha.service.type |
|
alpha.ingress.enabled |
|
alpha.encryption.enabled |
|
alpha.encryption.file[Required when alpha.encryption.enabled is true] |
|
alpha.antiAffinity |
|
alpha.initContainers.init.enabled |
|
alpha.initContainers.init.command |
|
alpha.terminationGracePeriodSeconds |
|
An alpha sized for a larger data set, the OIDC endpoint it needs, and one setting passed through its own config file. The environment variables the chart ships are repeated here, since the list replaces them:
alpha:
configFile:
config.yaml: |
lru_mb: 2048
extraEnvs:
- name: DGRAPH_ALPHA_WHITELIST
value: 0.0.0.0:255.255.255.255
- name: BAAS_OIDC_URL
value: "http://keycloak:80"
- name: BAAS_OIDC_REALM
value: "libre"
- name: BAAS_OIDC_CLIENT_ID
value: "libreBaas"
- name: BAAS_OIDC_SCOPEMAP
value: /dgraph/additional-config/scopemap.json
extraEnvFrom:
- secretRef:
name: my-secret
resources:
requests:
memory: 8Gi
cpu: 2Zero
| Value | Description |
|---|---|
zero.replicaCount |
|
zero.shardReplicaCount |
|
zero.persistence.size |
|
zero.persistence.storageClass |
|
zero.resources |
|
zero.service.type |
|
A zero with a larger memory request:
zero:
resources:
requests:
memory: 1GiBackups
Dgraph enterprise backups, run as Kubernetes CronJobs that call the alpha admin endpoint.
| Value | Description |
|---|---|
backups.full.enabled |
|
backups.full.schedule |
|
backups.incremental.enabled |
|
backups.incremental.schedule |
|
backups.destination[Required when backups.full.enabled or backups.incremental.enabled is true] |
|
backups.subpath |
|
backups.nfs.enabled |
|
backups.nfs.server[Required when backups.nfs.enabled is true] |
|
backups.nfs.path[Required when backups.nfs.enabled is true] |
|
backups.nfs.storage |
|
backups.nfs.mountPath |
|
backups.volume.enabled |
|
backups.volume.claim[Required when backups.volume.enabled is true] |
|
backups.volume.mountPath |
|
backups.admin.auth_token |
|
backups.keys.s3.access[Required when backups.destination is an s3:// URL] |
|
backups.keys.s3.secret[Required when backups.destination is an s3:// URL] |
|
Global
| Value | Description |
|---|---|
global.domain |
|
global.ingress.enabled |
|
global.ingress.alpha_hostname[Required when global.ingress.enabled is true] |
|
global.ingress.certResolver |
|
global.ingress.tls |
|
global.ingress.annotations |
|
One Ingress for alpha, terminating TLS with an existing Secret:
global:
ingress:
tls:
- hosts:
- baas.example.libremfg.ai
secretName: baas-tls
annotations:
kubernetes.io/ingress.class: traefik