1.3. 通过 Red Hat OpenShift Container Platform CLI 安装 Red Hat Ansible Automation Platform Operator


根据这些说明,使用 oc 命令从 OpenShift Container Platform 命令行界面(CLI)在 Red Hat OpenShift Container Platform 上安装 Ansible Automation Platform Operator。

使用这个流程为 Operator 订阅命名空间。

重要

您无法在 OpenShift Cluster 上的 default 命名空间中部署 Ansible Automation Platform。建议使用 'ansible-automation-platform' 命名空间。您可以使用自定义命名空间,但它应该只运行 Ansible Automation Platform。

先决条件

  • 使用具有 operator 安装权限的账户访问 Red Hat OpenShift Container Platform。
  • OpenShift Container Platform CLI oc 命令安装在本地系统中。如需更多信息,请参阅 Red Hat OpenShift Container Platform 产品文档中的安装 OpenShift CLI

流程

  1. 为 operator 创建项目。

    oc new-project ansible-automation-platform
    Copy to Clipboard Toggle word wrap
  2. 创建名为 sub.yaml 的文件。
  3. 将以下 YAML 代码添加到 sub.yaml 文件中。

    ---
    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: 'stable-2.6'
      installPlanApproval: Automatic
      name: ansible-automation-platform-operator
      source: redhat-operators
      sourceNamespace: openshift-marketplace
    ---
    Copy to Clipboard Toggle word wrap

    此文件创建一个名为 ansible-automation-platform 的 Subscription 对象,它将 ansible-automation-platform 命名空间订阅到 ansible-automation-platform-operator operator。

  4. 运行 oc apply 命令来创建 sub.yaml 文件中指定的对象:

    oc apply -f sub.yaml
    Copy to Clipboard Toggle word wrap
  5. 在继续使用 oc get csv -n ansible-automation-platform 命令前,验证 CSV PHASE 报告 "Succeeded":

    oc get csv -n ansible-automation-platform
    
    NAME                               DISPLAY                       VERSION              REPLACES                           PHASE
    aap-operator.v2.6.0-0.1728520175   Ansible Automation Platform   2.6.0+0.1728520175   aap-operator.v2.6.0-0.1727875185   Succeeded
    Copy to Clipboard Toggle word wrap
  6. ansible-automation-platform 命名空间中创建一个名为 exampleAnsibleAutomationPlatform 对象。

    要从示例更改 Ansible Automation Platform 及其组件,请编辑 metadata: 部分中的 name 字段,并将 example 替换为您要使用的名称:

    oc apply -f - <<EOF
    apiVersion: aap.ansible.com/v1alpha1
    kind: AnsibleAutomationPlatform
    metadata:
      name: example
      namespace: ansible-automation-platform
    spec:
      # Platform
      image_pull_policy: IfNotPresent
      # Components
      controller:
        disabled: false
      eda:
        disabled: false
      hub:
        disabled: false
        ## Modify to contain your RWM storage class name
        storage_type: file
        file_storage_storage_class: <your-read-write-many-storage-class>
        file_storage_size: 10Gi
    
        ## uncomment if using S3 storage for Content pod
        # storage_type: S3
        # object_storage_s3_secret: example-galaxy-object-storage
    
        ## uncomment if using Azure storage for Content pod
        # storage_type: azure
        # object_storage_azure_secret: azure-secret-name
      lightspeed:
        disabled: true
    EOF
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部