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

Automatically download missing kube binaries in kube-up/kube-down. #38730

Merged

Conversation

ixdy
Copy link
Member

@ixdy ixdy commented Dec 13, 2016

What this PR does / why we need it: some users extract kubernetes.tar.gz and then immediately call cluster/kube-up.sh without first calling the new cluster/get-kube-binaries.sh script. As a result, the cluster fails to start, but it's not immediately clear why binaries are missing.

This PR streamlines this workflow by detecting this condition and prompting the user to download necessary binaries (using cluster/get-kube-binaries.sh).

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #38725

Release note:

Since `kubernetes.tar.gz` no longer includes client or server binaries, `cluster/kube-{up,down,push}.sh` now automatically download released binaries if they are missing.

cc @arun-gupta @christian-posta

@ixdy ixdy added area/build-release cherrypick-candidate release-note-none Denotes a PR that doesn't merit a release note. labels Dec 13, 2016
@ixdy ixdy added this to the v1.5 milestone Dec 13, 2016
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 13, 2016
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 13, 2016
@ixdy
Copy link
Member Author

ixdy commented Dec 13, 2016

$ tar xzf kubernetes.tar.gz
$ cd kubernetes
$ KUBERNETES_RELEASE_URL=file:///tmp/release-tars ./cluster/kube-up.sh 
... Starting cluster in us-central1-b using provider gce
... calling verify-prereqs
... calling verify-kube-binaries
!!! kubectl appears to be broken or missing
!!! Cannot find kubernetes-server-linux-amd64.tar.gz
Required binaries appear to be missing. Do you wish to download them? [Y/n]

Kubernetes release: v1.6.0-alpha.0.2098+cbee65a6d2b969
Server: linux/amd64  (to override, set KUBERNETES_SERVER_ARCH)
Client: linux/amd64  (autodetected)

Will download kubernetes-server-linux-amd64.tar.gz from file:///tmp/release-tars/v1.6.0-alpha.0.2098+cbee65a6d2b969
Will download and extract kubernetes-client-linux-amd64.tar.gz from file:///tmp/release-tars/v1.6.0-alpha.0.2098+cbee65a6d2b969
Is this ok? [Y]/n

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  264M  100  264M    0     0   940M      0 --:--:-- --:--:-- --:--:--  940M

md5sum(kubernetes-server-linux-amd64.tar.gz)=e64efb5461d4e62a87e349fcaadf7e56
sha1sum(kubernetes-server-linux-amd64.tar.gz)=e742eac127b46aba4ce4434a0b5af91a95f1884e

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.9M  100 20.9M    0     0   991M      0 --:--:-- --:--:-- --:--:--  991M

md5sum(kubernetes-client-linux-amd64.tar.gz)=ddf2a4317e23dcbff5d6d38caca757fa
sha1sum(kubernetes-client-linux-amd64.tar.gz)=95fb61aa11d05a5322c2c159bf652333b64cc8c1

Extracting /tmp/k/kubernetes/client/kubernetes-client-linux-amd64.tar.gz into /tmp/k/kubernetes/platforms/linux/amd64
Add '/tmp/k/kubernetes/client/bin' to your PATH to use newly-installed binaries.
... calling kube-up
Your active configuration is: [default]
...

@ixdy
Copy link
Member Author

ixdy commented Dec 13, 2016

If you want to test this fix yourself (linux/amd64 only):

$ export KUBERNETES_RELEASE_URL=https://storage.googleapis.com/kubernetes-release-pull/ci/pull-kubernetes-e2e-gce
$ curl "${KUBERNETES_RELEASE_URL}/v1.6.0-alpha.0.2099+a51bc0dfda11bd/kubernetes.tar.gz" | tar xzf -
$ cd kubernetes
$ cluster/kube-up.sh

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GCE e2e failed for commit cbee65a. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@ixdy
Copy link
Member Author

ixdy commented Dec 13, 2016

@k8s-bot gci gce e2e test this

@jbeda
Copy link
Contributor

jbeda commented Dec 16, 2016

Awesome. LGTM.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 16, 2016
@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 46e5f21 into kubernetes:master Dec 16, 2016
@ixdy ixdy added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 16, 2016
@ixdy
Copy link
Member Author

ixdy commented Dec 16, 2016

I realized this PR is probably release-note-worthy.

@saad-ali saad-ali added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Dec 16, 2016
@jbeda
Copy link
Contributor

jbeda commented Dec 16, 2016

@ixdy Agree -- release note is worthwhile here.

@arun-gupta
Copy link
Contributor

Yes, @ixdy this would be useful. I was definitely confused by this otherwise!

@ixdy
Copy link
Member Author

ixdy commented Dec 16, 2016

@arun-gupta there was supposed to be a more elaborate release note on the original PR, but a rogue space prevented it from being included. :(

@arun-gupta
Copy link
Contributor

@ixdy no worries, glad we found this rather soon!

k8s-github-robot pushed a commit that referenced this pull request Dec 17, 2016
…pstream-release-1.5

Automatic merge from submit-queue

Automated cherry pick of #38730

Cherry pick of #38730 on release-1.5.

#38730: Automatically download missing kube binaries in
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.5" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-release cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implicitly call cluster/get-kube-binaries.sh
8 participants