インフラストラクチャーノードでの GitOps ワークロード


Red Hat OpenShift GitOps 1.12

インフラストラクチャーノードでの GitOps コントロールプレーンワークロードの実行

Red Hat OpenShift Documentation Team

概要

このドキュメントでは、OpenShift GitOps によってインストールされたインフラストラクチャーノードで、特定のワークロードを実行する手順を説明します。デフォルトのワークロードをインフラストラクチャーノードに移動する方法についても説明します。

第1章 インフラストラクチャーノードでの GitOps コントロールプレーンワークロードの実行

インフラストラクチャーノードを使用して、2 つの主要な目的でインフラストラクチャーワークロードを分離できます。

  • サブスクリプションの数に関連する請求コストを防ぐ目的
  • メンテナンスと管理を分離させる目的

OpenShift Container Platform を使用して、インフラストラクチャーノードで GitOps コントロールプレーンのワークロードを実行できます。これには、デフォルトで openshift-gitops namespace 内の Red Hat OpenShift GitOps Operator によって作成された Operator Pod とコントロールプレーンワークロードが含まれます (この名前空間内のデフォルトの Argo CD インスタンスも含まれます)。

GitOps コントロールプレーンワークロードを使用すると、クラスター内に複数の分離された Argo CD インスタンスを作成することで、インフラストラクチャーワークロードを安全かつ宣言的に分離でき、Argo CD インスタンスの機能を完全に制御できます。さらに、これらの Argo CD インスタンスを複数の開発者名前空間にわたって宣言的に管理できます。テイントを使用すると、インフラストラクチャーコンポーネントのみがこれらのノードで実行されるようにできます。

注記

ユーザー namespace にインストールされたその他の Argo CD インスタンスは、インフラストラクチャーノードで実行する資格がありません。

1.1. GitOps コントロールプレーンワークロードのインフラストラクチャーノードへの移行

Red Hat OpenShift GitOps によってインストールされた GitOps コントロールプレーンワークロードをインフラストラクチャーノードに移動できます。移動できるコントロールプレーンのワークロードは次のとおりです。

  • kam deployment
  • cluster deployment (バックエンドサービス)
  • openshift-gitops-applicationset-controller deployment
  • openshift-gitops-dex-server deployment
  • openshift-gitops-redis deployment
  • openshift-gitops-redis-ha-haproxy deployment
  • openshift-gitops-repo-sever deployment
  • openshift-gitops-server deployment
  • 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 namespace のコントロールプレーンワークロードをインフラストラクチャーノードに移動します。

    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 namespace のインフラストラクチャーノードでスケジュールされていることを確認するには、Pod 名のいずれかをクリックし、ノードセレクター および 容認 が追加されていることを確認します。

注記

デフォルトの Argo CD CR の手動で追加された ノードセレクター および 容認 は、GitOpsService CR のトグルおよび容認によって上書きされます。

1.2. GitOps Operator Pod のインフラストラクチャーノードへの移行

GitOps Operator Pod をインフラストラクチャーノードに移動できます。

前提条件

  • Red Hat OpenShift GitOps Operator を OpenShift Container Platform クラスターにインストールされてる。
  • cluster-admin 権限でクラスターにアクセスできる。

手順

  1. 次のコマンドを実行して、既存のノードにインフラストラクチャーノードとしてラベルを付けます。

    $ oc label node <node_name> node-role.kubernetes.io/infra= 
    1
    Copy to Clipboard Toggle word wrap
    1
    <node_name> は、インフラストラクチャーノードとしてラベル付けするノードの名前に置き換えます。

    出力例

    node/<node_name> labeled
    Copy to Clipboard Toggle word wrap

  2. 以下のコマンドを実行して、Red Hat OpenShift GitOps Subscription リソースを編集します。

    $ oc -n openshift-gitops-operator edit subscription openshift-gitops-operator
    Copy to Clipboard Toggle word wrap
  3. nodeSelectortolerationsSubscription リソースの spec.config フィールドに追加します。

    Subscription の例

    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: openshift-gitops-operator
      namespace: openshift-gitops-operator
    spec:
      config:
        nodeSelector: 
    1
    
          node-role.kubernetes.io/infra: ""
        tolerations: 
    2
    
        - key: node-role.kubernetes.io/infra
          operator: Exists
          effect: NoSchedule
    Copy to Clipboard Toggle word wrap

    1
    Operator Pod がインフラストラクチャーノード上でのみスケジュールされるようにします。
    2
    インフラストラクチャーノードが Pod を受け入れるか確認します。

    出力例

    subscription.operators.coreos.com/openshift-gitops-operator edited
    Copy to Clipboard Toggle word wrap

  4. 次のコマンドを実行して、GitOps Operator Pod がインフラストラクチャーノードで実行されていることを確認します。

    $ oc -n openshift-gitops-operator get po -owide
    Copy to Clipboard Toggle word wrap

    出力例

    NAME                                                            READY   STATUS    RESTARTS   AGE   IP              NODE            NOMINATED NODE   READINESS GATES
    openshift-gitops-operator-controller-manager-abcd               2/2     Running   0          11m   94.142.44.126   <node_name>     <none>           <none> 
    1
    Copy to Clipboard Toggle word wrap

    1
    リストされた <node_name>node-role.kubernetes.io/infra ラベルを持つノードであることを確認します。

法律上の通知

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

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat