第 9 章 监控和调试部署过程


用户现在可以在部署阶段排除问题。QuayRegistry 对象中的状态可帮助您在部署期间监控组件的健康状况,可帮助您调试可能出现的任何问题。

流程

  1. 输入以下命令检查部署的状态:

    $ oc get quayregistry -n quay-enterprise -o yaml
    Copy to Clipboard Toggle word wrap

    输出示例

    部署后,Quay Registry 对象将显示基本配置:

    apiVersion: v1
    items:
    - apiVersion: quay.redhat.com/v1
      kind: QuayRegistry
      metadata:
        creationTimestamp: "2021-09-14T10:51:22Z"
        generation: 3
        name: example-registry
        namespace: quay-enterprise
        resourceVersion: "50147"
        selfLink: /apis/quay.redhat.com/v1/namespaces/quay-enterprise/quayregistries/example-registry
        uid: e3fc82ba-e716-4646-bb0f-63c26d05e00e
      spec:
        components:
        - kind: postgres
          managed: true
        - kind: clair
          managed: true
        - kind: redis
          managed: true
        - kind: horizontalpodautoscaler
          managed: true
        - kind: objectstorage
          managed: true
        - kind: route
          managed: true
        - kind: mirror
          managed: true
        - kind: monitoring
          managed: true
        - kind: tls
          managed: true
        - kind: clairpostgres
          managed: true
        configBundleSecret: example-registry-config-bundle-kt55s
    kind: List
    metadata:
      resourceVersion: ""
      selfLink: ""
    Copy to Clipboard Toggle word wrap
  2. 使用 oc get pods 命令查看部署组件的当前状态:

    $ oc get pods -n quay-enterprise
    Copy to Clipboard Toggle word wrap

    输出示例

    NAME                                                   READY   STATUS              RESTARTS   AGE
    example-registry-clair-app-86554c6b49-ds7bl            0/1     ContainerCreating   0          2s
    example-registry-clair-app-86554c6b49-hxp5s            0/1     Running             1          17s
    example-registry-clair-postgres-68d8857899-lbc5n       0/1     ContainerCreating   0          17s
    example-registry-quay-app-upgrade-h2v7h                0/1     ContainerCreating   0          9s
    example-registry-quay-database-66f495c9bc-wqsjf        0/1     ContainerCreating   0          17s
    example-registry-quay-mirror-854c88457b-d845g          0/1     Init:0/1            0          2s
    example-registry-quay-mirror-854c88457b-fghxv          0/1     Init:0/1            0          17s
    example-registry-quay-postgres-init-bktdt              0/1     Terminating         0          17s
    example-registry-quay-redis-f9b9d44bf-4htpz            0/1     ContainerCreating   0          17s
    Copy to Clipboard Toggle word wrap

  3. 在部署进行过程中,Quay Registry 对象将显示当前状态。在这个实例中,数据库迁移会发生,其他组件会在完成前等待:

      status:
        conditions:
        - lastTransitionTime: "2021-09-14T10:52:04Z"
          lastUpdateTime: "2021-09-14T10:52:04Z"
          message: all objects created/updated successfully
          reason: ComponentsCreationSuccess
          status: "False"
          type: RolloutBlocked
        - lastTransitionTime: "2021-09-14T10:52:05Z"
          lastUpdateTime: "2021-09-14T10:52:05Z"
          message: running database migrations
          reason: MigrationsInProgress
          status: "False"
          type: Available
        lastUpdated: 2021-09-14 10:52:05.371425635 +0000 UTC
        unhealthyComponents:
          clair:
          - lastTransitionTime: "2021-09-14T10:51:32Z"
            lastUpdateTime: "2021-09-14T10:51:32Z"
            message: 'Deployment example-registry-clair-postgres: Deployment does not have minimum availability.'
            reason: MinimumReplicasUnavailable
            status: "False"
            type: Available
          - lastTransitionTime: "2021-09-14T10:51:32Z"
            lastUpdateTime: "2021-09-14T10:51:32Z"
            message: 'Deployment example-registry-clair-app: Deployment does not have minimum availability.'
            reason: MinimumReplicasUnavailable
            status: "False"
            type: Available
          mirror:
          - lastTransitionTime: "2021-09-14T10:51:32Z"
            lastUpdateTime: "2021-09-14T10:51:32Z"
            message: 'Deployment example-registry-quay-mirror: Deployment does not have minimum availability.'
            reason: MinimumReplicasUnavailable
            status: "False"
            type: Available
    Copy to Clipboard Toggle word wrap
  4. 当部署过程成功完成时,QuayRegistry 对象中的状态不会显示不健康的组件:

      status:
        conditions:
        - lastTransitionTime: "2021-09-14T10:52:36Z"
          lastUpdateTime: "2021-09-14T10:52:36Z"
          message: all registry component healthchecks passing
          reason: HealthChecksPassing
          status: "True"
          type: Available
        - lastTransitionTime: "2021-09-14T10:52:46Z"
          lastUpdateTime: "2021-09-14T10:52:46Z"
          message: all objects created/updated successfully
          reason: ComponentsCreationSuccess
          status: "False"
          type: RolloutBlocked
        currentVersion: {producty}
        lastUpdated: 2021-09-14 10:52:46.104181633 +0000 UTC
        registryEndpoint: https://example-registry-quay-quay-enterprise.apps.docs.quayteam.org
        unhealthyComponents: {}
    Copy to Clipboard Toggle word wrap
  1. 创建一个命名空间,如 quay-enterprise
  2. 选择 Operators Installed Operators,然后选择 Quay Operator 以导航到 Operator 详细视图。
  3. 在 'Provided APIs' 下的 'Quay Registry' 标题中点 'Create Instance'。
  4. (可选)更改 QuayRegistry 的 'Name'。这将影响 registry 的主机名。所有其他字段都填充了默认值。
  5. 点 'Create' 以提交由 Quay Operator 部署的 QuayRegistry
  6. 您应该被重定向到 QuayRegistry 列表视图。点您刚才创建的 QuayRegistry 来查看详情视图。
  7. 在 'Registry Endpoint' 有值后,可以在 UI 中点来访问新的 Quay registry。现在,您可以选择"Create Account"来创建用户并登录。

9.1.1. 使用 Red Hat Quay UI 创建第一个用户

使用以下步骤通过 Red Hat Quay UI 创建第一个用户。

注意

此流程假设 FEATURE_USER_CREATION 配置选项没有设置为 false。如果为 False,则 UI 上的 Create Account 功能将被禁用,您必须使用 API 来创建第一个用户。

流程

  1. 在 OpenShift Container Platform 控制台中,使用适当的命名空间 / 项目进入到 Operators Installed Operators
  2. 单击新安装的 QuayRegistry 对象以查看详细信息。例如:

    QuayRegistry details

  3. Registry Endpoint 具有值后,在浏览器中导航到此 URL。
  4. 在 Red Hat Quay registry UI 中,选择 Create Account 来创建用户。例如:

    Create Account

  5. 输入用户名、密码电子邮件 的详细信息,然后单击 创建帐户。例如:

    Enter account details

创建第一个用户后,会自动登录到 Red Hat Quay registry。例如:

Initial log in

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat