3.11. マニフェスト設定ファイル
3.11.1. OpenShift Container Platform マニフェストの作成
OpenShift Container Platform マニフェストを作成します。
./openshift-baremetal-install --dir ~/clusterconfigs create manifests
$ ./openshift-baremetal-install --dir ~/clusterconfigs create manifests
Copy to Clipboard Copied! INFO Consuming Install Config from target directory WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings WARNING Discarding the OpenShift Manifest that was provided in the target directory because its dependencies are dirty and it needs to be regenerated
INFO Consuming Install Config from target directory WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings WARNING Discarding the OpenShift Manifest that was provided in the target directory because its dependencies are dirty and it needs to be regenerated
Copy to Clipboard Copied!
3.11.2. オプション: 非接続クラスターの NTP 設定
OpenShift Container Platform は、クラスターノードに chrony
Network Time Protocol (NTP) サービスをインストールします。

OpenShift Container Platform ノードは、正しく実行するために日時について合意する必要があります。ワーカーノードがコントロールプレーンノードの NTP サーバーから日付と時刻を取得すると、ルーティング可能なネットワークに接続されていないクラスターのインストールおよび操作が有効になるため、上位の stratum の NTP サーバーにアクセスできなくなります。
手順
次のコマンドを使用して、インストールホストに Butane をインストールします。
sudo dnf -y install butane
$ sudo dnf -y install butane
Copy to Clipboard Copied! コントロールプレーンノードの
chrony.conf
ファイルのコンテンツを含む Butane 設定 (99-master-chrony-conf-override.bu
) を作成します。注記Butane の詳細は、「Butane を使用したマシン設定の作成」を参照してください。
Butane 設定例
variant: openshift version: 4.14.0 metadata: name: 99-master-chrony-conf-override labels: machineconfiguration.openshift.io/role: master storage: files: - path: /etc/chrony.conf mode: 0644 overwrite: true contents: inline: | # Use public servers from the pool.ntp.org project. # Please consider joining the pool (https://www.pool.ntp.org/join.html). # The Machine Config Operator manages this file server openshift-master-0.<cluster-name>.<domain> iburst server openshift-master-1.<cluster-name>.<domain> iburst server openshift-master-2.<cluster-name>.<domain> iburst stratumweight 0 driftfile /var/lib/chrony/drift rtcsync makestep 10 3 bindcmdaddress 127.0.0.1 bindcmdaddress ::1 keyfile /etc/chrony.keys commandkey 1 generatecommandkey noclientlog logchange 0.5 logdir /var/log/chrony # Configure the control plane nodes to serve as local NTP servers # for all worker nodes, even if they are not in sync with an # upstream NTP server. # Allow NTP client access from the local network. allow all # Serve time even if not synchronized to a time source. local stratum 3 orphan
variant: openshift version: 4.14.0 metadata: name: 99-master-chrony-conf-override labels: machineconfiguration.openshift.io/role: master storage: files: - path: /etc/chrony.conf mode: 0644 overwrite: true contents: inline: | # Use public servers from the pool.ntp.org project. # Please consider joining the pool (https://www.pool.ntp.org/join.html). # The Machine Config Operator manages this file server openshift-master-0.<cluster-name>.<domain> iburst
1 server openshift-master-1.<cluster-name>.<domain> iburst server openshift-master-2.<cluster-name>.<domain> iburst stratumweight 0 driftfile /var/lib/chrony/drift rtcsync makestep 10 3 bindcmdaddress 127.0.0.1 bindcmdaddress ::1 keyfile /etc/chrony.keys commandkey 1 generatecommandkey noclientlog logchange 0.5 logdir /var/log/chrony # Configure the control plane nodes to serve as local NTP servers # for all worker nodes, even if they are not in sync with an # upstream NTP server. # Allow NTP client access from the local network. allow all # Serve time even if not synchronized to a time source. local stratum 3 orphan
Copy to Clipboard Copied! - 1
<cluster-name>
はクラスターの名前に置き換え、<domain>
は完全修飾ドメイン名に置き換える必要があります。
Butane を使用して、コントロールプレーンノードに配信される設定が含まれる
MachineConfig
オブジェクトファイル (99-master-chrony-conf-override.yaml
) を生成します。butane 99-master-chrony-conf-override.bu -o 99-master-chrony-conf-override.yaml
$ butane 99-master-chrony-conf-override.bu -o 99-master-chrony-conf-override.yaml
Copy to Clipboard Copied! コントロールプレーンノードの NTP サーバーを参照するワーカーノードの
chrony.conf
ファイルのコンテンツを含む Butane 設定 (99-worker-chrony-conf-override.bu
) を作成します。Butane 設定例
variant: openshift version: 4.14.0 metadata: name: 99-worker-chrony-conf-override labels: machineconfiguration.openshift.io/role: worker storage: files: - path: /etc/chrony.conf mode: 0644 overwrite: true contents: inline: | # The Machine Config Operator manages this file. server openshift-master-0.<cluster-name>.<domain> iburst server openshift-master-1.<cluster-name>.<domain> iburst server openshift-master-2.<cluster-name>.<domain> iburst stratumweight 0 driftfile /var/lib/chrony/drift rtcsync makestep 10 3 bindcmdaddress 127.0.0.1 bindcmdaddress ::1 keyfile /etc/chrony.keys commandkey 1 generatecommandkey noclientlog logchange 0.5 logdir /var/log/chrony
variant: openshift version: 4.14.0 metadata: name: 99-worker-chrony-conf-override labels: machineconfiguration.openshift.io/role: worker storage: files: - path: /etc/chrony.conf mode: 0644 overwrite: true contents: inline: | # The Machine Config Operator manages this file. server openshift-master-0.<cluster-name>.<domain> iburst
1 server openshift-master-1.<cluster-name>.<domain> iburst server openshift-master-2.<cluster-name>.<domain> iburst stratumweight 0 driftfile /var/lib/chrony/drift rtcsync makestep 10 3 bindcmdaddress 127.0.0.1 bindcmdaddress ::1 keyfile /etc/chrony.keys commandkey 1 generatecommandkey noclientlog logchange 0.5 logdir /var/log/chrony
Copy to Clipboard Copied! - 1
<cluster-name>
はクラスターの名前に置き換え、<domain>
は完全修飾ドメイン名に置き換える必要があります。
Butane を使用して、ワーカーノードに配信される設定が含まれる
MachineConfig
オブジェクトファイル (99-worker-chrony-conf-override.yaml
) を生成します。butane 99-worker-chrony-conf-override.bu -o 99-worker-chrony-conf-override.yaml
$ butane 99-worker-chrony-conf-override.bu -o 99-worker-chrony-conf-override.yaml
Copy to Clipboard Copied!
3.11.3. コントロールプレーンで実行されるネットワークコンポーネントの設定
ネットワークコンポーネントは、コントロールプレーンノードでのみ実行するように設定できます。デフォルトで、OpenShift Container Platform はマシン設定プールの任意のノードが ingressVIP
仮想 IP アドレスをホストできるようにします。ただし、環境によっては、ワーカーノードをコントロールプレーンノードとは別のサブネットにデプロイするため、コントロールプレーンノードで実行する ingressVIP
仮想 IP アドレスを設定する必要があります。
リモートワーカーを別々のサブネットにデプロイする場合は、コントロールプレーンノード専用に ingressVIP
仮想 IP アドレスを配置する必要があります。

手順
install-config.yaml
ファイルを保存するディレクトリーに移動します。cd ~/clusterconfigs
$ cd ~/clusterconfigs
Copy to Clipboard Copied! manifests
サブディレクトリーに切り替えます。cd manifests
$ cd manifests
Copy to Clipboard Copied! cluster-network-avoid-workers-99-config.yaml
という名前のファイルを作成します。touch cluster-network-avoid-workers-99-config.yaml
$ touch cluster-network-avoid-workers-99-config.yaml
Copy to Clipboard Copied! エディターで
cluster-network-avoid-workers-99-config.yaml
ファイルを開き、Operator 設定を記述するカスタムリソース (CR) を入力します。apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: name: 50-worker-fix-ipi-rwn labels: machineconfiguration.openshift.io/role: worker spec: config: ignition: version: 3.2.0 storage: files: - path: /etc/kubernetes/manifests/keepalived.yaml mode: 0644 contents: source: data:,
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: name: 50-worker-fix-ipi-rwn labels: machineconfiguration.openshift.io/role: worker spec: config: ignition: version: 3.2.0 storage: files: - path: /etc/kubernetes/manifests/keepalived.yaml mode: 0644 contents: source: data:,
Copy to Clipboard Copied! このマニフェストは、
ingressVIP
仮想 IP アドレスをコントロールプレーンノードに配置します。また、このマニフェストは、コントロールプレーンノードにのみ以下のプロセスをデプロイします。-
openshift-ingress-operator
-
keepalived
-
-
cluster-network-avoid-workers-99-config.yaml
ファイルを保存します。 manifests/cluster-ingress-default-ingresscontroller.yaml
ファイルを作成します。apiVersion: operator.openshift.io/v1 kind: IngressController metadata: name: default namespace: openshift-ingress-operator spec: nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/master: ""
apiVersion: operator.openshift.io/v1 kind: IngressController metadata: name: default namespace: openshift-ingress-operator spec: nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/master: ""
Copy to Clipboard Copied! -
manifests
ディレクトリーのバックアップの作成を検討してください。インストーラーは、クラスターの作成時にmanifests/
ディレクトリーを削除します。 cluster-scheduler-02-config.yml
マニフェストを変更し、mastersSchedulable
フィールドをtrue
に設定して、コントロールプレーンノードをスケジュール対象にします。デフォルトでは、コントロールプレーンノードはスケジュール対象ではありません。以下に例を示します。sed -i "s;mastersSchedulable: false;mastersSchedulable: true;g" clusterconfigs/manifests/cluster-scheduler-02-config.yml
$ sed -i "s;mastersSchedulable: false;mastersSchedulable: true;g" clusterconfigs/manifests/cluster-scheduler-02-config.yml
Copy to Clipboard Copied! 注記この手順の完了後にコントロールプレーンノードをスケジュールできない場合には、クラスターのデプロイに失敗します。
3.11.4. オプション: ワーカーノードへのルーターのデプロイ
インストール時に、インストーラーはルーター Pod をワーカーノードにデプロイします。デフォルトで、インストーラーは 2 つのルーター Pod をインストールします。デプロイされたクラスターが、OpenShift Container Platform クラスター内のサービスに対して予定される外部トラフィック負荷を処理するために追加のルーターを必要とする場合、yaml
ファイルを作成して適切なルーターレプリカ数を設定できます。
ワーカーノードが 1 つだけのクラスターのデプロイはサポートされていません。ルーターのレプリカを変更することで、1 つのワーカーでデプロイする場合の degraded
状態の問題は対処されますが、クラスターは Ingress API の高可用性を失うため、これは実稼働環境には適しません。
デフォルトで、インストーラーは 2 つのルーターをデプロイします。クラスターにワーカーノードがない場合、インストーラーはデフォルトで 2 つのルーターをコントロールプレーンノードにデプロイします。
手順
router-replicas.yaml
ファイルを作成します。apiVersion: operator.openshift.io/v1 kind: IngressController metadata: name: default namespace: openshift-ingress-operator spec: replicas: <num-of-router-pods> endpointPublishingStrategy: type: HostNetwork nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/worker: ""
apiVersion: operator.openshift.io/v1 kind: IngressController metadata: name: default namespace: openshift-ingress-operator spec: replicas: <num-of-router-pods> endpointPublishingStrategy: type: HostNetwork nodePlacement: nodeSelector: matchLabels: node-role.kubernetes.io/worker: ""
Copy to Clipboard Copied! 注記<num-of-router-pods>
を適切な値に置き換えます。1 つのワーカーノードのみを使用している場合、replicas:
を1
に設定します。4 つ以上のワーカーノードを使用している場合、replicas:
のデフォルトの値2
を随時増やすことができます。router-replicas.yaml
ファイルを保存し、これをclusterconfigs/openshift
ディレクトリーにコピーします。cp ~/router-replicas.yaml clusterconfigs/openshift/99_router-replicas.yaml
$ cp ~/router-replicas.yaml clusterconfigs/openshift/99_router-replicas.yaml
Copy to Clipboard Copied!
3.11.5. オプション: BIOS の設定
次の手順では、インストールプロセス中に BIOS を設定します。
手順
- マニフェストを作成します。
ノードに対応する
BareMetalHost
リソースファイルを変更します。vim clusterconfigs/openshift/99_openshift-cluster-api_hosts-*.yaml
$ vim clusterconfigs/openshift/99_openshift-cluster-api_hosts-*.yaml
Copy to Clipboard Copied! BIOS 設定を
BareMetalHost
リソースのspec
セクションに追加します。spec: firmware: simultaneousMultithreadingEnabled: true sriovEnabled: true virtualizationEnabled: true
spec: firmware: simultaneousMultithreadingEnabled: true sriovEnabled: true virtualizationEnabled: true
Copy to Clipboard Copied! 注記Red Hat は 3 つの BIOS 設定をサポートしています。BMC タイプ
irmc
のサーバーのみがサポートされます。他のタイプのサーバーは現在サポートされていません。- クラスターを作成します。
3.11.6. 必要に応じて RAID の設定
次の手順では、インストールプロセス中に RAID (Redundant Array of Independent Disks) を設定します。
- OpenShift Container Platform は、iRMC プロトコルのみを使用してベースボード管理コントローラー (BMC) のハードウェア RAID をサポートします。OpenShift Container Platform 4.14 は、ソフトウェア RAID をサポートしていません。
- ノードにハードウェア RAID を設定する場合は、ノードに RAID コントローラーがあることを確認します。
手順
- マニフェストを作成します。
ノードに対応する
BareMetalHost
リソースを変更します。vim clusterconfigs/openshift/99_openshift-cluster-api_hosts-*.yaml
$ vim clusterconfigs/openshift/99_openshift-cluster-api_hosts-*.yaml
Copy to Clipboard Copied! 注記OpenShift Container Platform 4.14 はソフトウェア RAID をサポートしていないため、以下の例ではハードウェア RAID 設定を使用します。
特定の RAID 設定を
spec
セクションに追加した場合、これが原因でノードはpreparing
フェーズで元の RAID 設定を削除し、RAID で指定された設定を実行します。以下に例を示します。spec: raid: hardwareRAIDVolumes: - level: "0" name: "sda" numberOfPhysicalDisks: 1 rotational: true sizeGibibytes: 0
spec: raid: hardwareRAIDVolumes: - level: "0"
1 name: "sda" numberOfPhysicalDisks: 1 rotational: true sizeGibibytes: 0
Copy to Clipboard Copied! - 1
level
は必須フィールドであり、その他はオプションのフィールドです。
spec
セクションに空の RAID 設定を追加した場合、空の設定が原因で、ノードはpreparing
フェーズで元の RAID 設定を削除しますが、新しい設定は実行しません。以下に例を示します。spec: raid: hardwareRAIDVolumes: []
spec: raid: hardwareRAIDVolumes: []
Copy to Clipboard Copied! -
spec
セクションにraid
フィールドを追加しない場合、元の RAID 設定は削除されず、新しい設定は実行されません。
- クラスターを作成します。
3.11.7. オプション: ノード上のストレージの設定
Machine Config Operator (MCO) によって管理される MachineConfig
オブジェクトを作成することにより、OpenShift Container Platform ノード上のオペレーティングシステムに変更を加えることができます。
MachineConfig
仕様には、最初の起動時にマシンを設定するための点火設定が含まれています。この設定オブジェクトを使用して、OpenShift Container Platform マシン上で実行されているファイル、systemd サービス、およびその他のオペレーティングシステム機能を変更できます。
手順
ignition config を使用して、ノード上のストレージを設定します。次の MachineSet
マニフェストの例は、プライマリーノード上のデバイスにパーティションを追加する方法を示しています。この例では、インストール前にマニフェストを適用して、プライマリーノードでサイズが 16 GiB の recovery
という名前のパーティションを設定します。
custom-partitions.yaml
ファイルを作成し、パーティションレイアウトを含むMachineConfig
オブジェクトを含めます。apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: primary name: 10_primary_storage_config spec: config: ignition: version: 3.2.0 storage: disks: - device: </dev/xxyN> partitions: - label: recovery startMiB: 32768 sizeMiB: 16384 filesystems: - device: /dev/disk/by-partlabel/recovery label: recovery format: xfs
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: primary name: 10_primary_storage_config spec: config: ignition: version: 3.2.0 storage: disks: - device: </dev/xxyN> partitions: - label: recovery startMiB: 32768 sizeMiB: 16384 filesystems: - device: /dev/disk/by-partlabel/recovery label: recovery format: xfs
Copy to Clipboard Copied! custom-partitions.yaml
ファイルを保存して、clusterconfigs/openshift
ディレクトリーにコピーします。cp ~/<MachineConfig_manifest> ~/clusterconfigs/openshift
$ cp ~/<MachineConfig_manifest> ~/clusterconfigs/openshift
Copy to Clipboard Copied!