搜索

1.14. 使用 Red Hat OpenShift GitOps 安装 OLM Operator

download PDF

带有集群配置的 Red Hat OpenShift GitOps 管理特定集群范围的资源,并负责安装集群 Operator 或任何命名空间范围的 OLM Operator。

考虑作为集群管理员的情况,您必须安装 OLM Operator,如 Tekton。您可以使用 OpenShift Container Platform Web 控制台手动安装 Tekton Operator 或 OpenShift CLI,在集群中手动安装 Tekton 订阅和 Tekton Operator 组。

Red Hat OpenShift GitOps 将 Kubernetes 资源放置在 Git 存储库中。作为集群管理员,使用 Red Hat OpenShift GitOps 管理和自动化其他 OLM Operator 安装,而无需手动步骤。例如,在使用 Red Hat OpenShift GitOps 将 Tekton 订阅放在 Git 仓库后,Red Hat OpenShift GitOps 会自动从 Git 仓库获取此 Tekton 订阅,并在集群中安装 Tekton Operator。

1.14.1. 安装集群范围的 Operator

Operator Lifecycle Manager (OLM) 为集群范围的 Operator 使用 openshift-operators 命名空间中的默认 global-operators Operator 组。因此,您不必在 Gitops 仓库中管理 OperatorGroup 资源。但是,对于命名空间范围的 Operator,您必须管理该命名空间中的 OperatorGroup 资源。

要安装集群范围的 Operator,请在 Git 仓库中创建并放置所需 Operator 的 Subscription 资源。

示例:Grafana Operator 订阅

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: grafana
spec:
  channel: v4
  installPlanApproval: Automatic
  name: grafana-operator
  source: redhat-operators
  sourceNamespace: openshift-marketplace

1.14.2. 安装 namepace-scoped Operator

要安装命名空间范围的 Operator,请在 Git 仓库中创建并放置所需 Operator 的 SubscriptionOperatorGroup 资源。

示例:Ansible Automation Platform Resource Operator

# ...
apiVersion: v1
kind: Namespace
metadata:
  labels:
    openshift.io/cluster-monitoring: "true"
  name: ansible-automation-platform
# ...
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: ansible-automation-platform-operator
  namespace: ansible-automation-platform
spec:
  targetNamespaces:
    - ansible-automation-platform
# ...
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: ansible-automation-platform
  namespace: ansible-automation-platform
spec:
  channel: patch-me
  installPlanApproval: Automatic
  name: ansible-automation-platform-operator
  source: redhat-operators
  sourceNamespace: openshift-marketplace
# ...

重要

当使用 Red Hat OpenShift GitOps 部署多个 Operator 时,您必须在对应的命名空间中创建单个 Operator 组。如果一个命名空间中存在多个 Operator 组,则在该命名空间中创建的任何 CSV 都会变为带有 TooManyOperatorGroups 原因的 failure 状态。在相应命名空间中的 Operator 组数量达到一个后,所有以前有 failure 状态的 CSV 都会过渡到 pending 状态。您需要手动批准待处理的安装计划以完成 Operator 安装。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.