---
schema_version: "1"
id: 96f9b06f68b333d3d7613ddca1c22f7d2d8ab59c5913d732452d93a4bdb97ecf
title: 単一クラスターへの Runtime Fabric の複数のインスタンスのインストール
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/runtime-fabric/2.6/install-multiple-instances.md
canonical_url: https://docs.mulesoft.com/jp/runtime-fabric/2.6/install-multiple-instances
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 860fba4b3aa10546d49620a89e1f085db5cc0b7ac7da18c02a8457cea27b79a2
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# 単一クラスターへの Runtime Fabric の複数のインスタンスのインストール

複数のインスタンスの Anypoint Runtime Fabric をインストールすることで、複数の Runtime Fabrics 間で同じクラスターを共有し、効率的にリソースを使用することができます。

- この機能を使用するには、複数のインスタンスがサポートされる 2.2.5 以上のバージョンの Runtime Fabric エージェントにアップグレードする必要があります。
- エージェントの名前空間はアプリケーションの名前空間に 1 対 1 でマップされます。同じクラスターの複数のインスタンスの Runtime Fabric 間でアプリケーションの名前空間を共有することはできません。

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">複数のインスタンスがある場合、最初の Runtime Fabric エージェントのインストールにより、​<code>persistencegateways.rtf.mulesoft.com</code>​ のカスタムリソース定義 (CRD) と優先度クラスの ​<code>rtf-components-high-priority</code>​ リソースが作成されます。エージェントをアンインストールしても、Runtime Fabric エージェントではこれらのリソースがクリーンアップされません。</td></tr></tbody></table>

## [](#複数のインスタンスの-runtime-fabric-をインストールする)複数のインスタンスの Runtime Fabric をインストールする

1 つの BYOK (Bring Your Own Kubernetes) クラスターに複数のインスタンスの Anypoint Runtime Fabric をインストールするには、次の手順に従ってください。

1. Runtime Manager を使用して Runtime Fabric を作成します。
2. 前のステップで作成した Fabric をインストールするカスタム名前空間を作成します。
    
    kubectl create ns <rtf\_namespace>
3. 前に作成した名前空間の Runtime Fabric コンポーネントイメージを取得するための Docker プルシークレットを作成します。
    
    kubectl create secret docker-registry rtf-pull-secret --namespace <rtf\_namespace> --docker-server=<docker\_registry\_url> --docker-username=<docker\_registry\_username> --docker-password=<docker\_ registry\_password>
4. Runtime Fabric Helm リポジトリを追加します。
    
    helm repo add <name> <helm\_repo\_url> --username <your\_username> --password <your\_password>
5. 必要に応じて、共有テナントを設定できます。詳細は、​[承認済み名前空間の設定](#configure-namespaces)​を参照してください。
6. Anypoint Platform UI から ​`values.yaml`​ ファイルをダウンロードして設定します。
7. `values.yaml`​ ファイルの​[必須パラメーター](#required-parameters)​を設定します。
8. クラスターに Runtime Fabric をインストールします。
    
    helm install runtime-fabric rtf/rtf-agent --version <rtf\_version> -f values.yaml -n <rtf\_namespace>

## [](#values-yaml-の必須パラメーター)Values.yaml の必須パラメーター

Runtime Manager で Runtime Fabric インスタンスを作成すると、次の必須パラメーターの値が設定されます。ローカルレジストリを使用していない場合は、レジストリ URL とプルシークレットのデフォルト値を使用してください。

<table class="tableblock frame-all grid-all fit-content spread">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Key (キー)</th>
<th class="tableblock halign-left valign-top">値</th>
<th class="tableblock halign-left valign-top">例</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>activationData</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アクティベーションデータ</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">YW55cG9pbnQubXVsZXNvZnQuY29tOjBmODdmYzYzLTM3MWUtNDU2Yy1iODg5LTU5NTkyNjYyZjUxZQ==</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>rtfRegistry</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">レジストリ URL</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">US rtf-runtime-registry.kprod.msap.io</p>
<p class="tableblock">EU
rtf-runtime-registry.kprod-eu.msap.io</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pullSecretName</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">レジストリプルシークレット</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">rtf-pull-secret</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>muleLicense</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アプリケーションの Mule ライセンス</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Mule ライセンスキー (Base64 でエンコードされている必要があります)</p></td>
</tr>
</tbody>
</table>

## [](#required-parameters)Values.yaml の省略可能なパラメーター

必要に応じて次の省略可能なパラメーターを設定します。

<table class="tableblock frame-all grid-all fit-content spread">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Key (キー)</th>
<th class="tableblock halign-left valign-top">説明</th>
<th class="tableblock halign-left valign-top">例</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>authorizedNamespaces</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">共有テナントを有効にする</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">authorizedNamespaces=true</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>crds.install</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Crds と PriorityClass のインストールを有効にする</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">install=true</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>proxy.http.proxy</code><br>
<code>proxy.http.no_proxy</code>​
`</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">プロキシ値と no_proxy 値</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">- http://&lt;user&gt;:&lt;pass&gt;@&lt;10.0.0.1&gt;:&lt;8080&gt;​<br>
- &lt;1.1.1.1:8888,2.2.2.2:9999&gt;</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>proxy.monitoring.proxy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Monitoring のプロキシ値</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">socks5://&lt;user&gt;:&lt;pass&gt;@&lt;10.0.0.2&gt;:&lt;8080&gt;</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>global.containerLogPaths</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Filebeat の読み取りパス</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">- /var/lib/docker/<br>
 - /var/log/containers<br>
 - /var/log/pods</p></td>
</tr>
</tbody>
</table>

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">最初のエージェントをクラスターにインストールするには、​<code>crds.install</code>​ の値を ​<code>true</code>​ に設定します。<br>同じクラスターの以降のすべてのエージェントインストールでは ​<code>crds.install</code>​ を ​<code>false</code>​ に設定します。</td></tr></tbody></table>

## [](#values-yaml-リファレンス)Values.yaml リファレンス

次に ​`values.yaml`​ ファイルの例を示します。

activationData: <activation\_data>
  proxy:
    http\_proxy:
    http\_no\_proxy:
    monitoring\_proxy:
custom\_log4j\_enabled: true
muleLicense: <mule\_license\_key>
global:
  crds:
    install: true
  authorizedNamespaces: false
  image:
    rtfRegistry: rtf-runtime-registry.kprod.msap.io
    pullSecretName: rtf-pull-secret
  containerLogPaths:
  - /var/lib/docker/containers
  - /var/log/containers
  - /var/log/pods

## [](#mule-アプリケーションのデプロイ)Mule アプリケーションのデプロイ

1. Mule アプリケーションをデプロイするには、インストールするエージェントごとに ​`app-namespace`​ を作成します。
    
    apiVersion: v1
    kind: Namespace
    metadata:
      name: <app-namespace>
      labels:
        rtf.mulesoft.com/agentNamespace: <rtf\_namespace>
        rtf.mulesoft.com/envId: <environment\_id>
        rtf.mulesoft.com/org: <org\_id>
        rtf.mulesoft.com/role: workers
2. 新しい ​`<rtf_namespace>`​ でイングレスを作成します。

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: rtf-ingress
  namespace: <rtf\_namespace>
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  ingressClassName: rtf-nginx
  rules:
    - host: "testrtf.com"
      http:
        paths:
          - pathType: Prefix
            path: "/app-name(/|$)(.\*)"
            backend:
              service:
                name: service
                port:
                  name: service-port

`<rtf_namespace>`​ ごとに異なるホスト名を使用してください。複数のイングレスで同じホストについて異なるパスを定義すると、イングレスコントローラーによって定義がマージされます。 結果として、同じ名前の, Mule アプリケーションにアクセスできなくなり、Runtime Fabric の問題ではなく k8s の問題が発生することになります。

## [](#configure-namespaces)(省略可能) 承認済み名前空間を設定する

必要に応じて、他のサービスと一緒に Runtime Fabric を Kubernetes クラスターにデプロイできるようにする承認済み名前空間を設定できます。

Runtime Fabric をインストールする前に Runtime Fabric 名前空間用に ​`authorized-namespaces`​ ConfigMap ファイルを作成する必要があります。さらに、​`ConfigMap`​ には ​`authorized-namespaces`​ という名前を付ける必要があります。​`ConfigMap`​ ファイルの例を示します。

apiVersion: v1
kind: ConfigMap
metadata:
  name: authorized-namespaces
  namespace: <rtf\_namespace>
data:
  APPLICATION\_NAMESPACE\_1: "<app\_namespace\_1>"
  APPLICATION\_NAMESPACE\_2: "<app\_namespace\_1>

`rtf:resource-metrics-collector`​ ClusterRole にはノード、ポッド、名前空間を ​`get`​ および ​`list`​ するクラスター全体の権限があり、ノードに対する ​`watch`​ 権限があります。ロール ClusterRole は次のように定義されます。 ClusterRole ロールの例を示します。

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: rtf:resource-metrics-collector
  labels:
    {{- include "labels.standard" . | nindent 4 }}
rules:
  - apiGroups: \[""\]
    resources: \["nodes", "pods", "namespaces"\]
    verbs: \["list", "get"\]
  - apiGroups: \[""\]
    resources: \["nodes"\]
    verbs: \["watch"\]

### [](#追加の名前空間を設定する)追加の名前空間を設定する

アプリケーションデプロイメント用の追加の名前空間を作成し、必要な表示ラベルを名前空間に追加するには、次の手順に従ってください。

1. 次のコンテンツで YAML ファイルを作成します。
    
    apiVersion: v1
    kind: Namespace
    metadata:
      name: <app-namespace>
      labels:
        rtf.mulesoft.com/agentNamespace: <rtf\_namespace>
        rtf.mulesoft.com/envId: <environment\_id>
        rtf.mulesoft.com/org: <org\_id>
        rtf.mulesoft.com/role: workers
2. 以前に作成したファイルを適用します。
    
    kubectl apply -f <filename>.yaml
3. ステップ 1 と 2 を繰り返して、必要な数の名前空間を追加します。
4. 追加の名前空間で次の設定を適用することにより、Runtime Fabric エージェント ​`ServiceAccount`​ が含まれる Runtime Fabric エージェント ​`ClusterRole`​ の ​`RoleBinding`​ を作成します。
    
    kind: RoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: <rb\_name>
      namespace: <app\_namespace>
    subjects:
      - kind: ServiceAccount
        name: rtf-agent
        namespace: <rtf\_namespace>
    roleRef:
      kind: ClusterRole
      name: rtf:agent-<rtf\_namespace>
      apiGroup: rbac.authorization.k8s.io

## [](#関連情報)関連情報

[Runtime Fabric のインストール](https://docs.mulesoft.com/jp/runtime-fabric/2.6/install-index)