Wrangling `kubectl`

Posted on November 26, 2016

Kubernetes is all the rage these days, and for good reasons, it keeps devs happy, simplifies operations, and has a huge community backing it (not to mention Google’s $ to boot).

As a user, you will eventually want to use the Kubernetes client utility (kubectl) to manage the resources on the clusters you deploy. According to the Kubernetes docs, the 50MB kubectl is packed in the 1GB+ release tarball. Good grief.

Let’s say you have grabbed the release tarball…

How do you extract the kubectl client by itself?

ᐅ tar -xf kubernetes.tar.gz -zvp                \
      -C ~/bin/                                 \
      --strip-components=4                      \
      kubernetes/platforms/linux/amd64/kubectl

UPDATE 12/8

While fumbling around with other topics, I stumbled across the CoreOS docs for kubectl (why this exists separate from the official docs puzzles me), which points out that the bare executable can be retrieved from Google:

$ curl -O https://storage.googleapis.com/kubernetes-release/release/v1.4.3/bin/linux/amd64/kubectl

UPDATE 12/9

The official doc project just added the same info yesterday in this commit, visible online here in the docs.