Kubernetes set-up on ubuntu on Google compute
The problem is that some ubuntu (and others) distro come with the google cloud SDK installed through the local package manager, but it doesn't contain everything. kubectl for example is missing as seen with this command:
gcloud components list
when you try to add the needed component for Kubernetes with:
gcloud components install kubectl
you end up with this error:
ERROR: (gcloud.components.update) The component manager is disabled for this installation
It is a known issue on the Google Cloud SDK issue tracker : Issue 336: kubectl not installed by google-cloud-sdk debian package, and not installable
Unfortunately, it provides a poor experience for first timer testing kubernetes as it's hard to find a quick AND CLEAN step by step solution.
Here is one:
sudo apt-get updatesudo apt-get remove google-cloud-sdkcurl https://sdk.cloud.google.com | bashexec -l $SHELLgcloud initgcloud components listgcloud components install kubectlgcloud components list
this last command should show kubectl installed and everything up to date.
Get yourself a full-blown Cloud SDK installation:
$ curl -sSL https://sdk.cloud.google.com | bash -
And follow instructions. Don't forget to remove old binaries to prevent clashes (script will warn you towards the end of the install). Then, proceed with Kubernetes setup again.
The latest Google SDK package manager installs:
https://cloud.google.com/sdk/downloads#apt-get
https://cloud.google.com/sdk/downloads#yum
now support installing kubectl "directly" from the repo:sudo apt install kubectlsudo yum install kubectl