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

Add support for NodePort in Jaeger Query Service #1394

Merged
merged 3 commits into from
Mar 27, 2021

Conversation

csp197
Copy link
Contributor

@csp197 csp197 commented Feb 17, 2021

This PR should allow users to expose Jaeger's Query service as a NodePort at a specific port. Earlier, the Jaeger Operator did not support specifying a port value and would depend on K8s to randomly select an apt port value. This should resolve this blocker.

Resolves #1307

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #1394 (0528629) into master (aabb538) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1394      +/-   ##
==========================================
+ Coverage   86.70%   86.73%   +0.03%     
==========================================
  Files          90       91       +1     
  Lines        5017     5059      +42     
==========================================
+ Hits         4350     4388      +38     
- Misses        513      516       +3     
- Partials      154      155       +1     
Impacted Files Coverage Δ
pkg/apis/jaegertracing/v1/jaeger_types.go 100.00% <ø> (ø)
pkg/service/query.go 100.00% <100.00%> (ø)
pkg/upgrade/v1_22_0.go 100.00% <0.00%> (ø)
pkg/deployment/agent.go 100.00% <0.00%> (ø)
pkg/deployment/query.go 100.00% <0.00%> (ø)
pkg/deployment/collector.go 100.00% <0.00%> (ø)
pkg/upgrade/utils.go 50.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aabb538...0528629. Read the comment docs.

@jpkrohling jpkrohling changed the title #1307: Adding support for NodePort in Jaeger Query Service Add support for NodePort in Jaeger Query Service Feb 17, 2021
@jpkrohling
Copy link
Contributor

@rubenvp8510 , would you please review this one?

@@ -90,3 +95,8 @@ func getTypeForQueryService(jaeger *v1.Jaeger) corev1.ServiceType {
}
return corev1.ServiceTypeClusterIP
}

// GetNodePortForQueryService returns the query service NodePort for this Jaeger instance
func GetNodePortForQueryService(jaeger *v1.Jaeger) int {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this function is returning int instead of int32. When you use it you cast it again to int32
I would suggest to change this to:

func GetNodePortForQueryService(jaeger *v1.Jaeger) int32 {
	return jaeger.Spec.Query.NodePort
}

And ged rid of all int32(GetNodePortForQueryService(jaeger)) casts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi -
I set the function to return an int in lieu of an int32, for consistency with the getTargetPortForQueryService function. Let me make the change and update this MR 👍

pkg/service/query_test.go Show resolved Hide resolved
pkg/service/query_test.go Show resolved Hide resolved
pkg/service/query_test.go Show resolved Hide resolved
@rubenvp8510
Copy link
Collaborator

Small comments, overall looks good.

Copy link
Collaborator

@rubenvp8510 rubenvp8510 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit 52b4c70 into jaegertracing:master Mar 27, 2021
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.

Allow specific values for nodeport to be configured
3 participants