Skip to content

Commit c8bf477

Browse files
authored
Merge pull request #93119 from skopacz1/OSDOCS-14472
OSDOCS-14472: CPMS custom machine name prefixes
2 parents 153c97a + 6dd4952 commit c8bf477

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

machine_management/control_plane_machine_management/cpmso-configuration.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ include::modules/cpmso-yaml-sample-cr.adoc[leveloffset=+1]
1717
1818
* xref:../../machine_management/control_plane_machine_management/cpmso-managing-machines.adoc#cpmso-feat-config-update_cpmso-managing-machines[Updating the control plane configuration]
1919
20+
[id="cpmso-config-options_{context}"]
21+
== Control plane machine set configuration options
22+
23+
You can configure your control plane machine set to customize your cluster to your needs.
24+
25+
//Adding a custom prefix to control plane machine names
26+
include::modules/cpmso-config-options.adoc[leveloffset=+2]
27+
28+
[role="_additional-resources"]
29+
.Additional resources
30+
* xref:../../machine_management/control_plane_machine_management/cpmso-managing-machines.adoc#cpmso-feat-replace_cpmso-managing-machines[Replacing a control plane machine]
31+
2032
[id="cpmso-sample-yaml-provider-specific_{context}"]
2133
== Provider-specific configuration options
2234

modules/cpmso-config-options.adoc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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

Comments
 (0)