-
Notifications
You must be signed in to change notification settings - Fork 61
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
Feature: Create cert Secret and update KServe local gateway #221
Conversation
Signed-off-by: jooho lee <[email protected]>
Signed-off-by: jooho lee <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Jooho 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 |
/test unit |
1 similar comment
/test unit |
} | ||
|
||
func (r *KserveGatewayReconciler) Delete(ctx context.Context, log logr.Logger, isvc *kservev1beta1.InferenceService) error { | ||
log.V(1).Info(fmt.Sprintf("Deleting serving cert secret(%s) in the namespace(%s)", isvc.Name, isvc.Namespace)) |
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.
this can be debug
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.
I referenced the other reconcile and they were using info so I followed it.
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.
okay, but, on normal operation the fewer info messages we have the better.
IMHO, this is one example of informational messages that could be set to debug only.
return err | ||
} | ||
|
||
log.V(1).Info(fmt.Sprintf("Deleting the Server(%s) from KServe local gateway in the istio-system namespace", isvc.Name)) |
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.
here as well
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.
same here
Signed-off-by: jooho lee <[email protected]>
5e76504
to
04dc6dd
Compare
Signed-off-by: jooho lee <[email protected]>
Signed-off-by: jooho lee <[email protected]>
04dc6dd
to
69fa39e
Compare
Signed-off-by: jooho lee <[email protected]>
e81094f
to
5390771
Compare
Signed-off-by: jooho lee <[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.
I think the MutatingWebhook needs patches similar to what we have for the ValidatingWebhook.
field patch and webhook patch
var meshNamespace string | ||
var destSecretName string | ||
var portName string |
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.
These are globals... I wonder if it won't lead to race conditions...
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.
make sense. I changed destSecretName
,portName
but I believe meshNamespace should be ok because it is always the same.
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.
updated.
Signed-off-by: jooho lee <[email protected]>
6160559
to
038c090
Compare
Signed-off-by: jooho lee <[email protected]>
Signed-off-by: jooho lee <[email protected]>
038c090
to
1de88b0
Compare
@israel-hdez FYI, I removed mutating webhook and re-add isvc_service_cert_reconciler because it turned out kserve controller rollback the annotation. |
Signed-off-by: jooho lee <[email protected]>
/retest |
Signed-off-by: jooho lee <[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.
Adding some additional comment. It may be easy to just reply so that I understand better.
If you, by chance, would push some code changes, I saw some code commented in _test.go
files. It would be good if you can clean-up them.
if service.Annotations == nil { | ||
service.Annotations = make(map[string]string) | ||
} | ||
service.Annotations = desiredService.Annotations |
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.
Now that this code is back, the old comment still stands...
log.V(1).Info(fmt.Sprintf("Waiting for the creation of the serving certificate Secret(%s) in %s namespace", isvc.Name, isvc.Namespace)) | ||
return 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.
Like my comment in the kserve_isvc_service_cert_reconciler.go
around here, you may want a Watch
on the controller.
...it happens that, typically, the model load takes more time than the provisioning of the certificate. Thus, the model status update would lead to also reconciling the gateway and the svc. So, skipping the Watch
may sound fine, but it is still safer to add it (in case you find how). The motivation is the same as past review: I'm not sure if it is safe to make assumptions on timing/order of unrelated events.
// Remove old secret if src secret is updated | ||
if preDestSecret != nil { | ||
if err := r.client.Delete(ctx, preDestSecret); err != nil { | ||
return 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.
@bartoszmajsak @rcernich This will delete a no longer useful TLS secret and create a new update one with the same name (e.g. at rotation).
Do you know if the ingress gateway will reload it without any changes to the Gateway
? Or does it need to have a new name, and the Gateway
must be updated to effectively reload it?
// Recreate copied secrt when src secret is updated | ||
if !reflect.DeepEqual(srcCertSecret.Data, copiedCertSecret.Data) { | ||
log.V(1).Info(fmt.Sprintf("Recreating for serving certificate Secret(%s) in %s namespace", copiedCertSecret.Name, meshNamespace)) | ||
if err := r.copyServingCertSecretFromIsvcNamespace(ctx, srcCertSecret, copiedCertSecret); err != 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.
Without the Watch
on the controller, I'm failing to understand how this will catch the certificate rotation, because looks like none of the watched & owned resources will be updated and a reconcile won't be triggered.
I think you should add these lines, over here so that units can catch this (in case there is an issue).
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.
As I commented from here, watch can not catch the Secret because it does not have the specific level. I need to think more to solve this rotation part but at the moment, Watch is not the right approach.
This PR was somehow merged accidentally so I created another PR to follow up (#229) |
Description:
This is one of tasks for Private Endpoint Tasks (opendatahub-io/kserve#371)
This PR support the following:
Jira: https://issues.redhat.com/browse/RHOAIENG-7921
(NOTE) Loopy was tested on fedora only.
Test
Env setup
Using source
Using docker image
Create a cluster information script
Install Kserve with a new manifests
Deploy sample sklearn model
Checks