第 1 章 使用 Operator 在 GCP 上的 OpenShift Dedicated 上安装 Red Hat Developer Hub
您可以使用 Red Hat Developer Hub Operator 在 GCP 上的 OpenShift Dedicated 上安装 Developer Hub。
先决条件
- 您有一个有效的 GCP 帐户。
- 您的 OpenShift Dedicated 集群在 GCP 上运行。如需更多信息,请参阅 Red Hat OpenShift Dedicated 文档中的在 GCP 上创建集群。
- 具有 OpenShift Dedicated 集群和 GCP 项目的管理员访问权限。
流程
- 在 OpenShift Container Platform Web 控制台菜单中,进入 Operators > OperatorHub。
- 在 Filter by keyword 字段中输入 Developer Hub,然后点 Red Hat Developer Hub Operator 卡。
- 在 Red Hat Developer Hub Operator 页面中,点 Install。
- 安装完成后,进入 Installed Operators 并选择 Red Hat Developer Hub Operator。
置备自定义配置:
apiVersion: v1 kind: ConfigMap metadata: name: app-config-rhdh data: "app-config-rhdh.yaml": | app: title: Red Hat Developer Hub baseUrl: https://__<my_developer_hub_url>__ backend: auth: externalAccess: - type: legacy options: subject: legacy-default-config secret: "${BACKEND_SECRET}" baseUrl: https://__<my_developer_hub_url>__ cors: origin: https://__<my_developer_hub_url>__您必须创建一个名为
app-config-rhdh的配置映射,以及包含BACKEND_SECRET的 Kubernetes Secret。Developer Hub 实例使用这些资源进行身份验证和应用程序设置。创建名为
app-config-rhdh的配置映射,其中包含app-config.yaml,如下所示:apiVersion: v1 kind: ConfigMap metadata: name: app-config-rhdh data: "app-config-rhdh.yaml": | app: title: Red Hat Developer Hub baseUrl: https://__<my_developer_hub_url>__ backend: auth: externalAccess: - type: legacy options: subject: legacy-default-config secret: "${BACKEND_SECRET}" baseUrl: https://__<my_developer_hub_url>__ cors: origin: https://__<my_developer_hub_url>__创建名为
my-rhdh-secrets的 secret,并添加名为BACKEND_SECRET的键,其带有Base64 编码的字符串作为值:apiVersion: v1 kind: Secret metadata: name: my-rhdh-secrets stringData: # TODO: Add the necessary auth secrets for service-to-service auth setup BACKEND_SECRET: "xxx" # Replace with your Base64-encoded secret- 返回到 Developer Hub Operator 页面,再点 Create New Instance。
- 指定 Developer Hub 部署的名称和命名空间。
- 配置所需的选项,如 Git 集成、secret 和用户权限。
- 检查配置,选择部署选项,然后单击 Create。
验证
- 要访问 Developer Hub,请导航到 OpenShift Container Platform Web 控制台中提供的 Developer Hub URL。