Chapter 9. Customizing Red Hat Quay on OpenShift Container Platform
After deployment, you can customize the Red Hat Quay application by editing the Red Hat Quay configuration bundle secret spec.configBundleSecret
. You can also change the managed status of components and configure resource requests for some components in the spec.components
object of the QuayRegistry
resource.
9.1. Editing the config bundle secret in the OpenShift Container Platform console
Use the following procedure to edit the config bundle secret in the OpenShift Container Platform console.
Procedure
On the Red Hat Quay Registry overview screen, click the link for the Config Bundle Secret.
To edit the secret, click Actions
Edit Secret. Modify the configuration and save the changes.
- Monitor the deployment to ensure successful completion and that the configuration changes have taken effect.
9.2. Determining QuayRegistry endpoints and secrets
Use the following procedure to find QuayRegistry
endpoints and secrets.
Procedure
You can examine the
QuayRegistry
resource, usingoc describe quayregistry
oroc get quayregistry -o yaml
, to find the current endpoints and secrets by entering the following command:oc get quayregistry example-registry -n quay-enterprise -o yaml
$ oc get quayregistry example-registry -n quay-enterprise -o yaml
Copy to Clipboard Copied! Example output
apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: ... name: example-registry namespace: quay-enterprise ... spec: components: - kind: quay managed: true ... - kind: clairpostgres managed: true configBundleSecret: init-config-bundle-secret status: currentVersion: 3.7.0 lastUpdated: 2022-05-11 13:28:38.199476938 +0000 UTC registryEndpoint: https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org
apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: ... name: example-registry namespace: quay-enterprise ... spec: components: - kind: quay managed: true ... - kind: clairpostgres managed: true configBundleSecret: init-config-bundle-secret
1 status: currentVersion: 3.7.0 lastUpdated: 2022-05-11 13:28:38.199476938 +0000 UTC registryEndpoint: https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org
2 Copy to Clipboard Copied!
9.3. Modifying the configuration file by using the CLI
You can modify the config.yaml
file that is stored by the configBundleSecret
by downloading the existing configuration using the CLI. After making changes, you can re-upload the configBundleSecret
resource to make changes to the Red Hat Quay registry.
Modifying the config.yaml
file that is stored by the configBundleSecret
resource is a multi-step procedure that requires base64 decoding the existing configuration file and then uploading the changes. For most cases, using the OpenShift Container Platform web console to make changes to the config.yaml
file is simpler.
Prerequisites
- You are logged in to the OpenShift Container Platform cluster as a user with admin privileges.
Procedure
Describe the
QuayRegistry
resource by entering the following command:oc describe quayregistry -n <quay_namespace>
$ oc describe quayregistry -n <quay_namespace>
Copy to Clipboard Copied! ... ...
# ... Config Bundle Secret: example-registry-config-bundle-v123x # ...
Copy to Clipboard Copied! Obtain the secret data by entering the following command:
oc get secret -n <quay_namespace> <example-registry-config-bundle-v123x> -o jsonpath='{.data}'
$ oc get secret -n <quay_namespace> <example-registry-config-bundle-v123x> -o jsonpath='{.data}'
Copy to Clipboard Copied! Example output
{ "config.yaml": "RkVBVFVSRV9VU0 ... MDAwMAo=" }
{ "config.yaml": "RkVBVFVSRV9VU0 ... MDAwMAo=" }
Copy to Clipboard Copied! Decode the data into a YAML file into the current directory by passing in the
>> config.yaml
flag. For example:echo 'RkVBVFVSRV9VU0 ... MDAwMAo=' | base64 --decode >> config.yaml
$ echo 'RkVBVFVSRV9VU0 ... MDAwMAo=' | base64 --decode >> config.yaml
Copy to Clipboard Copied! -
Make the desired changes to your
config.yaml
file, and then save the file asconfig.yaml
. Create a new
configBundleSecret
YAML by entering the following command.touch <new_configBundleSecret_name>.yaml
$ touch <new_configBundleSecret_name>.yaml
Copy to Clipboard Copied! Create the new
configBundleSecret
resource, passing in theconfig.yaml
file` by entering the following command:oc -n <namespace> create secret generic <secret_name> \ --from-file=config.yaml=</path/to/config.yaml> \ --dry-run=client -o yaml > <new_configBundleSecret_name>.yaml
$ oc -n <namespace> create secret generic <secret_name> \ --from-file=config.yaml=</path/to/config.yaml> \
1 --dry-run=client -o yaml > <new_configBundleSecret_name>.yaml
Copy to Clipboard Copied! - 1
- Where
<config.yaml>
is yourbase64 decoded
config.yaml
file.
Create the
configBundleSecret
resource by entering the following command:oc create -n <namespace> -f <new_configBundleSecret_name>.yaml
$ oc create -n <namespace> -f <new_configBundleSecret_name>.yaml
Copy to Clipboard Copied! Example output
secret/config-bundle created
secret/config-bundle created
Copy to Clipboard Copied! Update the
QuayRegistry
YAML file to reference the newconfigBundleSecret
object by entering the following command:oc patch quayregistry <registry_name> -n <namespace> --type=merge -p '{"spec":{"configBundleSecret":"<new_configBundleSecret_name>"}}'
$ oc patch quayregistry <registry_name> -n <namespace> --type=merge -p '{"spec":{"configBundleSecret":"<new_configBundleSecret_name>"}}'
Copy to Clipboard Copied! Example output
quayregistry.quay.redhat.com/example-registry patched
quayregistry.quay.redhat.com/example-registry patched
Copy to Clipboard Copied!
Verification
Verify that the
QuayRegistry
CR has been updated with the newconfigBundleSecret
:oc describe quayregistry -n <quay_namespace>
$ oc describe quayregistry -n <quay_namespace>
Copy to Clipboard Copied! Example output
... ...
# ... Config Bundle Secret: <new_configBundleSecret_name> # ...
Copy to Clipboard Copied! After patching the registry, the Red Hat Quay Operator automatically reconciles the changes.