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

Create a single kubernetes binary for all cmds #108

Closed
jbeda opened this issue Jun 14, 2014 · 15 comments
Closed

Create a single kubernetes binary for all cmds #108

jbeda opened this issue Jun 14, 2014 · 15 comments
Labels
area/build-release area/usability priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle.

Comments

@jbeda
Copy link
Contributor

jbeda commented Jun 14, 2014

As we start building a bunch of binaries the size of our output goes up. Because of go static linking, we end up with 8-10MB for each binary. Currently we 7 of these for a total of 58M (find output/go -type f -perm +111 | xargs du -ch).

If we created a single binary with a switch for which functionality users want we would have a single binary that would adapt as necessary and probably be ~10M.

I'd image we'd call this thing kube and by default it'd be the client binary. If you want to run a server component you would do something like kube --daemon=api-server.

Thoughts?

@jbeda jbeda added the question label Jun 14, 2014
@jbeda
Copy link
Contributor Author

jbeda commented Jun 14, 2014

Note that this relates to #19 as it would (a) make it less painful to copy stuff in and out of a boot2docker VM during build and (b) would make the resultant container images smaller as they'd all share a base with the single binary.

@brendandburns
Copy link
Contributor

SGTM.

Brendan

On Sat, Jun 14, 2014, 9:00 AM, Joe Beda notifications@github.com wrote:

Note that this relates to #4
#4 as it would
(a) make it less painful to copy stuff in and out of a boot2docker VM
during build and (b) would make the resultant container images smaller as
they'd all share a base with the single binary.


Reply to this email directly or view it on GitHub
#108 (comment)
.

@lavalamp
Copy link
Member

The localkube thing I made is most of the way there already.
On Jun 14, 2014 9:25 AM, "brendandburns" notifications@github.com wrote:

SGTM.

Brendan

On Sat, Jun 14, 2014, 9:00 AM, Joe Beda notifications@github.com wrote:

Note that this relates to #4
#4 as it
would
(a) make it less painful to copy stuff in and out of a boot2docker VM
during build and (b) would make the resultant container images smaller
as
they'd all share a base with the single binary.


Reply to this email directly or view it on GitHub
<
https://github.com/GoogleCloudPlatform/kubernetes/issues/108#issuecomment-46091743>

.


Reply to this email directly or view it on GitHub
#108 (comment)
.

@proppy
Copy link
Contributor

proppy commented Jun 14, 2014

Consider using subcommand instead of flags for defining which component to
launch, ex:
kube agent -some-agent-flag
On Jun 14, 2014 9:39 AM, "Daniel Smith" notifications@github.com wrote:

The localkube thing I made is most of the way there already.
On Jun 14, 2014 9:25 AM, "brendandburns" notifications@github.com
wrote:

SGTM.

Brendan

On Sat, Jun 14, 2014, 9:00 AM, Joe Beda notifications@github.com
wrote:

Note that this relates to #4
#4 as it
would
(a) make it less painful to copy stuff in and out of a boot2docker VM
during build and (b) would make the resultant container images smaller
as
they'd all share a base with the single binary.


Reply to this email directly or view it on GitHub
<

https://github.com/GoogleCloudPlatform/kubernetes/issues/108#issuecomment-46091743>

.


Reply to this email directly or view it on GitHub
<
https://github.com/GoogleCloudPlatform/kubernetes/issues/108#issuecomment-46092426>

.


Reply to this email directly or view it on GitHub
#108 (comment)
.

@delroth
Copy link

delroth commented Jun 14, 2014

Maybe also support busybox-style command selection via argv[0]? That way you can symlink/hardlink the main binary under different names.

http://www.busybox.net/FAQ.html#source

@jbeda
Copy link
Contributor Author

jbeda commented Jun 14, 2014

@delroth I love the busybox model but I'm not sure that we want to rely on it completely. We will probably want to have the client tools run on Windows at some point and I'm not sure how that'd work.

In any case, everyone seems on board so I'll mark this as a "feature request" instead of a question.

@jbeda jbeda changed the title Consider single kubernetes binary Create a single kubernetes binary for all cmds Jun 14, 2014
@gottwald
Copy link
Contributor

I like the subcommand idea as seen in git, go command, gcloud and so on....

@kelseyhightower
Copy link
Contributor

I'm going a bit against the crowd here, but I prefer each service as a separate binary mainly to help keep each one focused. If the decision was to move to a single binary then subcommands would be ideal:

kube apiserver
kube controller-manager
kube kubelet
kube proxy

But I think the UX of subcommands for completely different services to be pretty bad. It works well for users with experience, but will most likely confuse new users. Finally, again non-technical, but I think unnecessary coupling between components starts to happen once you have a "single" binary.

@thockin
Copy link
Member

thockin commented Jul 11, 2014

I'll agree with this last comment - I don't find 50 MB to be particularly damning - but maybe I have been in C++ land for too long. At the same time, I also don't find the idea of jamming them all together into one binary to make a lot of sense. It's sort of early to be apologizing for the size of Go binaries isn't it?

@smarterclayton
Copy link
Contributor

Or we could just do symlinks like:

kube-apiserver

Where the executable checks its executable name, sees it's != kube, then attempts to use the subcommand matching apiserver. That resolves the subcommand ordeal and enforces consistency at the same time.

I'm a huge +1 for a single binary, but it should be optional for folks who operate on different build cycles. We probably want to ensure that the executable entry points are cleanly separated from pkg/ code as well, so that people can create new cmd/ entry points that composite function.

@txomon
Copy link

txomon commented Aug 19, 2014

IMO, having all of them grouped in a single command means that they will be used always together.

It is also true that when using a set of different tools, it is easier to have all related commands under one common prefix, so maybe @smarterclayton's solution is the best in this case

@bgrant0607
Copy link
Member

@jbeda @brendandburns Is this done?

@bgrant0607 bgrant0607 added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Dec 3, 2014
jbeda added a commit to jbeda/kubernetes that referenced this issue Jan 30, 2015
Part of kubernetes#108.

Also:
* Added hyperkube cmd (not built by default yet).
* Added version support to hyperkube
* Remove health_check_minions flag from apiserver as it is no longer used with kubernetes#3733
@jbeda jbeda self-assigned this Jan 31, 2015
@bgrant0607 bgrant0607 added the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Feb 28, 2015
@kelseyhightower
Copy link
Contributor

@bgrant0607 This one seems to be done now that we have hyperkube.

@bgrant0607
Copy link
Member

Agree.

vishh pushed a commit to vishh/kubernetes that referenced this issue Apr 6, 2016
Better handle nested containers and libcontainer.
k8s-github-robot pushed a commit that referenced this issue Jul 5, 2016
Automatic merge from submit-queue

"Mover" should be "Moreover"

In file docs/proposals/apiserver-watch.md, line #108, "Mover, this will not require any changes in other parts of the code.", here "Mover" should be "Moreover".
feiskyer added a commit to feiskyer/kubernetes that referenced this issue Aug 9, 2016
xingzhou pushed a commit to xingzhou/kubernetes that referenced this issue Dec 15, 2016
rktnetes: update meeting times to ad-hoc
iaguis pushed a commit to kinvolk/kubernetes that referenced this issue Feb 6, 2018
@maicohjf
Copy link

As we start building a bunch of binaries the size of our output goes up. Because of go static linking, we end up with 8-10MB for each binary. Currently we 7 of these for a total of 58M (find output/go -type f -perm +111 | xargs du -ch).

If we created a single binary with a switch for which functionality users want we would have a single binary that would adapt as necessary and probably be ~10M.

I'd image we'd call this thing kube and by default it'd be the client binary. If you want to run a server component you would do something like kube --daemon=api-server.

Thoughts?

Create a file /opt/KUCC00302/kucc00302.txt that lists all pods that implement Service foo in
Namespace production.
The format of the file should be one pod name per line.

kubectl get svc -o wide -n production
得到label
kubectl get pod -l label=value |awk '{print $1}' |grep -v "NAME" >> /opt/KUCC00302/kucc00302.txt
kubectl get po -l label

wking pushed a commit to wking/kubernetes that referenced this issue Jul 21, 2020
…yPrs

Skip CICD build on markdown or doc changes.
ezrasilvera pushed a commit to ezrasilvera/kubernetes that referenced this issue Nov 10, 2022
UPSTREAM: <carry>: garbage collector monitors syncing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-release area/usability priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle.
Projects
None yet
Development

No branches or pull requests