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

Use protobufs by default to communicate with apiserver (still store JSONs in etcd) #25738

Merged
merged 1 commit into from
May 21, 2016

Conversation

wojtek-t
Copy link
Member

@lavalamp @kubernetes/sig-api-machinery

@wojtek-t wojtek-t added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label May 17, 2016
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels May 17, 2016
@wojtek-t wojtek-t added this to the v1.3 milestone May 17, 2016
@@ -87,7 +87,7 @@ func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ContentConf
config.GroupVersion = &unversioned.GroupVersion{}
}
if len(config.ContentType) == 0 {
config.ContentType = "application/json"
config.ContentType = "application/vnd.kubernetes.protobuf"
Copy link
Contributor

Choose a reason for hiding this comment

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

This will mean that kubectl 1.3 will fail by default when contacting a Kube 1.2 server on POSTs and PUTs.

Copy link
Contributor

Choose a reason for hiding this comment

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

We may have to hoist this to just controller-manager, kubelet, and kube-proxy initialization.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh.. I though about "get" and this should work, because of renegotiation. But you're right, that it will fail for post and put.

Will fix that. (but we are waiting for other PRs anyway first :))

@wojtek-t wojtek-t force-pushed the default_protobuf branch from eb3a316 to 9a370eb Compare May 17, 2016 14:29
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 17, 2016
@@ -145,7 +146,7 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig)")
fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.")
fs.StringVar(&s.RootCAFile, "root-ca-file", s.RootCAFile, "If set, this root certificate authority will be included in service account's token secret. This must be a valid PEM-encoded CA bundle.")
fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "ContentType of requests sent to apiserver. Passing application/vnd.kubernetes.protobuf is an experimental feature now.")
fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "ContentType of requests sent to apiserver.")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "Content type"

@smarterclayton
Copy link
Contributor

I thought of a possible problem here.

Etcd2 requires a base64 encoded body for proto. A user using proto on etcd2 will have base64 encoded data in etcd. A user in etcd3 does not need base64 encoding (because of binary values) but if they have proto in etcd2 and upgrade they'll have different data on disk or not.

Currently the recognizer only enables base64 decoding when you have a binary storage format. I'd prefer not to enable base64 except as a limited stopgap until folks move to etcd3. So we'd have to add a base64 decoder if we allow base64 encoded protobufs to be written to etcd2, and leave it in the product for a while, and force upgrades and testing.

If we are not going to recommend etcd3 by default for kube 1.3, then we may not want to recommend protobuf storage for kube 1.3 on etcd2. I lean a bit towards that option.

@lavalamp
Copy link
Member

@smarterclayton is it so bad to turn on a base64 recognizer forever? Presumably it can just look for a fixed starting string just like the current binary recognizer?

@xiang90 @hongchaodeng what is the current etcd3 status?

I don't think we're ready to run on etcd3 (config, setup, upgrade testing, etc)

@roberthbailey since we were just talking about this.

@hongchaodeng
Copy link
Contributor

what is the current etcd3 status?

@lavalamp
Write updates on #22448 (comment)

Thanks!

@wojtek-t
Copy link
Member Author

@smarterclayton - we will not recommend etcd3 in 1.3 release.

However, without switching on protobufs, we won't be able to handle 2000-nodes. We need to check the results of switching protobufs only for communication with apiserver and not for storage.

@smarterclayton
Copy link
Contributor

Is it terrible to support the recognizer? No. It's just messy because
it's a point in time thing, and does have a small fixed cost.

On Thu, May 19, 2016 at 8:10 AM, Wojciech Tyczynski <
notifications@github.com> wrote:

@smarterclayton https://github.com/smarterclayton - we will not
recommend etcd3 in 1.3 release.

However, without switching on protobufs, we won't be able to handle
2000-nodes. We need to check the results of switching protobufs only for
communication with apiserver and not for storage.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#25738 (comment)

@wojtek-t wojtek-t force-pushed the default_protobuf branch from 9a370eb to 76dbe1b Compare May 19, 2016 12:37
@wojtek-t wojtek-t changed the title [Do NOT merge] Use protobufs by default [Do NOT merge] Use protobufs by default to communicate with apiserver May 19, 2016
@wojtek-t
Copy link
Member Author

@smarterclayton - I changed this PR to not touch default storage media type for now. Are you ok with merging this one (as soon as #25243 is merged)?

@smarterclayton
Copy link
Contributor

Yes I am.

@wojtek-t wojtek-t force-pushed the default_protobuf branch from 76dbe1b to 2344d12 Compare May 20, 2016 08:24
@wojtek-t wojtek-t changed the title [Do NOT merge] Use protobufs by default to communicate with apiserver Use protobufs by default to communicate with apiserver May 20, 2016
@wojtek-t wojtek-t added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. labels May 20, 2016
@wojtek-t
Copy link
Member Author

@smarterclayton - can we proceed with this PR now?

@wojtek-t wojtek-t changed the title Use protobufs by default to communicate with apiserver Use protobufs by default to communicate with apiserver (still store JSONs in etcd) May 20, 2016
@smarterclayton smarterclayton added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2016
@smarterclayton
Copy link
Contributor

Yes, Lgtm

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2016
@wojtek-t wojtek-t force-pushed the default_protobuf branch from 2344d12 to 0f881d6 Compare May 21, 2016 09:38
@wojtek-t
Copy link
Member Author

Trivial rebase - reapplying lgtm.

@wojtek-t wojtek-t added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 21, 2016
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 21, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented May 21, 2016

GCE e2e build/test passed for commit 0f881d6.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 682c188 into kubernetes:master May 21, 2016
@wojtek-t
Copy link
Member Author

Ref #8132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants