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

Allow kubernetes discoverer to use gRPC destinations #829

Merged

Conversation

andrewhan-square
Copy link
Contributor

Summary

I updated the kubnetes discoverer to look for veneur global containers with a grpc port name. This will allow us to specify that we are using gRPC.
Additionally, I removed the http:// prefix in the saved podIp because it hits a "too many colons in address" error with gRPC. This will still work with forwarding with http because in proxy.go, the doPost method will check and append it if its missing.

Motivation

In Kubernetes we want to proxy metrics to veneur global with gRPC. This edit in our fork fixed the issues we were hitting.

Test plan

Ran this in our veneur-proxy pods that utilize this Kubernetes discoverer code with gRPC to verify everything works.

Rollout/monitoring/revert plan

This change should be backwards compatible as the doPost function for http communication prepends the necessary prefix. This only affects gRPC destinations used by proxysrv which shouldn't have been available with kubernetes.

Summary
I updated the kubnetes discoverer to look for veneur global containers with a grpc port name. This will allow us to specify that we are using gRPC.
Additionally, I removed the http:// prefix in the saved podIp because it hits a "too many colons in address" error with gRPC. This will still work with forwarding with http because in proxy.go, the doPost method will check and append it if its missing.
This PR is related to issue stripe#762 as it removes the http hard coding.

Motivation
In Kubernetes we want to proxy metrics to veneur global with gRPC. This edit in our fork fixed the issues we were hitting.

Test plan
Ran this in our veneur-proxy pods that utilize this Kubernetes discoverer code with gRPC to verify everything works.

Rollout/monitoring/revert plan
This change should be backwards compatible as the doPost function for http communication prepends the necessary prefix. This only affects gRPC destinations used by proxysrv which shouldn't have been available with kubernetes.
@CLAassistant
Copy link

CLAassistant commented Apr 27, 2021

CLA assistant check
All committers have signed the CLA.

@andrewhan-square
Copy link
Contributor Author

Hi @aditya-stripe , I was able to get our management to fill out Stripe's corporate CLA instead of the one for individual contributions but I don't think that the CLAAssistant is picking it up. Could you help verify if the corporate form is filled and remove the CLA check in the PR if everything looks good? Thanks!

cc: @csolidum

@andrewhan-square
Copy link
Contributor Author

Hi @aditya-stripe , I was able to get our management to fill out Stripe's corporate CLA instead of the one for individual contributions but I don't think that the CLAAssistant is picking it up. Could you help verify if the corporate form is filled and remove the CLA check in the PR if everything looks good? Thanks!

cc: @csolidum

@ChimeraCoder

@andrewhan-square
Copy link
Contributor Author

Hm pinging maybe @eriwo-stripe or @rma-stripe to help check on the CLA

@eriwo-stripe
Copy link
Contributor

Hey @andrewhan-square, I'm checking on this now.

@eriwo-stripe
Copy link
Contributor

I got confirmation that Square has signed a Corporate CLA and it is okay to waive the CLA check for this PR.

@csolidum
Copy link
Contributor

csolidum commented Jun 2, 2021

@eriwo-stripe I'm interested in helping push this forward. Do you have any guidance on what needs to be done to fix the failing circleci test_tip check and get a reviewer on this PR?

@eriwo-stripe
Copy link
Contributor

@csolidum @andrewhan-square: The test_tip failure was just fixed the other day in this PR: #833. I believe rebasing on master and then rerunning the tests should fix it. Once that is done I can approve this.

Copy link
Contributor

@eriwo-stripe eriwo-stripe left a comment

Choose a reason for hiding this comment

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

Minor change to keep the changelog in order as we have already released 14.1.0.

CHANGELOG.md Outdated
Comment on lines 17 to 19
## Bugfixes
* A fix for forwarding metrics with gRPC using the kubernetes discoverer. Thanks, [androohan](https://github.com/androohan)!

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you create a new 14.2.0 section at the top of the readme and move this there?

Copy link
Contributor

Choose a reason for hiding this comment

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

Updated, wasn't sure to put for the date so put unreleased

kubernetes.go Outdated
@@ -83,8 +89,7 @@ func (kd *KubernetesDiscoverer) GetDestinationsForService(serviceName string) ([
continue
}

// prepend with // so that it is a valid URL parseable by url.Parse
podIp := fmt.Sprintf("http://%s:%s", pod.Status.PodIP, forwardPort)
podIp := fmt.Sprintf("%s:%s", pod.Status.PodIP, forwardPort)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a test to verify the assertion that "This will still work with forwarding with http because in proxy.go, the doPost method will check and append it if its missing."?

Copy link
Contributor

Choose a reason for hiding this comment

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

added back the "http://" prefix for tcp and http ports. Pulled out some of this logic into another function and added some tests around that.

@csolidum
Copy link
Contributor

Hm pinging maybe @eriwo-stripe or @rma-stripe to help check on the CLA

I think I should be on the same CLA agreement as @andrewhan-square

@csolidum
Copy link
Contributor

@eriwo-stripe let me know if there are any more changes needed before this PR is merged.

Copy link
Contributor

@eriwo-stripe eriwo-stripe left a comment

Choose a reason for hiding this comment

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

LGTM!

@eriwo-stripe eriwo-stripe merged commit cf35312 into stripe:master Jun 21, 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.

4 participants