3.13. ブートストラップ VM への静的 IP アドレスの割り当て
baremetal ネットワークに DHCP サーバーを使用せずに OpenShift Container Platform をデプロイする場合は、Ignition を使用してブートストラップ VM の静的 IP アドレスを設定する必要があります。
手順
Ignition 設定ファイルを作成します。
$ ./openshift-baremetal-install --dir <cluster_configs> create ignition-configs<cluster_configs>をクラスター設定ファイルへのパスに置き換えます。bootstrap_config.shファイルを作成します。#!/bin/bash BOOTSTRAP_CONFIG="[connection] type=ethernet interface-name=ens3 [ethernet] [ipv4] method=manual addresses=<ip_address>/<cidr> gateway=<gateway_ip_address> dns=<dns_ip_address>" cat <<_EOF_ > bootstrap_network_config.ign { "path": "/etc/NetworkManager/system-connections/ens3.nmconnection", "mode": 384, "contents": { "source": "data:text/plain;charset=utf-8;base64,$(echo "${BOOTSTRAP_CONFIG}" | base64 -w 0)" } } _EOF_ mv <cluster_configs>/bootstrap.ign <cluster_configs>/bootstrap.ign.orig jq '.storage.files += $input' <cluster_configs>/bootstrap.ign.orig --slurpfile input bootstrap_network_config.ign > <cluster_configs>/bootstrap.ign<ip_address>と<cidr>をアドレス範囲の IP アドレスと CIDR に置き換えます。<gateway_ip_address>を、baremetalネットワークのゲートウェイの IP アドレスに置き換えます。<dns_ip_address>をbaremetalネットワーク上の DNS サーバーの IP アドレスに置き換えます。<cluster_configs>をクラスター設定ファイルへのパスに置き換えます。bootstrap_config.shファイルを実行可能にします。$ chmod 755 bootstrap_config.shbootstrap_config.shスクリプトを実行して、bootstrap_network_config.ignファイルを作成します。$ ./bootstrap_config.sh