第10章 Hosted Control Plane のマシン設定の処理
スタンドアロン OpenShift Container Platform クラスターでは、マシン設定プールがノードのセットを管理します。MachineConfigPool
カスタムリソース (CR) を使用してマシン設定を処理できます。
NodePool
CR の nodepool.spec.config
フィールドで、任意の machineconfiguration.openshift.io
リソースを参照できます。
ホストされたコントロールプレーンでは、MachineConfigPool
CR は存在しません。ノードプールには、一連のコンピュートノードがあります。ノードプールを使用してマシン設定を処理できます。
10.1. ホストされたコントロールプレーンのノードプールの設定
ホストされたコントロールプレーンでは、管理クラスターの config map 内に MachineConfig
オブジェクトを作成することでノードプールを設定できます。
手順
管理クラスターの config map 内に
MachineConfig
オブジェクトを作成するには、次の情報を入力します。apiVersion: v1 kind: ConfigMap metadata: name: <configmap_name> namespace: clusters data: config: | apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: worker name: <machineconfig_name> spec: config: ignition: version: 3.2.0 storage: files: - contents: source: data:... mode: 420 overwrite: true path: ${PATH} 1
- 1
MachineConfig
オブジェクトが保存されているノード上のパスを設定します。
オブジェクトを config map に追加した後、次のように config map をノードプールに適用できます。
$ oc edit nodepool <nodepool_name> --namespace <hosted_cluster_namespace>
apiVersion: hypershift.openshift.io/v1alpha1 kind: NodePool metadata: # ... name: nodepool-1 namespace: clusters # ... spec: config: - name: <configmap_name> 1 # ...
- 1
<configmap_name>
は、設定マップの名前に置き換えます。