Apicurio Studio

Managing Apicurio Registry deployment

Managing Apicurio Registry environment variables

Apicurio Registry Operator manages most common Apicurio Registry configuration, but there are some options that you can adjust manually. You can update these by setting an environment variable on the Apicurio Registry DeploymentConfig resource. If the specific configuration option is not available in the ApicurioRegistry CR, you can use an environment variable to adjust it.

Procedure
OpenShift web console
  1. Select the Installed Operators tab, and then the Red Hat Integration - Apicurio Registry Operator.

  2. On the ApicurioRegistry tab, click the ApicurioRegistry CR for your Apicurio Registry deployment.

  3. On the main overview page, view the Deployment Name section, which contains the name of the DeploymentConfig managed by the Operator to deploy your Apicurio Registry instance.

  4. Find that DeploymentConfig in the Workloads > Deployment Configs in the left menu.

  5. Select the DeploymentConfig with the correct name, and select the Environment tab.

  6. You can add or modify your environment variable to the Single values (env) section.

  7. Click Save at the bottom.

OpenShift CLI
  1. Select the project where Apicurio Registry is installed.

  2. Run oc get apicurioregistry to get the list of ApicurioRegistry CRs

  3. Run oc describe on the CR representing the Apicurio Registry instance that you want to configure.

  4. View Deployment Name in the status section.

  5. Find that DeploymentConfig and enter oc edit.

  6. Add or modify the environment variable in the spec.template.spec.containers[0].env section.

Apicurio Registry liveness and readiness environment variables

Apicurio Registry provides readiness and liveness probes for OpenShift to ensure application health. These settings are configured to use reasonable defaults, but if you want to adjust them, this section provides details on the environment variables that you can configure.

OpenShift liveness and readiness errors are explained as follows:

  • Liveness error - the application cannot make progress, OpenShift restarts the failing pod.

  • Readiness error - the application is not ready, for example, it is overwhelmed by requests. OpenShift stops sending requests to the pod for the time the probe fails. If other pods are OK, they still receive requests.

Table 1. Apicurio Registry liveness environment variables
Name Value type Description

LIVENESS_ERROR_THRESHOLD

Positive integer

Number of liveness errors that can occur before the liveness probe fails.

LIVENESS_COUNTER_RESET

Positive integer, seconds

Period in which the threshold number of errors must occur. For example, if this value is 60 and the threshold is 1, the check fails after two errors occur in 1 minute.

LIVENESS_STATUS_RESET

Positive integer, seconds

Number of seconds that must elapse without any more errors for the liveness probe to reset to OK status. Because OpenShift restarts the pod that fails the liveness check, this value, unlike readiness, does not actually affect what happens.

LIVENESS_ERRORS_IGNORED

Comma-separated list of fully qualified exception class names.

List of errors that are ignored for liveness checking purposes.

Table 2. Apicurio Registry readiness environment variables
Name Value type Description

READINESS_ERROR_THRESHOLD

Positive integer

Number of readiness errors that can occur before the readiness probe fails.

READINESS_COUNTER_RESET

Positive integer, seconds

Period in which the threshold number of errors must occur. For example, if this value is 60 and the threshold is 1, the check fails after two errors occur in 1 minute.

READINESS_STATUS_RESET

Positive integer, seconds

Number of seconds that must elapse without any more errors for the readiness probe to reset to OK status. In practice, this value means how long the pod remains in an unready state until it returns to normal operation.

READINESS_TIMEOUT

positive integer, seconds

The readiness system tracks the timeout of two operations: how long it takes for a storage request to complete, and how long it takes for an HTTP REST API request to return a response. If the operation takes more time, it is counted as a readiness error. This value controls those timeouts.

Backing up Apicurio Registry PostgreSQL storage

When using Java Peristence API storage in a PostgreSQL database, you must ensure that the data stored by Apicurio Registry is backed up regularly.

SQL Dump is a simple procedure that works with any PostgreSQL installation. This uses the pg_dump utility to generate a file with SQL commands that you can use to recreate the database in the same state that it was in at the time of the dump.

pg_dump is a regular PostgreSQL client application, which you can execute from any remote host that has access to the database. Like any other client, the operations that can perform are limited to the user permissions.

Procedure
  • Use the pg_dump command to redirect the output to a file:

     $ pg_dump dbname > dumpfile

    You can specify the database server that pg_dump connects to using the -h host and -p port options.

  • You can reduce large dump files using a compression tool, such as gzip, for example:

     $ pg_dump dbname | gzip > filename.gz
Additional resources

For details on client authentication, see the PostgreSQL documentation.

Restoring Apicurio Registry PostgreSQL storage

You can restore SQL Dump files created by pg_dump using the psql utility.

Prerequisites
Procedure
  1. Enter the following command to create the database:

     $ createdb -T template0 dbname
  2. Enter the following command to restore the SQL dump

     $ psql dbname < dumpfile
  3. Run ANALYZE on each database so the query optimizer has useful statistics.