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

Migrate to client-go #539

Merged
merged 4 commits into from
Apr 5, 2017
Merged

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Apr 1, 2017

replaces #463

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 1, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 44.084% when pulling 19c727f on aledbf:migrate-client-go into 638ea2b on kubernetes:master.

@nicksardo
Copy link
Contributor

nicksardo commented Apr 3, 2017

@aledbf There are a lot of gaps in my k8s knowledge outside of the GLBC and services, so please be patient with me on this. We can also try pinging @bprashanth if he has any spare time to help overlook this. (Not a problem if he doesn't)

First, have you tried testing a simple gce use case with this branch?
Second, I see you're vendoring client-go version 2.0. Did you make any changes that would break compatibility with k8s 1.4? If not, can you spin up a 1.4 cluster and test?
Third, I see the leaderelection package has been moved locally. What's the reasoning for this? Was it dropped from all other repos?

Thanks

@aledbf
Copy link
Member Author

aledbf commented Apr 3, 2017

First, have you tried testing a simple gce use case with this branch?

Yes but I don't know if there is an additional e2e test for the gce ingress controller outside this repo.

Second, I see you're vendoring client-go version 2.0. Did you make any changes that would break compatibility with k8s 1.4? If not, can you spin up a 1.4 cluster and test?

From the compatibility matrix this should not be an issue

Third, I see the leaderelection package has been moved locally. What's the reasoning for this? Was it dropped from all other repos?

The issue here is that the leader election code is not (yet) present in client-go and we rely on this feature for the ingress status update (the gce ingress controller does not uses this code)

@aledbf aledbf requested a review from bprashanth April 3, 2017 22:57
@aledbf
Copy link
Member Author

aledbf commented Apr 3, 2017

@bprashanth can you help to review this PR? (the gce part)

@nicksardo
Copy link
Contributor

nicksardo commented Apr 3, 2017

@bprashanth can you help to review this PR? (the gce part)

He can look at the GCE changes, but I was actually concerned about core/pkg/... as I'm not familiar with it.

From the compatibility matrix this should not be an issue

The compatibility matrix says client-go contains items that may not exist in the cluster. I was asking if you were only using things in common.

@nicksardo
Copy link
Contributor

nicksardo commented Apr 3, 2017

Also, being able to cherrypick kubernetes/kubernetes#43644 into 1.6.x is looking less likely and 1.7 is months out. Although not ideal, I feel it would be innocuous to vendor from commit 289ef62442b2e74e533e2b0f1e309c70750d7423. Pinging @thockin to provide his input on this.

@@ -52,8 +52,9 @@ func defaultBackendName(clusterName string) string {

// newLoadBalancerController create a loadbalancer controller.
func newLoadBalancerController(t *testing.T, cm *fakeClusterManager, masterURL string) *LoadBalancerController {
Copy link
Contributor

Choose a reason for hiding this comment

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

masterURL is declared but not used.

client := client.NewForConfigOrDie(&restclient.Config{Host: masterURL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
lb, err := NewLoadBalancerController(client, cm.ClusterManager, 1*time.Second, api.NamespaceAll)
kubeClient := fake.NewSimpleClientset()
//ContentConfig: restclient.ContentConfig{GroupVersion: testapi_v1.Default.GroupVersion()}
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this kept for a reason?

@thockin
Copy link
Member

thockin commented Apr 4, 2017 via email

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 44.341% when pulling 533c10dcbacdca90d6b0d56bcb6ef8569ea6c625 on aledbf:migrate-client-go into 22c3226 on kubernetes:master.

@aledbf
Copy link
Member Author

aledbf commented Apr 4, 2017

@thockin which version of client-go should be used?

@thockin
Copy link
Member

thockin commented Apr 4, 2017 via email

@aledbf
Copy link
Member Author

aledbf commented Apr 4, 2017

@thockin sorry, I meant which branch of the repository kubernetes/client-go should be used (this PR is now using the master branch)

@thockin
Copy link
Member

thockin commented Apr 4, 2017 via email

@aledbf
Copy link
Member Author

aledbf commented Apr 4, 2017

Although not ideal, I feel it would be innocuous to vendor from commit 289ef62442b2e74e533e2b0f1e309c70750d7423

@nicksardo done

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 44.383% when pulling 88a2751 on aledbf:migrate-client-go into 0fe0d6f on kubernetes:master.

@nicksardo
Copy link
Contributor

@aledbf Is there a required configuration change to the manifest file in k8s? The controller crashes at start in an e2e cluster.

F0404 20:56:41.281794       5 main.go:201] error creating client configuration: invalid configuration: default cluster has no server defined

config, err = clientConfig.ClientConfig()
config, err = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
&clientcmd.ClientConfigLoadingRules{},
&clientcmd.ConfigOverrides{}).ClientConfig()
Copy link
Contributor

@nicksardo nicksardo Apr 4, 2017

Choose a reason for hiding this comment

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

Now that clientcmd.ClusterDefault is being deprecated, I assume we should either specify the master address via (new) flag or assume in-cluster (similar to nginx controller). I think we can make this change - will need to remember this when bumping the manifest file.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 44.383% when pulling e492a4b on aledbf:migrate-client-go into 0fe0d6f on kubernetes:master.

@nicksardo
Copy link
Contributor

Changes in core/pkg/... look good.

I've ran one successful test on a 1.6 cluster with the new flag. After doing a test on a 1.4 cluster, I'll merge this.

I'll update controller docs regarding the new flag(s) in a separate PR.

@nicksardo
Copy link
Contributor

No problems with 1.4
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2017
@nicksardo nicksardo merged commit 12a0373 into kubernetes:master Apr 5, 2017
@nicksardo
Copy link
Contributor

Thanks for updating the vendored k8s!

@aledbf
Copy link
Member Author

aledbf commented Apr 5, 2017

@nicksardo thank you for merging :)

@aledbf aledbf deleted the migrate-client-go branch April 6, 2017 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. nginx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants