[release-4.13] OCPBUGS-14432: Check that number of replicas matches hosts#7221
Conversation
If the number of compute replicas is not configured, a default of 3 will be used. If the number of baremetal hosts configured does not match this, a failure will occur at installation time. Add a couple messages when the ISO is created to help catch config problems with the replicas before installation. - An info message with the number of replicas being used which is useful if not configured - A warning message if the number of replicas does not match the number of configured hosts
|
@openshift-cherrypick-robot: Jira Issue OCPBUGS-10342 has been cloned as Jira Issue OCPBUGS-14432. Will retitle bug to link to clone. DetailsIn 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 kubernetes/test-infra repository. |
|
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-14432, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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 kubernetes/test-infra repository. |
|
@openshift-cherrypick-robot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andfasano The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| numWorkers++ | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This will fail spuriously in a case like:
- role: ""
- role: ""
- role: master
- role: master
- role: master
We need to iterate over the hosts twice, once to count the explicit roles and once for the implicit ones.
There was a problem hiding this comment.
I think that the original validation was taken from the #5205, where the very same test scenario was addressed by having the hosts sorted by role before applying the validation.
There was a problem hiding this comment.
Thanks @andfasano, yes it was based on the baremetal validation. As this list will be sorted I think we can use the one loop as it currently has and not need to iterate over the hosts a 2nd time.
| // If not defined, the roles will be matched to replicas | ||
| if numMasters < numRequiredMasters { | ||
| numMasters++ | ||
| } else if numWorkers < numRequiredWorkers { |
There was a problem hiding this comment.
This needs to be unconditional if we want to catch the case where there are more hosts defined than replicas.
There was a problem hiding this comment.
Good point. As this PR is auto cherry-pick of #7059 I'll create a new master PR/bug and fix it there, then cherry-pick that.
| if numMasters != numRequiredMasters { | ||
| logrus.Warnf("The number of hosts configured as masters (%d) does not match the master replicas (%d)", numMasters, numRequiredMasters) | ||
| } | ||
| if numWorkers != numRequiredWorkers { |
There was a problem hiding this comment.
Given that defining hosts is completely optional, I don't think we should have a warning in the case where numWorkers == 0 (and likewise for numMasters == 0 above).
It would be really unusual to define host-specific data for only some hosts in a particular role, so I think in those cases it makes sense to have a warning.
There was a problem hiding this comment.
I'll add a check for numWorkers/numMasters != 0. Per the previous comment I'll add this a new master PR.
|
/jira refresh |
|
@bfournie: This pull request references Jira Issue OCPBUGS-14432, which is valid. 6 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn 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 kubernetes/test-infra repository. |
|
/hold Let's fix the issues with this on master first, and backport everything at the same time. |
|
@bfournie: Closed this PR. DetailsIn 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 kubernetes/test-infra repository. |
This is an automated cherry-pick of #7059
/assign bfournie