Robert Jack Will
Robert Jack Will

Reputation: 11551

Is there an easy download URL for a specific version of kubectl?

The Kubernetes manual has a two-liner shell command to download the latest ´kubectl´ release, but that is rarely what companies are running. So each time I onboard a new developer I have to go to Kubernetes Github releases page, find the latest minor version that works with my cluster, copy-paste it (taking care not to forget the little "v") and manually craft the download URL. This fiddling around makes it hard to grow a newcomer's enthusiasm for the new Kubernetes world that they are about to enter. Is there any ready-made tool or link to make that process easier?

Upvotes: 2

Views: 1222

Answers (2)

Filip Nikolov
Filip Nikolov

Reputation: 1897

Assuming you are talking about Linux as OS.

According to this issue a client can lead server by up to 2 minor versions. This more or less can make the version you want the developers to run predictable. Once you know the exact version, you can craft a chain of shell commands that can do the rest.

sudo curl -Lo /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/linux/amd64/kubectl && sudo chmod +x /usr/local/bin/kubectl

However if you don't know the version in advance then I'm afraid you will have to look it up or use latest.

Upvotes: 1

paltaa
paltaa

Reputation: 3244

You can always install with snap https://snapcraft.io/kubectl

Upvotes: 0

Related Questions