-
Notifications
You must be signed in to change notification settings - Fork 113
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
Inherit scheduling for workloads from Compliance Operator manager #756
Conversation
When the Compliance Operator was first coded, some assumptions were made that were specific to Openshift. One of these assumptions was the fact that the `node-role.kubernetes.io/` was more actively used amongst other distros. An even worst assumption was that the `master` role was always available. These statements hold true for OpenShift, but not for other distros like EKS. This PR removes that assumption by making every workload inherit the same `nodeSelector` and `tolerations` from the controller manager. This is done by passing this information to every controller. However, using the information is optional. When CO begins, the manager will query it's own pod and fetch this information. Failure to do so will result in an error. Since we fetch the operator name and namespace from constants, the constants were modified to not depend any more on k8sutils. the aforementioned library will no longer be available in further versions of operator-sdk, so it's better to move away from it now little by little. Signed-off-by: Juan Antonio Osorio Robles <[email protected]>
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.
Quick initial pass, but I'd like to try this out on an EKS cluster.
@@ -219,8 +220,14 @@ func RunOperator(cmd *cobra.Command, args []string) { | |||
os.Exit(1) | |||
} | |||
|
|||
getSIErr, si := getSchedulingInfo(ctx, mgr.GetAPIReader()) | |||
if getSIErr != nil { | |||
log.Error(getSIErr, "Getting control plane schedling info") |
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.
nit: scheduling*
- key: "node.kubernetes.io/not-ready" | ||
operator: "Exists" | ||
effect: "NoExecute" | ||
tolerationSeconds: 120 |
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.
Ok - so by removing these here, we're inheriting a set of global tolerances somewhere?
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.
was this here to prevent pods from getting evicted on node updates? @JAORMX
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JAORMX, Vincent056 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When the Compliance Operator was first coded, some assumptions were made
that were specific to Openshift. One of these assumptions was the fact
that the
node-role.kubernetes.io/
was more actively used amongst otherdistros. An even worst assumption was that the
master
role was alwaysavailable. These statements hold true for OpenShift, but not for other
distros like EKS.
This PR removes that assumption by making every workload inherit the
same
nodeSelector
andtolerations
from the controller manager. Thisis done by passing this information to every controller. However, using
the information is optional.
When CO begins, the manager will query it's own pod and fetch this
information. Failure to do so will result in an error.
Since we fetch the operator name and namespace from constants, the
constants were modified to not depend any more on k8sutils. the
aforementioned library will no longer be available in further versions
of operator-sdk, so it's better to move away from it now little by
little.
Signed-off-by: Juan Antonio Osorio Robles [email protected]