Kube Tools
For the most part everything we are gonna do is independent of the cluster provider.
The best way to get started in so use minikube on you local pc to try out different kubernetes features.
Minikube
Minikube provides the user with a nearly full featured kubernetes cluster running on a vm on your local machine.
Its possible to use different vms with minikube but the most simple with windows is the integrated Hyper-V virtual machine.
You can fine the official install documentation from minikube here install minikube
Hyper-V (For windows users)
For windows users we can set Hyper-V as the default driver for minikube.
minikube config set driver hyperv
Or you can simply start minikube with hyper-v
minikube start --driver=hyperv
Dashboard
Minikube comes kube dashboard installed out of the box as a service it makes interacting with the cluster easier via a graphical interface.
You can start it using.
minikube dashboard
Cheat sheet
Here are you most useful minikube commands.
# Start minikube
minikube start
# Stop minikube
minikube stop
# Pause Cluster
minikube pause
# Unpause cluster
minikube unpause
Kubectl
Your most important tool for interacting with your kubernetes cluster is kubectl. It allows you to interact with the kubernetes api via the command line and is essential when deploying apps to you cluster or interacting with the cluster in general.
Installation
The easiest way to install kubectl on a windows machine is via Chocolatey(choco).
If you don't have choco installed, simply open powershell as and administrator and enter the following.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
To test that the installation was successful simply enter choco
- Choco
choco install kubernetes-cli
You can test the installation by running kubectl
For auto complete in power-shell you can also run the following in power-shell
kubectl completion powershell | Out-String | Invoke-Expression
Kube tools
Here are some of my favorite kubernetes tools that can make you life easier especially when dealing with multiple clusters.
Krew
Krew is a great tool for managing and installing kubectl plugins. You can find the installation information here
After having installed Krew here are a few useful plugins:
- cert-manager
- get-all
- ingress-nginx
- config-cleanup
- doctor
- multiforward
- deprecations
Each of the plugins can be installed using the cli
kubectl krew install <plugin>
# Example
kubectl krew install get-all
Kubectx and Kubens
Kubectx is a great tool for managing the current context and allows you to quickly switch between kubernetes contexts.
Kubens on the other hand allows you to quickly switch between namespaces without having to add the namespace with every command
They can easily be installed using chocolatey
choco install kubens kubectx
K9s
K9s offers a different type of interface for interacting with you cluster. It offers a terminal UI that you can use to easily navigate your cluster and perform actions.
For more details please view the github page.
choco install k9s
Helm
Helm is a package manager for kubernetes and allows us to deploy apps as a complete bundle using a template mechanism. This allows us to easily adapt all aspects of the app to different customers simply by making changes to a values.yaml file
The simplest way to install helm is once again with Chocolatey
choco install kubernetes-helm