|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * machine_management/cpmso-configuration.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="cpmso-config-prefix_{context}"] |
| 7 | += Adding a custom prefix to control plane machine names |
| 8 | + |
| 9 | +You can customize the prefix of machine names that the control plane machine set creates. |
| 10 | +This can be done by editing the `ControlPlaneMachineSet` custom resource (CR). |
| 11 | + |
| 12 | +.Procedure |
| 13 | + |
| 14 | +. Edit the `ControlPlaneMachineSet` CR by running the following command: |
| 15 | ++ |
| 16 | +[source,terminal] |
| 17 | +---- |
| 18 | +$ oc edit controlplanemachineset.machine.openshift.io cluster \ |
| 19 | + -n openshift-machine-api |
| 20 | +---- |
| 21 | + |
| 22 | +. Edit the `.spec.machineNamePrefix` field of the `ControlPlaneMachineSet` CR: |
| 23 | ++ |
| 24 | +[source,yaml] |
| 25 | +---- |
| 26 | +apiVersion: machine.openshift.io/v1 |
| 27 | +kind: ControlPlaneMachineSet |
| 28 | +metadata: |
| 29 | + name: cluster |
| 30 | + namespace: openshift-machine-api |
| 31 | +spec: |
| 32 | + machineNamePrefix: <machine_prefix> |
| 33 | +# ... |
| 34 | +---- |
| 35 | ++ |
| 36 | +where `<machine_prefix>` specifies a prefix name that follows the requirements for a lowercase RFC 1123 subdomain. |
| 37 | ++ |
| 38 | +[IMPORTANT] |
| 39 | +==== |
| 40 | +A lowercase RFC 1123 subdomain must consist of only lowercase alphanumeric characters, hyphens ('-'), and periods ('.'). |
| 41 | +Each block, separated by periods, must start and end with an alphanumeric character. |
| 42 | +Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted. |
| 43 | +==== |
| 44 | + |
| 45 | +. Save your changes. |
| 46 | + |
| 47 | +.Next steps |
| 48 | + |
| 49 | +* If you changed only the value of the `machineNamePrefix` parameter, clusters that use the default `RollingUpdate` update strategy are not automatically updated. |
| 50 | +To propagate this change, you must replace your control plane machines manually, regardless of the update strategy for the cluster. |
| 51 | +For more information, see "Replacing a control plane machine". |
0 commit comments