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

prefer protobuf instead of just json format #475

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

andyxning
Copy link
Member

What this PR does / why we need it:
This PR will prefer protobuf format when communicating with apiserver instead of just json.
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #264

@k8s-ci-robot k8s-ci-robot requested a review from brancz June 8, 2018 07:09
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. 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. labels Jun 8, 2018
@andyxning
Copy link
Member Author

/cc @smarterclayton

@andyxning
Copy link
Member Author

/cc @brancz

@brancz
Copy link
Member

brancz commented Jun 11, 2018

Have you tried this against a couple of clusters? I recall that in an earlier attempt of this, there were some issues left when changing the accept header to proto.

@brancz
Copy link
Member

brancz commented Jun 11, 2018

I tried running this against a cluster and quickly got this kind of output for all list-watches:

E0611 10:16:39.155112   17021 streamwatcher.go:109] Unable to decode an event from the watch stream: invalid character '\x00' looking for beginning of value
W0611 10:16:39.155334   17021 reflector.go:341] k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: watch of *v1.ConfigMap ended with: very short watch: k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: Unexpected watch close - watch lasted less than a second and no items received
E0611 10:16:39.633030   17021 streamwatcher.go:109] Unable to decode an event from the watch stream: invalid character '\x00' looking for beginning of value
W0611 10:16:39.633185   17021 reflector.go:341] k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: watch of *v1.Node ended with: very short watch: k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: Unexpected watch close - watch lasted less than a second and no items received
E0611 10:16:39.633250   17021 streamwatcher.go:109] Unable to decode an event from the watch stream: invalid character '\x00' looking for beginning of value
W0611 10:16:39.633297   17021 reflector.go:341] k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: watch of *v1.Endpoints ended with: very short watch: k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: Unexpected watch close - watch lasted less than a second and no items received
E0611 10:16:41.227737   17021 streamwatcher.go:109] Unable to decode an event from the watch stream: invalid character '\x00' looking for beginning of value
W0611 10:16:41.227969   17021 reflector.go:341] k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: watch of *v1.Node ended with: very short watch: k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: Unexpected watch close - watch lasted less than a second and no items received
E0611 10:16:41.600676   17021 streamwatcher.go:109] Unable to decode an event from the watch stream: invalid character '\x00' looking for beginning of value
W0611 10:16:41.600788   17021 reflector.go:341] k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: watch of *v1.Endpoints ended with: very short watch: k8s.io/kube-state-metrics/pkg/collectors/collectors.go:91: Unexpected watch close - watch lasted less than a second and no items received

@andyxning
Copy link
Member Author

andyxning commented Jun 12, 2018

Have you tried this against a couple of clusters?

Actually not. I have just test that the Accept: application/vnd.kubernetes.protobuf,application/json can fetch response in protobuf format in my postman.

@caesarxuchao
Copy link
Member

This should work, does the watch still fail? Please ping me on slack if this still has problems.

@andyxning
Copy link
Member Author

andyxning commented Jun 25, 2018

@caesarxuchao Yes, it works. We have test it locally. Maybe what i want to know is that what is the requirement for enabling protobuf support in client-go since there is no wiki nor examples about this.

@brancz it should be ok to merge this for now, i think. ~

@brancz
Copy link
Member

brancz commented Jun 25, 2018

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyxning, brancz

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

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants