Skip to content

Instantly share code, notes, and snippets.

@axel-sirota
Last active June 13, 2023 15:05
Show Gist options
  • Save axel-sirota/f0583ec4ea69d6d4178f2d8f7b561304 to your computer and use it in GitHub Desktop.
Save axel-sirota/f0583ec4ea69d6d4178f2d8f7b561304 to your computer and use it in GitHub Desktop.
(Advanced/Intermediate/Fundamentals) Kubernetes Intallation instructions

(Advanced/Intermediate/Fundamentals) Kubernetes Intallation instructions

Windows

Core requirements:

Docker Desktop

With Docker Desktop, you'll get a managed Kubernetes cluster after some initial setup. IMPORTANT: This has a potential license issue, as Docker charges larger companies a per-seat license fee. It is free for your personal/educational use. It is free for use during class, but a license requirement applies once the class is over. If you're unsure, check with your company management or choose the Rancher Desktop option below. For more details on Docker's license and whether it applies to you at work, visit their FAQ.

  1. Visit docker.com
  2. Click the install link in the center of the page. Be careful if you're on a Mac to choose the correct chip. It defaults to Intel Macs. If you're unsure, look at the Apple menu on your computer, then About This Mac.
  3. Once installed, open the Docker application.
  4. You'll have Docker menu on your computer (whale logo). Click it and choose the Signup/Signin to Docker Hub option. This will open a browser to Docker Hub where you can login or sign up for a free account.
  5. (For Kubernetes courses) Install Kubernetes
    1. Once you're signed in, open the Docker menu again and choose Preferences. Then go to the Kubernetes section. Check the box for Enable Kubernetes then click the Apply and Restart button. This will begin the Kubernetes setup process which usually takes 10-15 minutes.
    2. Once finished, you'll be able to open a terminal and run kubectl get all and get some output that is clearly not a connection error.

Rancher Desktop

A great open-source option with no license issues. Rancher Desktop comes with automatic Kubernetes support.

  1. Visit rancherdesktop.io
  2. Scroll down to the installer section and pick the correct installer. Be careful if you're on a Mac to choose the correct chip. It defaults to Intel Macs. If you're unsure, look at the Apple menu on your computer, then About This Mac.
  3. Follow the installation instructions. When prompted for for container engine, choose dockerd (moby). When prompted for a Kubernetes version, choose the latest stable release.

kubectl:

Here we have two versions, with curl or with Chocolatey:

With Choco

  1. Run

choco install kubernetes-cli

  1. Verify:

kubectl version --client

With curl

  1. Download from this link: curl.exe -LO "https://dl.k8s.io/release/v1.27.2/bin/windows/amd64/kubectl.exe"

Tip: Change where it says v1.27.2 to the one you prefer

  1. Put the file somewhere

  2. Set a PATH:

    Select Control Panel and then System. Click Advanced and then Environment Variables. Add the location of the kubectl folder to the PATH variable in System Variables. The following is a typical value for the PATH variable: C:\WINDOWS\system32;C:\WINDOWS;"C:\{WHEREVER_YOU_PUT_IT}"

  3. Test:

    kubectl version --client

Helm 3**

From Choco

  1. Run

choco install kubernetes-helm

  1. Verify

helm -version

Terraform (for cloud deployments)

  1. The best way is to use Chocolatey (https://chocolatey.org/install) and run:

choco install terraform

AWS CLI (for cloud deployments)

  1. Download and run the MSI AWS CLI installer: https://awscli.amazonaws.com/AWSCLIV2.msi
  2. Verify running in any terminal: aws --version

Mac

Core requirements regardless of language to use

Docker for Desktop or Rancher:

  1. Same as above

kubectl

For Intel Chip

  1. Download curl -LO "https://dl.k8s.io/release/v1.27.2/bin/darwin/amd64/kubectl" setting the version as the one your want
  2. Make it executable

chmod +x ./kubectl

  1. Move the kubectl binary to a file location on your system PATH.
sudo mv ./kubectl /usr/local/bin/kubectl
sudo chown root: /usr/local/bin/kubectl
  1. Verify:
 kubectl version --client

For Apple chip

  1. Download curl -LO "https://dl.k8s.io/release/v1.27.2/bin/darwin/arm64/kubectl" setting the version as the one your want
  2. Make it executable

chmod +x ./kubectl

  1. Move the kubectl binary to a file location on your system PATH.
sudo mv ./kubectl /usr/local/bin/kubectl
sudo chown root: /usr/local/bin/kubectl
  1. Verify:
 kubectl version --client

Helm 3

  1. brew install helm

Terraform (for cloud deployments)

  1. Run brew tap hashicorp/tap
  2. Run brew install hashicorp/tap/terraform

AWS CLI (for cloud deployments)

  1. Run:
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
  1. Verify running in any terminal: aws --version

Great tool to manage multiple versions of kubectl/helm

Download ASDF from https://asdf-vm.com/ and you can install the kubectl plugin by doing:

asdf plugin add kubectl
asdf plugin add helm

Then you can do:

asdf install kubectl 1.25.9

And it will just work. You can even set different versions for different projects.

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