Chapter 3. Configuring Red Hat Quay before deployment
The Red Hat Quay Operator can manage all of the Red Hat Quay components when deployed on OpenShift Container Platform. This is the default configuration, however, you can manage one or more components externally when you want more control over the set up.
Use the following pattern to configure unmanaged Red Hat Quay components.
Procedure
Create a
config.yamlconfiguration file with the appropriate settings. Use the following reference for a minimal configuration:touch config.yaml
$ touch config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Secretusing the configuration file by entering the following command:oc create secret generic --from-file config.yaml=./config.yaml config-bundle-secret
$ oc create secret generic --from-file config.yaml=./config.yaml config-bundle-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
quayregistry.yamlfile, identifying the unmanaged components and also referencing the createdSecret, for example:Example
QuayRegistryYAML fileCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the following command to deploy the registry by using the
quayregistry.yamlfile:oc create -n quay-enterprise -f quayregistry.yaml
$ oc create -n quay-enterprise -f quayregistry.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1. Pre-configuring Red Hat Quay for automation Copy linkLink copied to clipboard!
Red Hat Quay supports several configuration options that enable automation. Users can configure these options before deployment to reduce the need for interaction with the user interface.
3.1.1. Allowing the API to create the first user Copy linkLink copied to clipboard!
To create the first user, users need to set the FEATURE_USER_INITIALIZE parameter to True and call the /api/v1/user/initialize API. Unlike all other registry API calls that require an OAuth token generated by an OAuth application in an existing organization, the API endpoint does not require authentication.
Users can use the API to create a user such as quayadmin after deploying Red Hat Quay, provided no other users have been created. For more information, see Using the API to create the first user.
3.1.2. Enabling general API access Copy linkLink copied to clipboard!
Users should set the BROWSER_API_CALLS_XHR_ONLY configuration option to False to allow general access to the Red Hat Quay registry API.
3.1.3. Adding a superuser Copy linkLink copied to clipboard!
After deploying Red Hat Quay, users can create a user and give the first user administrator privileges with full permissions. Users can configure full permissions in advance by using the SUPER_USER configuration object. For example:
3.1.4. Restricting user creation Copy linkLink copied to clipboard!
After you have configured a superuser, you can restrict the ability to create new users to the superuser group by setting the FEATURE_USER_CREATION to False. For example:
3.1.5. Enabling new functionality in Red Hat Quay 3.11 Copy linkLink copied to clipboard!
To use new Red Hat Quay 3.11 functions, enable some or all of the following features:
3.1.6. Suggested configuration for automation Copy linkLink copied to clipboard!
The following config.yaml parameters are suggested for automation:
3.2. Configuring object storage Copy linkLink copied to clipboard!
You need to configure object storage before installing Red Hat Quay, irrespective of whether you are allowing the Red Hat Quay Operator to manage the storage or managing it yourself.
If you want the Red Hat Quay Operator to be responsible for managing storage, see the section on Managed storage for information on installing and configuring NooBaa and the Red Hat OpenShift Data Foundations Operator.
If you are using a separate storage solution, set objectstorage as unmanaged when configuring the Operator. See the following section. Unmanaged storage, for details of configuring existing storage.
3.2.1. Using unmanaged storage Copy linkLink copied to clipboard!
This section provides configuration examples for unmanaged storage for your convenience. Refer to the Red Hat Quay configuration guide for complete instructions on how to set up object storage.
3.2.1.1. AWS S3 storage Copy linkLink copied to clipboard!
Use the following example when configuring AWS S3 storage for your Red Hat Quay deployment.
3.2.1.2. Google Cloud storage Copy linkLink copied to clipboard!
Use the following example when configuring Google Cloud storage for your Red Hat Quay deployment.
- 1
- Optional. The time, in seconds, until a timeout exception is thrown when attempting to read from a connection. The default is
60seconds. Also encompasses the time, in seconds, until a timeout exception is thrown when attempting to make a connection. The default is60seconds.
3.2.1.3. Microsoft Azure storage Copy linkLink copied to clipboard!
Use the following example when configuring Microsoft Azure storage for your Red Hat Quay deployment.
- 1
- The
endpoint_urlparameter for Microsoft Azure storage is optional and can be used with Microsoft Azure Government (MAG) endpoints. If left blank, theendpoint_urlwill connect to the normal Microsoft Azure region.As of Red Hat Quay 3.7, you must use the Primary endpoint of your MAG Blob service. Using the Secondary endpoint of your MAG Blob service will result in the following error:
AuthenticationErrorDetail:Cannot find the claimed account when trying to GetProperties for the account whusc8-secondary.
3.2.1.4. Ceph/RadosGW Storage Copy linkLink copied to clipboard!
Use the following example when configuring Ceph/RadosGW storage for your Red Hat Quay deployment.
3.2.1.5. Swift storage Copy linkLink copied to clipboard!
Use the following example when configuring Swift storage for your Red Hat Quay deployment.
3.2.1.6. NooBaa unmanaged storage Copy linkLink copied to clipboard!
Use the following procedure to deploy NooBaa as your unmanaged storage configuration.
Procedure
-
Create a NooBaa Object Bucket Claim in the Red Hat Quay console by navigating to Storage
Object Bucket Claims. - Retrieve the Object Bucket Claim Data details, including the Access Key, Bucket Name, Endpoint (hostname), and Secret Key.
Create a
config.yamlconfiguration file that uses the information for the Object Bucket Claim:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information about configuring an Object Bucket Claim, see Object Bucket Claim.
3.2.2. Using an unmanaged NooBaa instance Copy linkLink copied to clipboard!
Use the following procedure to use an unmanaged NooBaa instance for your Red Hat Quay deployment.
Procedure
-
Create a NooBaa Object Bucket Claim in the console at Storage
Object Bucket Claims. -
Retrieve the Object Bucket Claim Data details including the
Access Key,Bucket Name,Endpoint (hostname), andSecret Key. Create a
config.yamlconfiguration file using the information for the Object Bucket Claim. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.3. Managed storage Copy linkLink copied to clipboard!
If you want the Red Hat Quay Operator to manage object storage for Red Hat Quay, your cluster needs to be capable of providing object storage through the ObjectBucketClaim API. Using the Red Hat OpenShift Data Foundation Operator, there are two supported options available:
A standalone instance of the Multi-Cloud Object Gateway backed by a local Kubernetes
PersistentVolumestorage- Not highly available
- Included in the Red Hat Quay subscription
- Does not require a separate subscription for Red Hat OpenShift Data Foundation
A production deployment of Red Hat OpenShift Data Foundation with scale-out Object Service and Ceph
- Highly available
- Requires a separate subscription for Red Hat OpenShift Data Foundation
To use the standalone instance option, continue reading below. For production deployment of Red Hat OpenShift Data Foundation, please refer to the official documentation.
Object storage disk space is allocated automatically by the Red Hat Quay Operator with 50 GiB. This number represents a usable amount of storage for most small to medium Red Hat Quay installations but might not be sufficient for your use cases. Resizing the Red Hat OpenShift Data Foundation volume is currently not handled by the Red Hat Quay Operator. See the section below about resizing managed storage for more details.
3.2.3.1. Leveraging the Multicloud Object Gateway Component in the Red Hat OpenShift Data Foundation Operator for Red Hat Quay Copy linkLink copied to clipboard!
As part of a Red Hat Quay subscription, users are entitled to use the Multicloud Object Gateway component of the Red Hat OpenShift Data Foundation Operator (formerly known as OpenShift Container Storage Operator). This gateway component allows you to provide an S3-compatible object storage interface to Red Hat Quay backed by Kubernetes PersistentVolume-based block storage. The usage is limited to a Red Hat Quay deployment managed by the Operator and to the exact specifications of the multicloud Object Gateway instance as documented below.
Since Red Hat Quay does not support local filesystem storage, users can leverage the gateway in combination with Kubernetes PersistentVolume storage instead, to provide a supported deployment. A PersistentVolume is directly mounted on the gateway instance as a backing store for object storage and any block-based StorageClass is supported.
By the nature of PersistentVolume, this is not a scale-out, highly available solution and does not replace a scale-out storage system like Red Hat OpenShift Data Foundation. Only a single instance of the gateway is running. If the pod running the gateway becomes unavailable due to rescheduling, updates or unplanned downtime, this will cause temporary degradation of the connected Red Hat Quay instances.
Deploying Red Hat Quay on OpenShift Container Platform using Red Hat OpenShift Data Foundation requires you to download the Local Storage Operator, the Red Hat OpenShift Data Foundation Operator, and then deploy a standalone Multicloud Object Gateway using the OpenShift Container Platform UI. See the following Red Hat OpenShift Data Foundation documentation for these steps: