Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Deploying the Red Hat Quay registry
To deploy the Red Hat Quay registry after installing the Operator, you can create a QuayRegistry custom resource using the OpenShift Container Platform web console or the oc CLI. Ensure you have an object storage provider configured before deployment.
The following sections provide you with the information necessary to configure managed or unmanaged object storage, and then deploy the Red Hat Quay registry.
The following procedures show you how to create a basic Red Hat Quay registry in all namespaces of the OpenShift Container Platform deployment. Depending on your needs, advanced configuration might be necessary. For example, you might need to configure SSL/TLS for your deployment or disable certain components. Advanced configuration practices are covered in later chapters of this guide.
3.1. Deploying the Red Hat Quay registry by using the OpenShift Container Platform web console Copiar o linkLink copiado para a área de transferência!
To deploy a basic Red Hat Quay registry instance, you can use the OpenShift Container Platform web console to create a QuayRegistry custom resource. You configure managed or unmanaged object storage during the deployment process.
Prerequisites
- You have installed the Red Hat Quay Operator.
- You have have administrative privileges to the cluster.
Procedure
-
On the OpenShift Container Platform web console, click Operators
Installed Operators Red Hat Quay. - On the Red Hat Quay dashboard, click Create instance.
On the Create QuayRegistry page, review the default settings of the
QuayRegistrycustom resource (CR). Here, you decide whether to to use managed or unmanaged object storage.If you are using the Multicloud Object Gateway or Red Hat OpenShift Data Foundation as your object storage, keep the following settings:
- kind: objectstorage managed: trueIf you are using a different storage provider, such as Google Cloud Platform, AWS S3, or Nutanix, set the
objectstoragecomponent as follows:- kind: objectstorage managed: false
- Click Create. You are redirected to the Quay Registry tab on the Operator page.
Click the name of the Red Hat Quay registry that you created, then click Events to view the status of creation. If you used managed storage and leveraged the Multicloud Object Gateway, the registry completes creation. If you are using Red Hat OpenShift Data Foundation or an unmanaged storage backend provider, complete the following steps:
- Click the Details page of the Red Hat Quay registry.
- Click the name of the Config Bundle Secret resource, for example, <example_registry_name_config-bundle-secret-12345>.
Click Actions
Edit Secret, and pass in the following information from your backend storage provider: # ... DISTRIBUTED_STORAGE_CONFIG: <storage_provider>: - <storage_provider_name> - access_key: <access_key> bucket_name: <bucket_name> secret_key: <secret_key> storage_path: /datastorage/registry # ...NoteDepending on your storage provider, different information is required. For more information, see see Storage object configuration fields.
- Click Save, and then re-navigate to the Events page of the registry to ensure successful deployment.
3.2. Deploying the Red Hat Quay registry by using the CLI Copiar o linkLink copiado para a área de transferência!
To deploy a basic Red Hat Quay registry instance, you can use the oc CLI to create a QuayRegistry custom resource. You configure managed or unmanaged object storage during the deployment process.
The following config.yaml file includes automation configuration options. Collectively, these options streamline using the CLI with your registry, helping reduce dependency on the UI. Adding these fields to your config.yaml file is optional if you plan to use the UI, but recommended if you plan to use the CLI.
For more information, see Automation configuration options.
Prerequisites
- You have logged into OpenShift Container Platform using the CLI.
Procedure
Create a namespace, for example,
quay-enterprise, by entering the following command:$ oc new-project quay-enterpriseCreate the
QuayRegistrycustom resource (CR).If the
objectstoragecomponent is set tomanaged: true, complete the following steps:Create the
QuayRegistryCR by entering the following command:$ cat <<EOF | oc create -n quay-enterprise -f - apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: example-registry namespace: quay-enterprise EOF
If the
objectstoragecomponent is set tomanaged: false, complete the following steps:Create the
config.yamlfile for Red Hat Quay by entering the following command. You must include the information required for your backend storage provider. During this step, you can enable additional Red Hat Quay features. The following example is for a minimal configuration that includes the configuration options for automating early setup tasks:$ cat <<EOF > config.yaml ALLOW_PULLS_WITHOUT_STRICT_LOGGING: false AUTHENTICATION_TYPE: Database DEFAULT_TAG_EXPIRATION: 2w FEATURE_USER_INITIALIZE: true SUPER_USERS: - <username> BROWSER_API_CALLS_XHR_ONLY: false FEATURE_USER_CREATION: false DISTRIBUTED_STORAGE_CONFIG: <storage_provider>: - <storage_provider_name> - access_key: <access_key> bucket_name: <bucket_name> secret_key: <secret_key> storage_path: /datastorage/registry ENTERPRISE_LOGO_URL: /static/img/RH_Logo_Quay_Black_UX-horizontal.svg FEATURE_BUILD_SUPPORT: false FEATURE_DIRECT_LOGIN: true FEATURE_MAILING: false REGISTRY_TITLE: Red Hat Quay REGISTRY_TITLE_SHORT: Red Hat Quay SETUP_COMPLETE: true TAG_EXPIRATION_OPTIONS: - 2w TEAM_RESYNC_STALE_TIME: 60m TESTING: false EOF-
FEATURE_USER_INITIALIZE: Set this field totrueif you plan to create the first user by using API. -
SUPER_USERS: Include this field and the username that you plan to leverage as a Red Hat Quay administrator. -
BROWSER_API_CALLS_XHR_ONLY: Set this field tofalseto allow general browser-based access to the API. -
FEATURE_USER_CREATION: Set this field tofalseto relegate the creation of new users to only superusers.
-
Create a secret for the configuration by entering the following command:
$ oc create secret generic <quay_config_bundle_name> \ --from-file=config.yaml=</path/to/config.yaml> \ -n quay-enterprise \ --dry-run=client -o yaml | oc apply -f -Create the
QuayRegistryCR by entering the following command:$ cat <<EOF | oc create -n quay-enterprise -f - apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: example-registry namespace: quay-enterprise spec: configBundleSecret: <quay_config_bundle_name> components: - kind: clair managed: true - kind: objectstorage managed: false - kind: mirror managed: true - kind: monitoring managed: true EOFobjectstorage: Set this field tofalsewhen providing your own storage backend.
Verification
Check the status of your registry by entering the following command:
$ oc describe quayregistry <registry_name> -n quay-enterprise... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ComponentsCreationSuccess 23s (x2458 over 42h) quayregistry-controller All objects created/updated successfully- Alternatively, you can check pod statuses for your registry deployment by entering the following command:
Enter the following command to view the deployed components:
$ oc get pods -n quay-enterpriseNAME READY STATUS RESTARTS AGE example-registry-clair-app-5ffc9f77d6-jwr9s 1/1 Running 0 3m42s example-registry-clair-app-5ffc9f77d6-wgp7d 1/1 Running 0 3m41s example-registry-clair-postgres-54956d6d9c-rgs8l 1/1 Running 0 3m5s example-registry-quay-app-79c6b86c7b-8qnr2 1/1 Running 4 3m42s example-registry-quay-app-79c6b86c7b-xk85f 1/1 Running 4 3m41s example-registry-quay-app-upgrade-5kl5r 0/1 Completed 4 3m50s example-registry-quay-database-b466fc4d7-tfrnx 1/1 Running 2 3m42s example-registry-quay-mirror-6d9bd78756-6lj6p 1/1 Running 0 2m58s example-registry-quay-mirror-6d9bd78756-bv6gq 1/1 Running 0 2m58s example-registry-quay-postgres-init-dzbmx 0/1 Completed 0 3m43s example-registry-quay-redis-8bd67b647-skgqx 1/1 Running 0 3m42s
Additional resources