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

dependencies: Upgrade all k8s client-go dependent sources to v1.18.X #1627

Merged

Conversation

josephglanville
Copy link
Contributor

This requires pinning grpc for now as istio client-go otherwise pulls in
breaking changes.

Required to make progress on #1366

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 12, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @josephglanville!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 12, 2020
@josephglanville
Copy link
Contributor Author

Signed the CLA.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 12, 2020
@@ -70,5 +75,6 @@ replace (
github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.6.0
github.com/Azure/go-autorest/autorest/azure/auth => github.com/Azure/go-autorest/autorest/azure/auth v0.3.0
github.com/golang/glog => github.com/kubermatic/glog-logrus v0.0.0-20180829085450-3fa5b9870d1d
google.golang.org/grpc => google.golang.org/grpc v1.26.0
Copy link
Contributor

Choose a reason for hiding this comment

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

We are trying to avoid these. Do you know where the conflict arises?

Copy link
Contributor Author

@josephglanville josephglanville Jun 12, 2020

Choose a reason for hiding this comment

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

Problem stems from backwards incompatible changes to gRPC that most dependencies have not upgraded past yet, resulting in errors such as these:

# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
github.com/coreos/etcd/pkg/types
github.com/coreos/etcd/clientv3/balancer/connectivity
github.com/coreos/etcd/clientv3/balancer/picker
github.com/coreos/etcd/version
# github.com/coreos/etcd/clientv3/balancer/picker
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions

Unfortunately the very same commit of the Istio client that upgrades to v1.18.x also bumps gRPC to v1.28 causing misery unless pinned back so the rest of the code continues to function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upstream issue in etcd regarding the API change: etcd-io/etcd#11563

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be possible to pin the etcd client instead but I haven't tried that as it has a larger surface area and imported via more than one package path due to change from coreos org. Regardless at least one pin will be required to get Contour, Istio and Linode dependencies to play nice it's just a matter of which one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Can we add a TODO comment, just so that we can get back to it at a later time?

@tariq1890
Copy link
Contributor

@josephglanville Just a note regarding context.TODO(). We use TODO only in places where it's actually a TODO item to insert context. In all other places, we just stick to context.Background()

@josephglanville
Copy link
Contributor Author

josephglanville commented Jun 12, 2020

Switched context.TODO() to context.Background().

@josephglanville
Copy link
Contributor Author

@tariq1890 any chance you could take another look at this? If the gRPC version pin isn't desirable could you suggest other options that would be amenable?

@@ -117,7 +117,7 @@ func NewIstioGatewaySource(
// Endpoints returns endpoint objects for each host-target combination that should be processed.
// Retrieves all gateway resources in the source's namespace(s).
func (sc *gatewaySource) Endpoints() ([]*endpoint.Endpoint, error) {
gwList, err := sc.istioClient.NetworkingV1alpha3().Gateways(sc.namespace).List(metav1.ListOptions{})
gwList, err := sc.istioClient.NetworkingV1alpha3().Gateways(sc.namespace).List(context.Background(), metav1.ListOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

what about adding the context in the gatewaySource?

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 can look at that sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking about this more I think there is a larger task to plumb down the context from main -> store -> sources. I think that makes more sense as a follow up to this but I could do it in this PR if that is desired.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@njuettner this was done.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 17, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2020
@josephglanville
Copy link
Contributor Author

I added context.Context to the Endpoints() function on the Source interface. This allows sources to make use of cancelation on shutdown similar to providers.

I will rebase #1628 on this so it can also make use of it.

@josephglanville
Copy link
Contributor Author

/assign @Raffo

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2020
@josephglanville
Copy link
Contributor Author

@tariq1890 @Raffo @njuettner could you please review these changes?

@tariq1890
Copy link
Contributor

tariq1890 commented Jun 27, 2020

I've had an in-depth look into this. LGTM expect for that one minor comment @josephglanville

Sorry for the delay. Also, note that I am just a contributor to the project. It's ultimately upto @njuettner and @Raffo to approve the changes.

@Raffo
Copy link
Contributor

Raffo commented Jun 28, 2020

@njuettner marking this to review next week.

@Raffo
Copy link
Contributor

Raffo commented Jul 1, 2020

We're not going to have this merged as this, as it is today, includes a very recent version of client-go (0.18) which is not even listed in the compatibility matrix from https://github.com/kubernetes/client-go . We will always keep compatibility with officially supported kubernetes version (AFAIK 1.15 is the latest supported as of now) and also with what the major cloud providers will do. EKS, for example, supports 1.14 (hopefully not for long 😄 ). This means that we will have to postpone this change.
We can think of changing this to a version of client go, but it doesn't fix the problem with contour.

@josephglanville
Copy link
Contributor Author

As I understand it client-go 1.18.X support 1.15.X, in-fact I am using this code with a 1.15.X cluster right now as that is what we are on for the foreseeable future. I have yet to experience any problems with compatibility.

Is this just a prudence measure or do you actually think there is a compatibility problem with 1.18.X and 1.15.X/1.14.X that needs looking into?

Without this upgrade work on the Contour HTTPProxy source can't reasonably continue without falling back to specifying the load balancer IPs directly as is done in the IngressRoute source (which won't work for our use-case which has multiple Contour deployments with multiple LBs).

@josephglanville
Copy link
Contributor Author

Created an issue on client-go to update the compatibility matrix: kubernetes/client-go#828

@Raffo
Copy link
Contributor

Raffo commented Jul 2, 2020

Thanks @josephglanville , I'll wait for client-go to have clear info published and re-assess this later.

@tariq1890
Copy link
Contributor

I agree with @josephglanville here. I wouldn't be too worried about compatibility issues with importing client-go v1.18.x

This is a definitely case of the maintainers not updating their documentation

This requires pinning grpc for now as istio client-go otherwise pulls in
breaking changes.
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 3, 2020
@josephglanville
Copy link
Contributor Author

PR to update compat matrix in client-go: kubernetes/client-go#821

@josephglanville
Copy link
Contributor Author

@Raffo client-go matrix is now updated.

@nikhita
Copy link
Member

nikhita commented Jul 3, 2020

I wouldn't be too worried about compatibility issues with importing client-go v1.18.x

This is a definitely case of the maintainers not updating their documentation

Fwiw confirming from kubernetes/client-go#821 that it was an indeed an oversight to miss adding the support for 1.18.x in the compatibility matrix in client-go. Apologies!

The README now reflects 1.18 as well. 👍

@Raffo
Copy link
Contributor

Raffo commented Jul 3, 2020

Thanks for the update, I'll check this again next week and give an update.

@Raffo
Copy link
Contributor

Raffo commented Jul 8, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: josephglanville, Raffo

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit b1a2f0b into kubernetes-sigs:master Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants