-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Conversation
@@ -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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :))
eb3a316
to
9a370eb
Compare
@@ -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.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "Content type"
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. |
@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. |
@lavalamp Thanks! |
@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. |
Is it terrible to support the recognizer? No. It's just messy because On Thu, May 19, 2016 at 8:10 AM, Wojciech Tyczynski <
|
9a370eb
to
76dbe1b
Compare
@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)? |
Yes I am. |
76dbe1b
to
2344d12
Compare
@smarterclayton - can we proceed with this PR now? |
Yes, Lgtm |
2344d12
to
0f881d6
Compare
Trivial rebase - reapplying lgtm. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 0f881d6. |
Automatic merge from submit-queue |
Ref #8132 |
@lavalamp @kubernetes/sig-api-machinery