Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Use kubectl instead of curl to load kube-system manifests #462

Closed
wants to merge 1 commit into from

Conversation

daveey
Copy link

@daveey daveey commented May 4, 2016

curl can silently fail, leaving the kube system only partially set up

ideally we would use the quay.io/coreos/hyperkube:v1.2.2_coreos.0 image and run /hyperkube kubectl, however this doesn't work due to

kubernetes/kubernetes#24088

this PR uses a 3rd party image for kubectl, which means it shouldn't be merged.

i am hoping someone can help me add kubectl to the hyperkube image directly, or suggest other alternatives

@mumoshu
Copy link
Contributor

mumoshu commented May 5, 2016

@daveey Great PR!

I had also needed to depend on a 3rd party image in my PR #465

What I have done there was to make image/command passed to docker run fully configurable via cluster.yaml and noted that it may change in the future. See https://github.com/coreos/coreos-kubernetes/pull/465/files#diff-071e0ee4ae8c6adf4865f25d851f30c9R74 for code regarding it.

With that, I believe that there will be small chances we can get our PRs merged as is, because we won't break things in fragile/backward-incompatible ways.

If that is not enough, I guess we can contribute a Dockerfile for kubectl and ask CoreOS guys if they could docker build/push it in a Docker repo something like quay.io/coreos/kubectl.

@colhom @aaronlevy Excuse me for being obtrusive but would you mind looking into this? We like to contribute but the same issue seems to be blocking us.

@@ -90,21 +90,17 @@ write_files:
owner: root:root
content: |
#!/bin/bash -e
/usr/bin/curl -H "Content-Type: application/json" -XPOST -d @"/srv/kubernetes/manifests/kube-system.json" "http://127.0.0.1:8080/api/v1/namespaces"
docker run -v /etc/kubernetes:/etc/kubernetes \
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably prefer this was run via rkt

@aaronlevy
Copy link
Contributor

Couple things to cover here:

  • As far as the underlying issue, can you give more detail on how curl is silently failing in a way that kubectl would surface more info? If curl fails, I would expect the apiserver response to be in the journal output for the unit - if not we can likely resolve this.
  • As far as kubectl in the hyperkube container, I would prefer that the flag issue be fixed upstream, rather than trying to work around the bug by including a separate binary or needing to package a separate image. We try to keep our images as close to upstream as possible (and others in the community could also benefit from this fix).

Once the flag bug is resolved, I wouldn't necessarily be opposed to running kubectl via a container (although I'd likely prefer that it was run via rkt). But it would be slightly slower on the installation process (vs curl).

@daveey
Copy link
Author

daveey commented May 5, 2016

@aaronlevy thanks for the review, I should have posted a link to the issue.

#447

Take a look at the discussion there which addresses the "apply" issue, as well as why curl is problematic.

I agree with the preference for the original hyperkube image, however the flag bug has been open for a while and not addressed so I don't know when we can expect it.

@aaronlevy
Copy link
Contributor

Commented on the linked issue.

Would you be interested in taking a stab at fixing the upstream issue? On a quick scan it looks like it would mean improving flag parsing here: https://github.com/kubernetes/kubernetes/blob/master/cmd/hyperkube/hyperkube.go#L117

@daveey
Copy link
Author

daveey commented May 9, 2016

@aaronlevy i won't have time to work on the upstream issue for a while

@colhom
Copy link
Contributor

colhom commented May 10, 2016

@daveey I'll be looking into the upstream hyperkube issue soon to see if we can get this resolved.

@colhom
Copy link
Contributor

colhom commented May 26, 2016

@daveey update on things. kubernetes/kubernetes#25512 is merged, fixing the hyperkube flag issue.

we're going to wait until v1.3 (with that PR in it) is released before going forward with this PR.

@aaronlevy
Copy link
Contributor

@daveey would this be something you're still interested in tackling? kubectl is now part of hyperkube, so we could now do something like rkt run quay.io/coreos/hyperkube --exec /hyperkube -- kubectl create -f foo.yaml

@aaronlevy
Copy link
Contributor

I'm going to close this due to inactivity - but please re-open if this is something you would like to see merged.

@aaronlevy aaronlevy closed this Nov 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants