-
Notifications
You must be signed in to change notification settings - Fork 1.4k
OCPBUGS-56954: Disallow 1 worker node with exception #10042
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
|
@sadasu: This pull request references Jira Issue OCPBUGS-56954, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/jira refresh |
|
@sadasu: This pull request references Jira Issue OCPBUGS-56954, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: 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. |
6ecd1b4 to
569a247
Compare
1 worker node is allowed only when SNO is configured on platforms None or External. Add validation disallowing 1 worker node for other scenarios.
569a247 to
9dbd36b
Compare
|
@sadasu: The following tests failed, say
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. |
|
/payload ? |
|
|
||
| // Validate that exactly 1 worker node is allowed only when a single control plane node is provisioned on platforms None or External | ||
| if computeReplicas == 1 && controlReplicas != 1 && !(platform.None != nil || platform.External != nil) { | ||
| allErrs = append(allErrs, field.Invalid(fldPath, computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or 2 workers for multi-node clusters")) |
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 say
| allErrs = append(allErrs, field.Invalid(fldPath, computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or 2 workers for multi-node clusters")) | |
| allErrs = append(allErrs, field.Invalid(fldPath, computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or at least 2 workers for multi-node clusters")) |
in this error msg?
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.
+1 as users might mistake it to exactly 2. We should probably use the correct field path:
| allErrs = append(allErrs, field.Invalid(fldPath, computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or 2 workers for multi-node clusters")) | |
| allErrs = append(allErrs, field.Invalid(fldPath.Child("replicas"), computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or at least 2 workers for multi-node clusters")) |
|
Performed pre-merge testing with this PR, and the installer correctly handles the various scenarios where 1 worker is set in the install-config.
|
|
|
||
| // Validate that exactly 1 worker node is allowed only when a single control plane node is provisioned on platforms None or External | ||
| if computeReplicas == 1 && controlReplicas != 1 && !(platform.None != nil || platform.External != nil) { | ||
| allErrs = append(allErrs, field.Invalid(fldPath, computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or 2 workers for multi-node clusters")) |
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.
+1 as users might mistake it to exactly 2. We should probably use the correct field path:
| allErrs = append(allErrs, field.Invalid(fldPath, computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or 2 workers for multi-node clusters")) | |
| allErrs = append(allErrs, field.Invalid(fldPath.Child("replicas"), computeReplicas, "exactly 1 worker node is not allowed for this platform and configuration. Use 0 workers for single-node clusters or at least 2 workers for multi-node clusters")) |
| // Validate that exactly 1 worker node is allowed only when a single control plane node is provisioned on platforms None or External | ||
| if computeReplicas == 1 && controlReplicas != 1 && !(platform.None != nil || platform.External != nil) { |
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.
Validate that exactly 1 worker node is allowed only when a single control plane node is provisioned on platforms None or External
Regarding the comment, it hints that only SNO and platform none/external is allowed. But from #10042 (comment) and official doc, either SNO or none/external platform is allowed, which also matches the current code implementation.
I guess the comment is incorrect?
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.
| // Validate that exactly 1 worker node is allowed only when a single control plane node is provisioned on platforms None or External | |
| if computeReplicas == 1 && controlReplicas != 1 && !(platform.None != nil || platform.External != nil) { | |
| // Validate that exactly 1 worker node is allowed only in either the following scenarios: | |
| // 1. A single control plane node (SNO) is provisioned. | |
| // 2. Platforms are None or External. | |
| if computeReplicas == 1 { | |
| isSNO := controlReplicas == 1 | |
| isAllowedPlatform := platform.None != nil || platform.External != nil | |
| if !isSNO && !isAllowedPlatform { |
nit: It seems a bit more verbose, but improves readability? WDYT?
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.
1+1 is actually not a valid topology on day 1. Assisted is not capable of creating an SNO with worker nodes.
But 3+1 is actually a valid topology, the bug report notwithstanding.
| { | ||
| name: "one compute replica, one control plane, AWS", | ||
| installConfig: func() *types.InstallConfig { | ||
| c := validInstallConfig() |
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.
| c := validInstallConfig() | |
| c := validInstallConfig() | |
| c.ControlPlane.Replicas = ptr.Int64(1) |
The default now is 3 right? As in line 33-37. So we need to set it 1, which makes this case valid (i.e. expectedError to be nil)?
1 worker node is allowed only when SNO is configured on platforms None or External. Add validation disallowing 1 worker node for other scenarios.