Configuring Polaris

Overview

This page provides information on how to configure Apache Polaris (Incubating). Unless stated otherwise, this information is valid both for Polaris Docker images (and Kubernetes deployments) as well as for Polaris binary distributions.

Note: for Production tips and best practices, refer to Configuring Polaris for Production.

First off, Polaris server runs on Quarkus, and uses its configuration mechanisms. Read Quarkus configuration guide to get familiar with the basics.

Quarkus aggregates configuration properties from multiple sources, applying them in a specific order of precedence. When a property is defined in multiple sources, the value from the source with the higher priority overrides those from lower-priority sources.

The sources are listed below, from highest to lowest priority:

  1. System properties: properties set via the Java command line using -Dproperty.name=value.
  2. Environment variables (see below for important details).
  3. Settings in $PWD/config/application.properties file.
  4. The application.properties files packaged in Polaris.
  5. Default values: hardcoded defaults within the application.

When using environment variables, there are two naming conventions:

  1. If possible, just use the property name as the environment variable name. This works fine in most cases, e.g. in Kubernetes deployments. For example, polaris.realm-context.realms can be included as is in a container YAML definition:

    env:
    - name: "polaris.realm-context.realms"
      value: "realm1,realm2"
    
  2. If running from a script or shell prompt, however, stricter naming rules apply: variable names can consist solely of uppercase letters, digits, and the _ (underscore) sign. In such situations, the environment variable name must be derived from the property name, by using uppercase letters, and replacing all dots, dashes and quotes by underscores. For example, polaris.realm-context.realms becomes POLARIS_REALM_CONTEXT_REALMS. See here for more details.

[!IMPORTANT] While convenient, uppercase-only environment variables can be problematic for complex property names. In these situations, it’s preferable to use system properties or a configuration file.

As stated above, a configuration file can also be provided at runtime; it should be available (mounted) at $PWD/config/application.properties for Polaris server to recognize it. In Polaris official Docker images, this location is /deployment/config/application.properties.

For Kubernetes deployments, the configuration file is typically defined as a ConfigMap, then mounted in the container at /deployment/config/application.properties. It can be mounted in read-only mode, as Polaris only reads the configuration file once, at startup.

Polaris Configuration Options Reference

Configuration PropertyDefault ValueDescription
polaris.persistence.typein-memoryDefine the persistence backend used by Polaris (in-memory, eclipse-link). See [Configuring Apache Polaris for Production)[https://polaris.apache.org/in-dev/unreleased/configuring-polaris-for-production/)
polaris.persistence.eclipselink.configurationFileDefine the location of the persistence.xml. By default, it’s the built-in persistence.xml in use.
polaris.persistence.eclipselink.persistenceUnitpolarisDefine the name of the persistence unit to use, as defined in the persistence.xml.
polaris.realm-context.typedefaultDefine the type of the Polaris realm to use.
polaris.realm-context.realmsPOLARISDefine the list of realms to use.
polaris.realm-context.header-namePolaris-RealmDefine the header name defining the realm context.
polaris.features.defaults."ENFORCE_PRINCIPAL_CREDENTIAL_ROTATION_REQUIRED_CHECKING"falseFlag to enforce check if credential rotation.
polaris.features.defaults."SUPPORTED_CATALOG_STORAGE_TYPES"FILEDefine the catalog supported storage. Supported values are S3, GCS, AZURE, FILE.
polaris.features.realm-overrides."my-realm"."INITIALIZE_DEFAULT_CATALOG_FILEIO_FOR_TEST"true“Override” realm features, here the catalog init default flag.
polaris.features.realm-overrides."my-realm"."SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION"true“Override” realm features, here the skip credential subscoping indirection flag.
polaris.authentication.authenticator.typedefaultDefine the Polaris authenticator type.
polaris.authentication.token-service.typedefaultDefine the Polaris token service type.
polaris.authentication.token-broker.typersa-key-pairDefine the Polaris token broker type.
polaris.authentication.token-broker.max-token-generationPT1HDefine the max token generation policy on the token broker.
polaris.authentication.token-broker.rsa-key-pair.public-key-file/tmp/public.keyDefine the location of the public key file.
polaris.authentication.token-broker.rsa-key-pair.private-key-file/tmp/private.keyDefine the location of the private key file.
polaris.authentication.token-broker.symmetric-key.secretsecretDefine the secret of the symmetric key.
polaris.authentication.token-broker.symmetric-key.file/tmp/symmetric.keyDefine the location of the symmetric key file.
polaris.storage.aws.access-keyaccessKeyDefine the AWS S3 access key. If unset, the default credential provider chain will be used.
polaris.storage.aws.secret-keysecretKeyDefine the AWS S3 secret key. If unset, the default credential provider chain will be used.
polaris.storage.gcp.tokentokenDefine the Google Cloud Storage token. If unset, the default credential provider chain will be used.
polaris.storage.gcp.lifespanPT1HDefine the Google Cloud Storage lifespan type. If unset, the default credential provider chain will be used.
polaris.log.request-id-header-namePolaris-Request-IdDefine the header name to match request ID in the log.
polaris.log.mdc.aidpolarisDefine the log context (e.g. MDC) AID.
polaris.log.mdc.sidpolaris-serviceDefine the log context (e.g. MDC) SID.
polaris.rate-limiter.filter.typeno-opDefine the Polaris rate limiter. Supported values are no-op, token-bucket.
polaris.rate-limiter.token-bucket.typedefaultDefine the token bucket rate limiter.
polaris.rate-limiter.token-bucket.requests-per-second9999Define the number of requests per second for the token bucket rate limiter.
polaris.rate-limiter.token-bucket.windowPT10SDefine the window type for the token bucket rate limiter.
polaris.metrics.tags.applicationPolarisDefine the application name tag in metrics.
polaris.metrics.tags.servicepolarisDefine the service tag in metrics.
polaris.metrics.tags.environmentprodDefine the environement tag in metrics.
polaris.metrics.tags.regionus-west-2Define the region tag in metrics.
polaris.tasks.max-concurrent-tasks100Define the max number of concurrent tasks.
polaris.tasks.max-queued-tasks1000Define the max number of tasks in queue.

There are non Polaris configuration properties that can be useful:

Configuration PropertyDefault ValueDescription
quarkus.log.levelINFODefine the root log level.
quarkus.log.category."org.apache.polaris".levelDefine the log level for a specific category.
quarkus.default-localeSystem localeForce the use of a specific locale, for instance en_US.
quarkus.http.port8181Define the HTTP port number.
quarkus.http.auth.basicfalseEnable the HTTP basic authentication.
quarkus.http.limits.max-body-size10240KDefine the HTTP max body size limit.
quarkus.http.cors.originsDefine the HTTP CORS origins.
quarkus.http.cors.methodsPATCH, POST, DELETE, GET, PUTDefine the HTTP CORS covered methods.
quarkus.http.cors.headers*Define the HTTP CORS covered headers.
quarkus.http.cors.exposed-headers*Define the HTTP CORS covered exposed headers.
quarkus.http.cors.access-control-max-agePT10MDefine the HTTP CORS access control max age.
quarkus.http.cors.access-control-allow-credentialstrueDefine the HTTP CORS access control allow credentials flag.
quarkus.management.enabledtrueEnable the management server.
quarkus.management.port8182Define the port number of the Polaris management server.
quarkus.management.root-pathDefine the root path where /metrics and /health endpoints are based on.
quarkus.otel.sdk.disabledtrueEnable the OpenTelemetry layer.

Java Runtime Configuration

Note: This section is only relevant for Polaris Docker images and Kubernetes deployments.

There are many other actionable environment variables available in the official Polaris Docker image; they come from the base image used by Polaris, ubi9/openjdk-21-runtime. They should be used to fine-tune the Java runtime directly, e.g. to enable debugging or to set the heap size. These variables are not specific to Polaris, but are inherited from the base image. If in doubt, leave everything at its default!

Environment variableDescription
JAVA_OPTS or JAVA_OPTIONSNOT RECOMMENDED. JVM options passed to the java command (example: “-verbose:class”). Setting this variable will override all options set by any of the other variables in this table. To pass extra settings, use JAVA_OPTS_APPEND instead.
JAVA_OPTS_APPENDUser specified Java options to be appended to generated options in JAVA_OPTS (example: “-Dsome.property=foo”).
JAVA_TOOL_OPTIONSThis variable is defined and honored by all OpenJDK distros, see here. Options defined here take precedence over all else; using this variable is generally not necessary, but can be useful e.g. to enforce JVM startup parameters, to set up remote debug, or to define JVM agents.
JAVA_MAX_MEM_RATIOIs used to calculate a default maximal heap memory based on a containers restriction. If used in a container without any memory constraints for the container then this option has no effect. If there is a memory constraint then -XX:MaxRAMPercentage is set to a ratio of the container available memory as set here. The default is 80 which means 80% of the available memory is used as an upper boundary. You can skip this mechanism by setting this value to 0 in which case no -XX:MaxRAMPercentage option is added.
JAVA_DEBUGIf set remote debugging will be switched on. Disabled by default (example: true").
JAVA_DEBUG_PORTPort used for remote debugging. Defaults to “5005” (tip: use “*:5005” to enable debugging on all network interfaces).
GC_MIN_HEAP_FREE_RATIOMinimum percentage of heap free after GC to avoid expansion. Default is 10.
GC_MAX_HEAP_FREE_RATIOMaximum percentage of heap free after GC to avoid shrinking. Default is 20.
GC_TIME_RATIOSpecifies the ratio of the time spent outside the garbage collection. Default is 4.
GC_ADAPTIVE_SIZE_POLICY_WEIGHTThe weighting given to the current GC time versus previous GC times. Default is 90.
GC_METASPACE_SIZEThe initial metaspace size. There is no default (example: “20”).
GC_MAX_METASPACE_SIZEThe maximum metaspace size. There is no default (example: “100”).
GC_CONTAINER_OPTIONSSpecify Java GC to use. The value of this variable should contain the necessary JRE command-line options to specify the required GC, which will override the default of -XX:+UseParallelGC (example: -XX:+UseG1GC).
Here are some examples:
Exampledocker run option
Using another GC-e GC_CONTAINER_OPTIONS="-XX:+UseShenandoahGC" lets Polaris use Shenandoah GC instead of the default parallel GC.
Set the Java heap size to a fixed amount-e JAVA_OPTS_APPEND="-Xms8g -Xmx8g" lets Polaris use a Java heap of 8g.
Set the maximum heap percentage-e JAVA_MAX_MEM_RATIO="70" lets Polaris use 70% percent of the available memory.

Troubleshooting Configuration Issues

If you encounter issues with the configuration, you can ask Polaris to print out the configuration it is using. To do this, set the log level for the io.smallrye.config category to DEBUG, and also set the console appender level to DEBUG:

quarkus.log.console.level=DEBUG
quarkus.log.category."io.smallrye.config".level=DEBUG

[!IMPORTANT] This will print out all configuration values, including sensitive ones like passwords. Don’t do this in production, and don’t share this output with anyone you don’t trust!