1.10. Red Hat OpenShift GitOps アドオンの管理


OpenShift GitOps アドオンは、マネージドクラスターのデプロイメントとライフサイクル管理を自動化します。アーキテクチャーと接続要件に基づいて、ArgoCD エージェントコンポーネントとともに GitOps アドオンをデプロイするかどうかを決定します。それ以外の場合は、ArgoCD エージェントなしで OpenShift GitOps アドオンをデプロイできます。

重要: GitOpsCluster カスタムリソースを使用して OpenShift GitOps アドオンを有効にすると、GitOpsCluster は、すべてのアプリケーションの Push Model を無効にします。

OpenShift GitOps アドオンを有効にすると、次のデプロイメントモードが利用可能になります。

  • Basic モード: GitOpsCluster カスタムリソースを通じて、マネージドクラスターに OpenShift GitOps Operator と ArgoCD インスタンスをデプロイします。
  • Agent モード: 強化されたプルベースのアーキテクチャー用の ArgoCD エージェントとともに、すべての基本モードコンポーネントが含まれます。

選択したマネージドクラスターに対して OpenShift GitOps アドオンを有効にするには、Placement を参照し、有効化のインターフェイスとして GitOpsCluster カスタムリソースを使用します。

前提条件

ArgoCD エージェントで OpenShift GitOps アドオンを有効にする場合は、Agent モードを使用します。ArgoCD エージェントを伴う Red Hat OpenShift GitOps アドオンの有効化 を参照してください。

ArgoCD エージェントなしで OpenShift GitOps アドオンを有効にする場合は、Basic モードを使用します。ArgoCD エージェントなしで Red Hat OpenShift GitOps アドオンを有効にする を参照してください。

1.10.1. OpenShift GitOps アドオン設定

OpenShift GitOps アドオンは、要件に応じてデプロイメントをカスタマイズするためのさまざまな設定オプションをサポートしています。

OpenShift GitOps アドオンは、gitopsAddon 仕様の次の設定オプションをサポートしています。

  • enabled: GitOps アドオンを有効または無効にします。デフォルトは false です。
  • gitOpsOperatorImage: GitOps Operator のカスタムコンテナーイメージ。
  • gitOpsImage: ArgoCD コンポーネントのカスタムコンテナーイメージ。
  • redisImage: Redis のカスタムコンテナーイメージ。
  • gitOpsOperatorNamespace: GitOps Operator がデプロイされる namespace。デフォルトは openshift-gitops-operator です。
  • gitOpsNamespace: ArgoCD インスタンスがデプロイされる namespace。デフォルトは `openshift-gitops` です。
  • reconcileScope: All-Namespaces または Single-Namespace を含む ArgoCD リコンシリエーションスコープを制御します。デフォルト: Single-Namespaces
  • overrideExistingConfigs: 既存の AddOnDeploymentConfig 値を GitOpsCluster 仕様の新しい値でオーバーライドします。アンインストール操作を実行するときは true に設定する必要があります。デフォルトは false です。
  • argoCDAgent: ArgoCD エージェント設定サブセクション。

Argo CD Agent は、argoCDAgent 仕様の次の設定オプションをサポートしています。

  • enabled: エージェントを有効または無効にします。デフォルトは false です。
  • propagateHubCA: ハブ認定機関 (CA) 証明書をマネージドクラスターに伝播します。デフォルトは true です。
  • image: カスタムエージェントコンテナーイメージ。
  • serverAddress: ArgoCD エージェントのプリンシパルサーバーアドレスをオーバーライドします。
  • serverPort: ArgoCD エージェントのプリンシパルサーバーポートをオーバーライドします。
  • mode: エージェントの操作モード。デフォルトは managed です。

OpenShift GitOps アドオン設定を行うには、ハブクラスターで次の手順を実行します。

  1. GitOpsCluster を含む YAML サンプルを追加して、OpenShift GitOps コンポーネントのコンテナーイメージをカスタマイズします。

    apiVersion: apps.open-cluster-management.io/v1beta1
    kind: GitOpsCluster
    metadata:
      name: gitops-custom-images
      namespace: openshift-gitops
    spec:
      argoServer:
        argoNamespace: openshift-gitops
      placementRef:
        kind: Placement
        apiVersion: cluster.open-cluster-management.io/v1beta1
        name: all-openshift-clusters
        namespace: openshift-gitops
      gitopsAddon:
        enabled: true
        gitOpsOperatorImage: "registry.redhat.io/openshift-gitops-1/gitops-operator@sha256:..."
        gitOpsImage: "registry.redhat.io/openshift-gitops-1/argocd@sha256:..."
        redisImage: "registry.redhat.io/rhel8/redis-6@sha256:..."
    Copy to Clipboard Toggle word wrap
  2. 次のコマンドを実行して、YAML サンプルを適用します。

    oc apply -f gitopscluster-example.yaml
    Copy to Clipboard Toggle word wrap
  3. GitOpsCluster に以下の YAML を追加し、OpenShift GitOps コンポーネントをデプロイする namespace をカスタマイズします。

    apiVersion: apps.open-cluster-management.io/v1beta1
    kind: GitOpsCluster
    metadata:
      name: gitops-custom-namespaces
      namespace: openshift-gitops
    spec:
      argoServer:
        argoNamespace: openshift-gitops
      placementRef:
        kind: Placement
        apiVersion: cluster.open-cluster-management.io/v1beta1
        name: all-openshift-clusters
        namespace: openshift-gitops
      gitopsAddon:
        enabled: true
        gitOpsOperatorNamespace: openshift-gitops-operator
        gitOpsNamespace: openshift-gitops
    Copy to Clipboard Toggle word wrap
  4. 次のコマンドを実行して、YAML サンプルを適用します。

    oc apply -f gitopscluster-example.yaml
    Copy to Clipboard Toggle word wrap
  5. GitOpsCluster に次の YAML を追加して、ArgoCD エージェントがすべての namespace でアプリケーションをリコンサイルできるかどうかを指定します。

    apiVersion: apps.open-cluster-management.io/v1beta1
    kind: GitOpsCluster
    metadata:
      name: gitops-reconcile-scope
      namespace: openshift-gitops
    spec:
      argoServer:
        argoNamespace: openshift-gitops
      placementRef:
        kind: Placement
        apiVersion: cluster.open-cluster-management.io/v1beta1
        name: all-openshift-clusters
        namespace: openshift-gitops
      gitopsAddon:
        enabled: true
        reconcileScope:
    Copy to Clipboard Toggle word wrap
    1. ArgoCD インスタンスにすべての namespace のアプリケーションをリコンサイルさせたい場合は、reconcileScope フィールドに All-Namespaces 値を指定します。
    2. ArgoCD インスタンスに独自の namespace のアプリケーションのみをリコンサイルさせたい場合は、reconcileScope フィールドに Single-Namespace 値を指定します。
  6. 次のコマンドを実行して、YAML サンプルを適用します。

    oc apply -f gitopscluster-example.yaml
    Copy to Clipboard Toggle word wrap

関連情報

不要な特定の OpenShift GitOps アドオン機能をスキップできます。OpenShift GitOps アドオンの適用をスキップする を参照してください。

OpenShift GitOps アドオンが機能することを検証するには、{gitops-short) アドオン機能の検証 を参照してください。

ArgoCD エージェントが機能することを検証するには、ArgoCD エージェント機能の検証 を参照してください。

OpenShift GitOps の詳細は、次のドキュメントを参照してください。

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

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

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

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

会社概要

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

Theme

© 2025 Red Hat