Chapter 6. Enabling features after deployment
After deployment, you can customize to the Red Hat Quay registry to enable new features and better suit the needs of your organization. This entails editing the Red Hat Quay configuration bundle secret (spec.configBundleSecret
) resource. You can use the OpenShift Container Platform web console or the command-line interface to enable features after deployment. Using the OpenShift Container Platform web console is generally considered a simpler method.
6.1. Enabling features by using the OpenShift Container Platform web console リンクのコピーリンクがクリップボードにコピーされました!
To enable features in the OpenShift Container Platform web console, you can edit the configBundleSecret
resource.
Prerequisites
- You have have administrative privileges to the cluster.
Procedure
-
On the OpenShift Container Platform web console, click Operators
Installed Operators Red Hat Quay. - Click Quay Registry and then the name of your registry.
-
Under Config Bundle Secret, click the name of your secret, for example,
quay-config-bundle
. -
On the Secret details page, click Actions
Edit secret. - In the Value text box, add the new configuration fields for the features that you want to enable. For a list of all configuration fields, see Configure Red Hat Quay.
- Click Save. The Red Hat Quay Operator automatically reconciles the changes by restarting all Quay-related pods. After all pods are restarted, the features are enabled.
6.2. 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! Toggle word wrap Toggle overflow Example output
... ...
# ... Config Bundle Secret: example-registry-config-bundle-v123x # ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow Example output
{ "config.yaml": "RkVBVFVSRV9VU0 ... MDAwMAo=" }
{ "config.yaml": "RkVBVFVSRV9VU0 ... MDAwMAo=" }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow -
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! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow - 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! Toggle word wrap Toggle overflow Example output
secret/config-bundle created
secret/config-bundle created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow Example output
quayregistry.quay.redhat.com/example-registry patched
quayregistry.quay.redhat.com/example-registry patched
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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! Toggle word wrap Toggle overflow Example output
... ...
# ... Config Bundle Secret: <new_configBundleSecret_name> # ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After patching the registry, the Red Hat Quay Operator automatically reconciles the changes.