Skip to content
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

feat: add annotations for external service host and port in MR service, fixes RHOAIENG-11092 #125

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

dhirajsb
Copy link
Contributor

Description

Add annotations for external service host and port in k8s MR service
Fixes RHOAIENG-11092

How Has This Been Tested?

Tested istio and non-istio samples to look for annotations being set correctly in istio sample only.

Merge criteria:

  • The commits and have meaningful messages; the author will squash them after approval or will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@dhirajsb dhirajsb requested review from tarilabs and mturley August 22, 2024 05:34
@dhirajsb
Copy link
Contributor Author

@mturley I added a default annotation routing.opendatahub.io/external-address for dashboard and protocol specific annotations routing.opendatahub.io/external-address-rest, and routing.opendatahub.io/external-address-grpc for any other clients looking for protocol specific address.

@tarilabs tarilabs requested a review from a team August 22, 2024 07:12
Copy link
Member

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left an optional comment, I understand 3 annotations will be added.

Thanks Dhiraj,
/lgtm

Comment on lines 17 to 19
routing.opendatahub.io/external-address: {{.Name}}-rest.{{.Spec.Istio.Gateway.Domain}}:{{.Spec.Istio.Gateway.Rest.Port}}
routing.opendatahub.io/external-address-rest: {{.Name}}-rest.{{.Spec.Istio.Gateway.Domain}}:{{.Spec.Istio.Gateway.Rest.Port}}
routing.opendatahub.io/external-address-grpc: {{.Name}}-grpc.{{.Spec.Istio.Gateway.Domain}}:{{.Spec.Istio.Gateway.Grpc.Port}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just making the default one to be the rest, so to avoid the routing.opendatahub.io/external-address-rest annotation which seems redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For uniformity across protocols. And it also makes it clear that the rest endpoint is the default endpoint as well. Does that make sense?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dashboard could just use the -rest endpoint if we want to, since it specifically expects the REST API. Not sure what you mean by uniformity across protocols being a reason for the default annotation.

Also, are these "external" in the sense described by this doc or should we be using "public"? (i.e. are they accessible outside the cluster?) https://docs.google.com/document/d/1UA9c8DWVQg1nzkiw3b34xofL8KCw_MM2hD5MOf-P2VU/edit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that dashboard doesn't care about the grpc protocol, so it would be easier to have a default annotation routing.opendatahub.io/external-address for clients like dashboard that always use a default/common protocol for the service.
For other clients, they can look for the endpoint for a specific protocol by adding the protocol suffix. Hence the redundancy.
I am hesitant about using public, since that has RBAC connotations, i.e. whether they are publicly accessible i.e. not secured. External is external to the mesh right now.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dashboard does use gRPC for DSP, just not ModelRegistry currently. If we extend this pattern to other services we'll want to have each usage be explicit about what protocol/API it's using.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll drop the annotation without the protocol suffix in that case.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Yeah I think that makes sense for our use case

Copy link

@mturley mturley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just not sure we need the default annotation but I'm fine either way.

Edit: ah I didn't see your latest comment - sounds good.

@dhirajsb dhirajsb merged commit c4f88ba into opendatahub-io:main Aug 22, 2024
2 checks passed
@dhirajsb dhirajsb deleted the feat/service-annotation branch August 22, 2024 20:24
rareddy pushed a commit to rareddy/model-registry-operator that referenced this pull request Oct 1, 2024
…e, fixes RHOAIENG-11092 (opendatahub-io#125)

* feat: add annotations for external service host and port in MR service, fixes RHOAIENG-11092

* fix: remove unprefixed non protocol annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants