3.3. 配置数据库

3.3.1. 使用现有的 Postgres 数据库

  1. 使用所需的数据库字段创建配置文件 config.yaml

    config.yaml:

    DB_URI: postgresql://test-quay-database:postgres@test-quay-database:5432/test-quay-database

  2. 使用配置文件创建 Secret:

    $ kubectl create secret generic --from-file config.yaml=./config.yaml config-bundle-secret
  3. 创建 QuayRegistry YAML 文件 quayregistry.yaml,将 postgres 组件标记为非受管状态,并引用所创建的 Secret:

    quayregistry.yaml

    apiVersion: quay.redhat.com/v1
    kind: QuayRegistry
    metadata:
      name: example-registry
      namespace: quay-enterprise
    spec:
      configBundleSecret: config-bundle-secret
      components:
        - kind: postgres
          managed: false

  4. 按照以下部分所述部署 registry。