-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support specifying nodeSelector and affinity values in SmbCommonConfig to control pod scheduling #291
Support specifying nodeSelector and affinity values in SmbCommonConfig to control pod scheduling #291
Conversation
Right. These tests probably don't make any sense on a single node setup. I need to think about how to handle that case. |
f54d95a
to
77f14df
Compare
Erm.
Our tests passed, but the I'm marking this as ready for review and kicking off another ci run but if this keeps happening I'll ask reviewers to focus on the actual Go tests status rather than the overall ci state. |
/test centos-ci/sink-clustered/mini-k8s-1.26 |
I think its the following
I can see that the job was triggered within a span of 20 minutes. Image tagging is differentiated by just PR numbers. 1st run completed successfully and the 2nd run fails to find the image for deletion afterwards. |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
77f14df
to
9e7cb54
Compare
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.
See below for a typo, remark and clarification.
9e7cb54
to
e8dfbaf
Compare
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.
lgtm, cool work.
@Mergifyio rebase |
Add labels for "samba-operator.samba.org/common-config-from" and "samba-operator.samba.org/security-config-from" when the server instance is derived from a share using common config or security config CRs. The values of the labels map back to the names of the resources. This can be handy for quickly seeing what resources came from where and when writing tests that need to associate a pod with a CR resource beyond just the SmbShare name. Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
A node selector value found in the common config takes priority over that of the operator config or hard coded default. Signed-off-by: John Mulligan <[email protected]>
This will allow users & admins to customize pod affinity settings for the local cluster's needs. Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
This patch includes the logic to add the anti-affinity rule that you typically want for ctdb clustered smbds at the end of the rules pulled from the common config. Signed-off-by: John Mulligan <[email protected]>
If not every test run will always use the same pattern, possibly defeating the purpose of using random choice in the first place. Signed-off-by: John Mulligan <[email protected]>
Add some tests that check that node selector values and/or affinity rules are passed on from a SmbCommonConfig to the pods that are created. Signed-off-by: John Mulligan <[email protected]>
The new podSettings key allows for control of certain parameters the operator can not guess at. Currently, this allows one to control scheduling via nodeSelector and affinity sections. Signed-off-by: John Mulligan <[email protected]>
Add yet another environment variable to inform the test suite about the outer world. The variable SMBOP_TEST_MIN_NODE_COUNT should be set to the number of nodes that typical pods may be scheduled on, the tests may then use this value to determine if the cluster is in-spec or out-of-spec for tests that require a certain number of nodes. Signed-off-by: John Mulligan <[email protected]>
The tests for the node selector and affinity scheduling require at least two nodes. Previously, the tests would simply fail if there weren't enough nodes to run the test. This patch adds a check such that the test is skipped if there aren't enough nodes - unless the SMBOP_TEST_MIN_NODE_COUNT was specified. This variable acts as a double check on the expected environment. If the number of available nodes is less than that given by the env var the test is required to fail. Signed-off-by: John Mulligan <[email protected]>
In the centosci based testing environment we have an expected number of worker nodes we can pass to the test suite. This can then be used by the suite to determine if the test cluster has been set up according to intended spec. Signed-off-by: John Mulligan <[email protected]>
✅ Branch has been successfully rebased |
e8dfbaf
to
00a4106
Compare
WHY did it dismiss the existing review. There were no conflicts and the rebase was done via mergify. |
Fixes: #283
The new podSettings key allows for control of certain parameters the operator can not or should not guess at. Currently, this allows one to control scheduling via nodeSelector and affinity sections under podSettings in SmbCommonConfig.
It's located in SmbCommonConfig as SmbShare is really supposed to be about the share and less about the server. It's similar to how configuration of network integration is done by SmbCommonConfig. It's certainly not for SmbSecurityConfig :-)
I also added some extra labels to the smb pods so that they can be quickly backtracked to the smbcommonconfig and SmbSecurityConfig that were used to generate them. These labels helped my write the test cases.