-
Notifications
You must be signed in to change notification settings - Fork 34
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
RHOAIENG-7327: Set certs on both creation and update of notebooks #373
RHOAIENG-7327: Set certs on both creation and update of notebooks #373
Conversation
/hold Working in progress |
I haven't tested this in any way yet, but LGTM in general. I'm trying to recall what were the reasons we didn't do it this way from the start? 🤔 |
err = CheckAndMountCACertBundle(ctx, w.Client, notebook, log) | ||
if err != nil { | ||
return admission.Errored(http.StatusInternalServerError, err) | ||
} |
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.
My first impression of this is that this is triggered only when the Notebook CR is changed somehow. But the original issue is talking also about the plain workbench restart (https://issues.redhat.com/browse/RHOAIENG-7327) - so this change covers also this case?
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.
Looks ok to me, starting the notebook updates it, because starting/stopping (and apparently restarting!) is done through setting annotations on the CR
if metav1.HasAnnotation(instance.ObjectMeta, "kubeflow-resource-stopped") { |
(I did not know the CR supports restarting, that is not exposed in the dashboard ui)
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.
Correct, currently, I have an ose-cli cronjob running every evening that scales down the statefulsets / stops the notebooks in all namespaces (cause users forget and we don't have long-running ones):
currentdatetimenotebook=$(date '+%Y-%m-%dT%H:%M:%SZ');
oc patch notebook $notebook -n "$ds_ns" --type="json" -p="[{\"op\": \"add\", \"path\": \"/metadata/annotations/kubeflow-resource-stopped\", \"value\":\"$currentdatetimenotebook\"}]";
Got that hint from dashboard workbench slider GUI ...
and yes, restarting is not part of dashboard logic currently on the part of notebooks, only start / stop i.e. omitting / deleting kubeflow-resource-stopped leads to start.
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.
Yes, correct the goal is to update certs, in both cases
Notebook CR change or Restart (which is toggle start/stop).
This would take care of all the scenarios.
/unhold |
This is ready for review.
The reason was, initially, as we started with this Later, when we did the combination of both self-signed and global. |
It's missing tests, as specified on the Jira ticket; do you want to create new follow-up ticket to add the tests later? |
Signed-off-by: Harshad Reddy Nalla <[email protected]>
/lgtm |
5ad9c05
to
2b80f46
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.
few suggestions about the test documentation strings
components/odh-notebook-controller/controllers/notebook_controller_test.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_controller_test.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_controller_test.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_controller_test.go
Outdated
Show resolved
Hide resolved
components/odh-notebook-controller/controllers/notebook_controller_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Harshad Reddy Nalla <[email protected]> Co-authored-by: Jiri Daněk <[email protected]>
db1b50a
to
35263e2
Compare
Ready of review again |
components/odh-notebook-controller/controllers/notebook_controller_test.go
Show resolved
Hide resolved
/lgtm |
/approve Thanks for the review. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harshad16 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 |
5d51c2b
into
opendatahub-io:v1.7-branch
/cherrypick stable |
@harshad16: #373 failed to apply on top of branch "stable":
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 kubernetes-sigs/prow repository. |
Description
Set certs on both creation and update of notebooks
Fixes: https://issues.redhat.com/browse/RHOAIENG-7327
How Has This Been Tested?
For testing, the setup would use the RHOAI operator instance:
Create a workbench instance in 2.9+ RHOAI version.
Once the workbench is created check the details
after that set the trustedCABundle setup inside the
DSCI instance
Merge criteria: