|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * post_installation_configuration/cluster-tasks.adoc |
| 4 | + |
| 5 | +[id="creating-infra-machines_{context}"] |
| 6 | += Creating infrastructure machines |
| 7 | + |
| 8 | +If you need infrastructure machines to have dedicated configurations, then you must create an infra pool. |
| 9 | + |
| 10 | +.Procedure |
| 11 | + |
| 12 | +. Create a machine config pool that contains both the worker role and your custom role as machine config selector: |
| 13 | ++ |
| 14 | +[source,terminal] |
| 15 | +---- |
| 16 | +$ cat infra.mcp.yaml |
| 17 | +---- |
| 18 | ++ |
| 19 | +.Example output |
| 20 | +[source,yaml] |
| 21 | +---- |
| 22 | +apiVersion: machineconfiguration.openshift.io/v1 |
| 23 | +kind: MachineConfigPool |
| 24 | +metadata: |
| 25 | + name: infra |
| 26 | +spec: |
| 27 | + machineConfigSelector: |
| 28 | + matchExpressions: |
| 29 | + - {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,infra]} |
| 30 | + nodeSelector: |
| 31 | + matchLabels: |
| 32 | + node-role.kubernetes.io/infra: "" |
| 33 | +---- |
| 34 | + |
| 35 | +. After you have the YAML file, you can create the machine config pool: |
| 36 | ++ |
| 37 | +[source,terminal] |
| 38 | +---- |
| 39 | +$ oc create -f infra.mcp.yaml |
| 40 | +---- |
| 41 | + |
| 42 | +. Check the machine configs to ensure that the infrastructure configuration rendered successfully: |
| 43 | ++ |
| 44 | +[source,terminal] |
| 45 | +---- |
| 46 | +$ oc get machineconfig |
| 47 | +---- |
| 48 | ++ |
| 49 | +.Example output |
| 50 | +[source,terminal] |
| 51 | +---- |
| 52 | +NAME GENERATEDBYCONTROLLER IGNITIONVERSION CREATED |
| 53 | +00-master 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 54 | +00-worker 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 55 | +01-master-container-runtime 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 56 | +01-master-kubelet 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 57 | +01-worker-container-runtime 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 58 | +01-worker-kubelet 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 59 | +99-master-1ae2a1e0-a115-11e9-8f14-005056899d54-registries 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 60 | +99-master-ssh 2.2.0 31d |
| 61 | +99-worker-1ae64748-a115-11e9-8f14-005056899d54-registries 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 31d |
| 62 | +99-worker-ssh 2.2.0 31d |
| 63 | +rendered-infra-4e48906dca84ee702959c71a53ee80e7 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 23m |
| 64 | +rendered-master-072d4b2da7f88162636902b074e9e28e 5b6fb8349a29735e48446d435962dec4547d3090 2.2.0 31d |
| 65 | +rendered-master-3e88ec72aed3886dec061df60d16d1af 02c07496ba0417b3e12b78fb32baf6293d314f79 2.2.0 31d |
| 66 | +rendered-master-419bee7de96134963a15fdf9dd473b25 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 17d |
| 67 | +rendered-master-53f5c91c7661708adce18739cc0f40fb 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 13d |
| 68 | +rendered-master-a6a357ec18e5bce7f5ac426fc7c5ffcd 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 7d3h |
| 69 | +rendered-master-dc7f874ec77fc4b969674204332da037 5b6fb8349a29735e48446d435962dec4547d3090 2.2.0 31d |
| 70 | +rendered-worker-1a75960c52ad18ff5dfa6674eb7e533d 5b6fb8349a29735e48446d435962dec4547d3090 2.2.0 31d |
| 71 | +rendered-worker-2640531be11ba43c61d72e82dc634ce6 5b6fb8349a29735e48446d435962dec4547d3090 2.2.0 31d |
| 72 | +rendered-worker-4e48906dca84ee702959c71a53ee80e7 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 7d3h |
| 73 | +rendered-worker-4f110718fe88e5f349987854a1147755 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 17d |
| 74 | +rendered-worker-afc758e194d6188677eb837842d3b379 02c07496ba0417b3e12b78fb32baf6293d314f79 2.2.0 31d |
| 75 | +rendered-worker-daa08cc1e8f5fcdeba24de60cd955cc3 365c1cfd14de5b0e3b85e0fc815b0060f36ab955 2.2.0 13d |
| 76 | +---- |
| 77 | + |
| 78 | +. To deploy changes to a custom pool, create a machine config that uses the custom pool name as the label, such as `infra` in this example: |
| 79 | ++ |
| 80 | +[source,terminal] |
| 81 | +---- |
| 82 | +$ cat infra.mc.yaml |
| 83 | +---- |
| 84 | ++ |
| 85 | +.Example output |
| 86 | +[source,yaml] |
| 87 | +---- |
| 88 | +apiVersion: machineconfiguration.openshift.io/v1 |
| 89 | +kind: MachineConfig |
| 90 | +metadata: |
| 91 | + labels: |
| 92 | + machineconfiguration.openshift.io/role: infra |
| 93 | + name: 51-infra |
| 94 | +spec: |
| 95 | + config: |
| 96 | + ignition: |
| 97 | + version: 2.2.0 |
| 98 | + storage: |
| 99 | + files: |
| 100 | + - contents: |
| 101 | + source: data:,infra |
| 102 | + filesystem: root |
| 103 | + mode: 0644 |
| 104 | + path: /etc/infratest |
| 105 | +---- |
| 106 | + |
| 107 | +. Apply the machine config, then verify that the infra-labeled nodes are updated with the configuration file: |
| 108 | ++ |
| 109 | +[source,terminal] |
| 110 | +---- |
| 111 | +$ oc create -f infra.mc.yaml |
| 112 | +---- |
0 commit comments