// Metadata created by nebel
// ParentAssemblies: assemblies/getting-started/as_registry-reference.adoc

[id="registry-liveness-env-vars"]
= Environment variables for {registry} health checks

This section describes the available environment variables for {registry} health checks on OpenShift. These include liveness and readiness probes to monitor the health of the {registry} server on OpenShift. For an example procedure, see xref:configuring-liveness-readiness-probes[].

IMPORTANT: The following environment variables are provided for reference only. The default values are designed for most cases and should only be changed if required by your environment. Any changes to the defaults depend on your hardware, network, and amount of data stored. These values should be kept as low as possible to avoid unnecessary overhead.

[discrete]
== Liveness environment variables 

.Environment variables for {registry} liveness probes
//[%header,cols="5,5,2,5"] 
[.table-expandable,width="100%",cols="5,5,2,5",options="header"]
|===
|Name
|Description
|Type
|Default
|`LIVENESS_ERROR_THRESHOLD`
|Number of liveness issues or errors that can occur before the liveness probe fails.
|Integer
|`1`
|`LIVENESS_COUNTER_RESET`
|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
|Seconds
|`60`
|`LIVENESS_STATUS_RESET`
|Number of seconds that must elapse without any more errors for the liveness probe to reset to OK status. 
|Seconds
|`300`
|`LIVENESS_ERRORS_IGNORED`
|Comma-separated list of ignored liveness exceptions.
|String
|`io.grpc.StatusRuntimeException,org.apache.kafka.streams.errors.InvalidStateStoreException`
|===

NOTE: Because OpenShift automatically restarts a Pod that fails a liveness check, the liveness settings, unlike readiness settings, do not directly affect behavior of {registry} on OpenShift.

[discrete]
== Readiness environment variables

.Environment variables for {registry} readiness probes
//[%header,cols="4,5,2,2"] 
[.table-expandable,width="100%",cols="4,5,2,2",options="header"]
|===
|Name
|Description
|Type
|Default
|`READINESS_ERROR_THRESHOLD`
|Number of readiness issues or errors that can occur before the readiness probe fails.
|Integer
|`1`
|`READINESS_COUNTER_RESET`
|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.
|Seconds
|`60`
|`READINESS_STATUS_RESET`
|Number of seconds that must elapse without any more errors for the liveness probe to reset to OK status. In this case, this means how long the Pod stays not ready, until it returns to normal operation.
|Seconds
|`300`
|`READINESS_TIMEOUT`
a|Readiness tracks the timeout of two operations: 

* How long it takes for storage requests to complete
* How long it takes for HTTP REST API requests to return a response

If these operations take more time than the configured timeout, this is counted as a readiness issue or error. This value controls the timeouts for both operations.
|Seconds
|`5`
|===


.Additional resources
* xref:configuring-liveness-readiness-probes[]
* link:https://docs.openshift.com/container-platform/{registry-ocp-version}/applications/application-health.html[OpenShift documentation on monitoring application health]
//* TBD
