Questo contenuto non è disponibile nella lingua selezionata.
Chapter 5. Using the Quay Bridge Operator
Use the following procedure to use the Quay Bridge Operator.
Prerequisites
- You have installed the Red Hat Quay Operator.
- You have logged into OpenShift Container Platform as a cluster administrator.
- You have logged into your Red Hat Quay registry.
- You have installed the Quay Bridge Operator.
- 
					You have configured the QuayIntegrationcustom resource.
Procedure
- Enter the following command to create a new OpenShift Container Platform project called - e2e-demo:- oc new-project e2e-demo - $ oc new-project e2e-demo- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After you have created a new project, a new Organization is created in Red Hat Quay. Navigate to the Red Hat Quay registry and confirm that you have created a new Organization named - openshift_e2e-demo.Note- The - openshiftvalue of the Organization might different if the clusterID in your- QuayIntegrationresource used a different value.
- On the Red Hat Quay UI, click the name of the new Organization, for example, openshift_e2e-demo.
- Click Robot Accounts in the navigation pane. As part of new project, the following Robot Accounts should have been created: - openshift_e2e-demo+deployer
- openshift_e2e-demo+default
- openshift_e2e-demo+builder
 
- Enter the following command to confirm three secrets containing Docker configuration associated with the applicable Robot Accounts were created: - oc get secrets builder-quay-openshift deployer-quay-openshift default-quay-openshift - $ oc get secrets builder-quay-openshift deployer-quay-openshift default-quay-openshift- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - stevsmit@stevsmit ocp-quay $ oc get secrets builder-quay-openshift deployer-quay-openshift default-quay-openshift NAME TYPE DATA AGE builder-quay-openshift kubernetes.io/dockerconfigjson 1 77m deployer-quay-openshift kubernetes.io/dockerconfigjson 1 77m default-quay-openshift kubernetes.io/dockerconfigjson 1 77m - stevsmit@stevsmit ocp-quay $ oc get secrets builder-quay-openshift deployer-quay-openshift default-quay-openshift NAME TYPE DATA AGE builder-quay-openshift kubernetes.io/dockerconfigjson 1 77m deployer-quay-openshift kubernetes.io/dockerconfigjson 1 77m default-quay-openshift kubernetes.io/dockerconfigjson 1 77m- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following command to display detailed information about - builderServiceAccount (SA), including its secrets, token expiration, and associated roles and role bindings. This ensures that the project is integrated via the Quay Bridge Operator.- oc describe sa builder default deployer - $ oc describe sa builder default deployer- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Enter the following command to create and deploy a new application called - httpd-template:- oc new-app --template=httpd-example - $ oc new-app --template=httpd-example- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - After running this command, - BuildConfig,- ImageStream,- Service,- Route, and- DeploymentConfigresources are created. When the- ImageStreamresource is created, an associated repository is created in Red Hat Quay.
- The - ImageChangeTriggerfor the- BuildConfigtriggers a new Build when the Apache HTTPD image, located in the- openshiftnamespace, is resolved. As the new Build is created, the- MutatingWebhookConfigurationautomatically rewriters the output to point at Red Hat Quay. You can confirm that the build is complete by querying the output field of the build by running the following command:- oc get build httpd-example-1 --template='{{ .spec.output.to.name }}'- $ oc get build httpd-example-1 --template='{{ .spec.output.to.name }}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - example-registry-quay-quay-enterprise.apps.quay-ocp.gcp.quaydev.org/openshift_e2e-demo/httpd-example:latest - example-registry-quay-quay-enterprise.apps.quay-ocp.gcp.quaydev.org/openshift_e2e-demo/httpd-example:latest- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 
					On the Red Hat Quay UI, navigate to the openshift_e2e-demoOrganization and select the httpd-example repository.
- 
					Click Tags in the navigation pane and confirm that the latesttag has been successfully pushed.
- Enter the following command to ensure that the latest tag has been resolved: - oc describe is httpd-example - $ oc describe is httpd-example- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After the - ImageStreamis resolved, a new deployment should have been triggered. Enter the following command to generate a URL output:- oc get route httpd-example --template='{{ .spec.host }}'- $ oc get route httpd-example --template='{{ .spec.host }}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - httpd-example-e2e-demo.apps.quay-ocp.gcp.quaydev.org - httpd-example-e2e-demo.apps.quay-ocp.gcp.quaydev.org- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Navigate to the URL. If a sample webpage appears, the deployment was successful.
- Enter the following command to delete the resources and clean up your Red Hat Quay repository: - oc delete project e2e-demo - $ oc delete project e2e-demo- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Note- The command waits until the project resources have been removed. This can be bypassed by adding the - --wait=falseto the above command
- 
					After the command completes, navigate to your Red Hat Quay repository and confirm that the openshift_e2e-demoOrganization is no longer available.
Additional resources
- Best practices dictate that all communication between a client and an image registry be facilitated through secure means. Communication should leverage HTTPS/TLS with a certificate trust between the parties. While Red Hat Quay can be configured to serve an insecure configuration, proper certificates should be utilized on the server and configured on the client. Follow the OpenShift Container Platform documentation for adding and managing certificates at the container runtime level.