Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Create option to specify type for Query service #1132
Create option to specify type for Query service #1132
Changes from all commits
e9dc854
3b497ee
ed1afa2
15bd265
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
While this might fix the current problem, I think the operator can try to come up with the required services to create, based on the environment. For instance, if we detect that we are running on AKS, we might return a list of services that include a NodePort service (in addition, or instead of another service). Hence my suggestion in the original issue to change the following to return a list of services:
jaeger-operator/pkg/service/query.go
Lines 12 to 53 in 1dce126
Similar to what we have for the collector:
jaeger-operator/pkg/service/collector.go
Lines 15 to 21 in 1dce126
If it's a problem to have them created by default in all platforms, then flags could be added to control whether they should be created.
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've started down the path of allowing a list of ServiceType identifiers to be specified, and I can certainly make the
service.NewQueryServices()
function return a list of Service definitions, but there are a few places that assume there is a single query service that I'm not sure how to handle. The callers ofservice.NewQueryService()
are already returning lists of Service definitions, so adapting them to receive a list of Service definitions isn't too hard.The place I'm running into trouble is naming of the services and the places that use
service.GetNameForQueryService()
and expect a single result. Specifically, in theingress.QueryIngress
androute.QueryRoute
types. Do you have suggestions for how to handle that, or places similar situations are handled I can reference?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 those are mostly tests, but if you have questions about concrete places, share the code and I'll take a look.
If the new service is meant to be used by external constructs, like ALB, then the presence of an ingress/route doesn't matter, right? In that case, I would leave them pointing to the current cluster IP service.
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.
The specific places I'm looking at are the ingress and route packages.
The ingress is actually the important part for my use case. We're using the ALB Ingress Controller which requires
NodePort
(orLoadBalancer
) services. This is part of why I assumed it would be more straightforward to allow specifying theServiceType
. AsNodePort
builds onClusterIP
, andLoadBalancer
builds onNodePort
, specifying a type with a broader scope should enable additional uses without limiting existing uses.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.
Makes sense, I thought you were talking about
service.GetNameForQueryService()
I'm almost convinced that allowing people to set the service type is a indeed a better approach, but allow me one last question: can we somehow identify that
LoadBalancer
is indeed the right default option for the current platform? Is there a way to identify that we are running on AWS? There's typically a CRD that we can check to detect the platform, like we do for OpenShift...Second point to clarify before allowing users to set any kind of values to the service type:
NodePort
andLoadBalancer
might be service types requiring extra permissions. We might want to prevent bad values from being set on platforms that require higher privileges and possibly write the status to the spec. At the very least, we should try to document the behavior and how to enableNodePort
/LoadBalancer
.If you are able to clarify this second point, great. Otherwise, please do create an issue so that I can take a look at it later.
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.
Probably. For EKS at least there is node metadata that would indicate an EKS cluster. I don't think that's the right thing to be looking for, however. The determinant is the ingress controller in use. One could use the Nginx ingress controller on EKS and potentially be fine with a
ClusterIP
service. The operator could look for the existence of akubernetes.io/ingress.class
annotation on theIngress
definition to determine whichServiceType
to use. I would worry about the maintenance load of that approach were I maintaining the operator, and might want more flexibility as a consumer to choose as-yet-unsupported ingress controllers, but I think I can update this PR to work in that manner if that's what you'd prefer.To the second point, I'm not aware of any RBAC restrictions on
ServiceType
but I am definitely not an expert in that area and cannot speak authoritatively on the topic.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.
Let's go with the simplest approach then, and figure out how to make the operator smarter in the future (ie: auto-detect EKS, like we can auto-detect OpenShift).
I can try that on OpenShift and see how it goes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.