-
Notifications
You must be signed in to change notification settings - Fork 1.8k
OSDOCS-14472: CPMS custom machine name prefixes #93119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@skopacz1: This pull request references OSDOCS-14472 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
🤖 Thu May 08 16:30:21 - Prow CI generated the docs preview: |
@skopacz1: This pull request references OSDOCS-14472 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this as a procedure based on the docs epic content journey, but if this would be better represented as just a conceptual section with an example snippet (i.e. no instructions on how to edit the CR), let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a really generic (and perhaps not very useful) intro to the new section below. Please feel free to suggest any other wording.
@skopacz1: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
||
. Save your changes to the `ControlPlaneMachineSet` CR. | ||
|
||
. If you are using an `OnDelete` update strategy for your control plane machine set: Manually apply the prefix to the name of any existing machines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are verification steps to add, please let me know.
For example, what command to run to check machine names, and example output of that command
** The name contains no more than 253 characters | ||
** The name contains only lowercase alphanumeric characters, `-`, or `.` | ||
** The name starts and ends with an alphanumeric character | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation needs some modification. Please have a look at https://github.com/openshift/api/blob/7318813e48da641a8b2e068018a3723a5cc34d5e/machine/v1/types_controlplanemachineset.go#L45-L61 details.
// It must be a lowercase RFC 1123 subdomain, consisting of lowercase
// alphanumeric characters, hyphens ('-'), and periods ('.').
// Each block, separated by periods, must start and end with an alphanumeric character.
// Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted.
// The prefix must be between 1 and 245 characters in length.
|
||
. Save your changes to the `ControlPlaneMachineSet` CR. | ||
|
||
. If you are using an `OnDelete` update strategy for your control plane machine set: Manually apply the prefix to the name of any existing machines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually apply the prefix to the name of any existing machines.
I don't think there is any different way to apply the prefix for OnDelete
or RollingUpdate
update strategy. In both the cases, we need to modify .spec.machineNamePrefix
field.
- For
OnDelete
: We need to delete an existing machine; then only a new replacement machine will be created with the prefixed name. - For
RollingUpdate
: We need to force a rollout, maybe by adding some labels to the machine template metadata.
/cc @huali9, could you please help with some user-facing commands and outputs which can be added as an example? TiA!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For both OnDelete
and RollingUpdate
, we can delete an existing machine, then a new replacement machine will be created with the prefixed name.
For RollingUpdate
, we can also add some labels to the master machine template metadata to force a rollout. for example, under a master machine's .spec.providerSpec.value.metadata, add a label like
metadata:
labels:
old: old
then a new replacement machine will be created with the prefixed name.
-n openshift-machine-api | ||
---- | ||
|
||
. Add the following snippet to the `ControlPlaneMachineSet` CR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a snippet? I am not sure if this the right wording here. The intention would be to edit .spec.machineNamePrefix
field of ControlPlaneMachineSet
CR.
= Adding a custom prefix to control plane machine names | ||
|
||
You can customize the prefix of machine names created by a control plane machine set. | ||
This can be done by editing a control plane machine set custom resource (CR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done by editing a control plane machine set custom resource (CR) | |
This can be done by editing the control plane machine set custom resource (CR) |
[id="cpmso-config-prefix_{context}"] | ||
= Adding a custom prefix to control plane machine names | ||
|
||
You can customize the prefix of machine names created by a control plane machine set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can customize the prefix of machine names created by a control plane machine set. | |
You can customize the prefix of machine names created by the control plane machine set. |
|
||
// Saw the step below in another procedure, let me know if it's good to keep it in here. | ||
|
||
. Edit your control plane machine set CR by running the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which one is the right way to write this?
- control plane machine set
- control plane machine set CR
- control plane machine set custom resource (CR)
ControlPlaneMachineSet
CR
I am seeing all these are being used interchangeably.
|
||
.Procedure | ||
|
||
// Saw the step below in another procedure, let me know if it's good to keep it in here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this?
/cc @huali9 |
OSDOCS-14472
Version(s): 4.19+
This PR adds a feature to add custom prefixes to machine names in control plane machine sets.
QE review:
Preview: Control plane machine set configuration options