How to install Quay using noobaa standalone object gateway

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform

    • 4.7.z
  • Red Hat Quay

    • 3.6.z
  • OpenShift Container Storage Operator

  • Noobaa Standalone Object Gateway

Issue

  • Using default noobaa.yaml (from the original doc) does not make noobaa object storage connection ready

    $ oc get noobaas
    NAME     MGMT-ENDPOINTS                   S3-ENDPOINTS                     IMAGE                                                                                                            
    PHASE        AGE
    noobaa   ["https://10.0.136.204:31790"]   ["https://10.0.136.204:32465"]   registry.redhat.io/ocs4/mcg-core-rhel8@sha256:d64bd6b976f4c5e2a03401838c3d710e3035dd1ab8249a55ed1df3c598963729   Connecting   4h18m
    
  • noobaa-db-pg pod is in CrashLoopBackOff

  • After creating QuayRegistry instance using the default configuration, some of the pods are not created

        $ oc get pods
    
        NAME                                                  READY   STATUS              RESTARTS   AGE
        example-registry-clair-app-57d8fbd965-pnwwg           0/1     ContainerCreating   0          17m
        example-registry-clair-postgres-7cdfcc4f66-cp84l      1/1     Running             1          17m
        example-registry-quay-app-upgrade-7679d6f899-564mx    0/1     Init:0/1            0          17m
        example-registry-quay-config-editor-6f4978549-rvj8t   0/1     ContainerCreating   0          17m
        example-registry-quay-database-699c554446-hpd66       1/1     Running             0          17m
        example-registry-quay-postgres-init-d5x76             0/1     Completed           0          17m
    
  • Quay pod shows error "MountVolume.SetUp failed for volume "certs": secret "example-registry-quay-config-secret-bdc554db2b" not found"

  • All kubernetes objects are not created/updated successfully: failed to create typed patch object: .spec.ObjectBucketName: field not declared in schema

Resolution

Steps to be followed to complete the installation

  • Modify the default noobaa.yaml file and dbType=postgres (this parameter is optional) to complete the noobaa-db pod and have the noobaas/noobaa object connection ready
apiVersion: noobaa.io/v1alpha1
kind: NooBaa
metadata:
  name: noobaa
  namespace: openshift-storage
spec:
 dbType: postgres <----- optional parameter
 dbResources:
   requests:
     cpu: '0.5'
     memory: 1Gi
 coreResources:
   requests:
     cpu: '0.5'
     memory: 1Gi
  • Create noobaa object bucket claims from Web UI under storage and get the details of:

     access_key: Nh1XurrnYGAZIVql5tbB <---- change as yours
     bucket_name: quay-obc-2434c00e-fe97  <---- change as yours
     hostname: s3.openshift-storage.svc
     secret_key: w95BRN0LpfBPpDPzA3hdiv  <--- change as yours
    
  • Create Quay config.yaml file by including the above object bucket claims for Quay application

    DISTRIBUTED_STORAGE_CONFIG:
        default:
            - RHOCSStorage
            - access_key: Nh1XurrnYGAZIVql5tbB <---- change as yours
              bucket_name: quay-obc-2434c00e-fe97 <---- change as yours
              hostname: s3.openshift-storage.svc
              is_secure: true
              port: "443"
              secret_key: w95BRN0LpfBPpDPzA3hdiv <--- change as yours
              storage_path: /datastorage/registry
    DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
    DISTRIBUTED_STORAGE_PREFERENCE:
      - default
    
  • Create a secret using the above config.yaml file:

    $ oc create secret generic config-bundle-secret --from-file config.yaml=./config.yaml
    $ oc get secret
    config-bundle-secret
    
  • Create a custom QuayRegistry yaml file "quayregistry.yaml" by making "objectstorage=unmanged" as shown below:

    apiVersion: quay.redhat.com/v1
    kind: QuayRegistry
    metadata:
      name: example
    spec:
      configBundleSecret: config-bundle-secret
      components:
        - kind: objectstorage
          managed: false
    
  • Create QuayRegistry instance:

        $ oc create -f quayregistry.yaml 
        $ oc get pods -n openshift-storage
    
        NAME                                          READY   STATUS      RESTARTS   AGE
        noobaa-core-0                                 1/1     Running     0          116m
        noobaa-db-pg-0                                1/1     Running     0          116m
        noobaa-endpoint-644cff5755-575hj              1/1     Running     0          114m
        noobaa-operator-6f4c7759b6-w5lgr              1/1     Running     0          120m
        ocs-metrics-exporter-5dcdb9c7dc-dkgkg         1/1     Running     0          120m
        ocs-operator-c96d885fc-vxbvm                  1/1     Running     0          120m
        rook-ceph-operator-866dd8c777-6tbld           1/1     Running     0          120m
        example-clair-app-59978db8f4-s2j9m            1/1     Running     0          11m
        example-clair-postgres-5b97b46d78-lmr7p       1/1     Running     1          12m
        example-quay-app-97f65b785-gqhvn              1/1     Running     0          11m
        example-quay-config-editor-5698bd98d8-7d9jd   1/1     Running     0          11m
        example-quay-database-6d7d85ccfb-pskjv        1/1     Running     0          11m
        example-quay-mirror-5c97656fdd-xh22v          1/1     Running     0          10m
        example-quay-postgres-init-wwkm7              0/1     Completed   0          11m
        example-quay-redis-89f7555c9-vrvb9            1/1     Running     0          12m
    

Root Cause

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.