Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gadieichhorn/13a8929cabff2832d422788fe295a86c to your computer and use it in GitHub Desktop.
Save gadieichhorn/13a8929cabff2832d422788fe295a86c to your computer and use it in GitHub Desktop.
How to get Kubernetes running on Windows 10

Kubernetes On Windows

Early in August 2016 Microsoft released the Windows 10 Anniversary Update. There were a number of changes, but the one that got me to actually take the time to install the update was "Bash on Ubuntu on Windows". This feature would install Ubuntu Linux without the kernel. It would run linux in user-mode. Linux would run the commands while Windows does all the work/processing.

For an upcoming project I needed to get Kubernetes running. Being as Kubernetes is not able to be run in Windows the normally accepted way to procees is to create a virtual Linux box and run it from there. I wanted to see if Kubernetes would run in Bash on Ubuntu on Windows.

This is how I got it to work:

Install the Windows 10 Anniversary Update

This was pretty straight forward. Download the Windows 10 Upgrade tool. I found the tool initially here. The upgrade will take about 45ish minutes depending on your internet connection and computer.

Install Bash on Ubuntu on Windows

I followed these instructions but will also outline them here.

  1. Turn on Developer Mode
    1. Open Settings -> Update and Security -> For developers
    2. Select the Developer Mode radio button
  2. Add the Linux Subsystem
    1. From Start, search for "Turn Windows features on or off" (type 'turn')
    2. Select Windows Subsystem for Linux (beta)
    3. Click OK
    4. Wait for the install to finish
  3. Enable the Linux subsystem feature
    1. Open a PowerShell prompt as administrator and run:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
    1. Restart if needed
  4. Run Bash on Windows. This will install all the Ubuntu files
    1. Open a command prompt
    2. Run bash
    3. Type y to accept the license and install
    4. You will be asked about a username and password. You can use any username and password. They have no relationship to Windows users.

Install Google SDK

Now that we have Bash running installing the Google SDK is really easy. Documented here.

Run the following commands from Bash:

  1. Run this to install the SDK: curl https://sdk.cloud.google.com | bash
  2. Restart your shell: exec -l $SHELL
  3. Initialize the gcloud environment: gcloud init

Install Kubernetes

Once the SDK is installed we can finally install Kubernetes.

gcloud components install kubectl

Example Hello World Walkthrough

Done

You can now to run kubectl, gcloud from Bash! Woot!

My setup is that I will run kubectl from Bash, and then any gcloud and docker commands from Windows PowerShell. Which will allow me to control my GCP projects without needing another virtual machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment