基础架构节点上的 GitOps 工作负载


Red Hat OpenShift GitOps 1.9

在基础架构节点上运行 GitOps control plane 工作负载

Red Hat OpenShift Documentation Team

摘要

本文档提供在 OpenShift GitOps 安装的基础架构节点上运行某些工作负载的说明。它还讨论如何将默认工作负载移到基础架构节点。

您可以使用基础架构节点防止额外的账单成本。

您可以使用 OpenShift Container Platform 在 Red Hat OpenShift GitOps Operator 安装的基础架构节点上运行特定的工作负载。默认情况下,它由 Red Hat OpenShift GitOps Operator 安装的工作负载包括在 openshift-gitops 命名空间中,包括该命名空间中的默认 Argo CD 实例。

注意

任何安装到用户命名空间的其他 Argo CD 实例都无权在 Infrastructure 节点上运行。

1.1. 将 GitOps 工作负载移到基础架构节点

您可以将 Red Hat OpenShift GitOps 安装的默认工作负载移到基础架构节点。可移动的工作负载有:

  • kam deployment
  • 集群部署(后端服务)
  • openshift-gitops-applicationset-controller 部署
  • openshift-gitops-dex-server 部署
  • openshift-gitops-redis 部署
  • openshift-gitops-redis-ha-haproxy 部署
  • openshift-gitops-repo-sever 部署
  • openshift-gitops-server 部署
  • openshift-gitops-application-controller statefulset
  • openshift-gitops-redis-server statefulset

流程

  1. 运行以下命令,将现有节点标记为基础架构:

    $ oc label node <node-name> node-role.kubernetes.io/infra=
    Copy to Clipboard Toggle word wrap
  2. 编辑 GitOpsService 自定义资源(CR)以添加基础架构节点选择器:

    $ oc edit gitopsservice -n openshift-gitops
    Copy to Clipboard Toggle word wrap
  3. GitOpsService CR 文件中,将 runOnInfra 字段添加到 spec 部分,并将其设置为 true。此字段将 openshift-gitops 命名空间中的工作负载移到基础架构节点:

    apiVersion: pipelines.openshift.io/v1alpha1
    kind: GitopsService
    metadata:
      name: cluster
    spec:
      runOnInfra: true
    Copy to Clipboard Toggle word wrap
  4. 可选:在基础架构节点上应用污点并隔离工作负载,并防止其他工作负载调度到这些节点上。

    $ oc adm taint nodes -l node-role.kubernetes.io/infra
    infra=reserved:NoSchedule infra=reserved:NoExecute
    Copy to Clipboard Toggle word wrap
  5. 可选: 如果您将污点应用到节点,您可以在 GitOpsService CR 中添加容限:

    spec:
      runOnInfra: true
      tolerations:
      - effect: NoSchedule
        key: infra
        value: reserved
      - effect: NoExecute
        key: infra
        value: reserved
    Copy to Clipboard Toggle word wrap

要验证工作负载是否已调度到 Red Hat OpenShift GitOps 命名空间中的基础架构节点上,请点击任何 pod 名称,并确保已添加了 Node selectorTolerations

注意

在默认 Argo CD CR 中手动添加节点选择器Tolerations 都会被 GitOpsService CR 中的切换和容限覆盖。

法律通告

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部