To make it easier to install and manage kubectl
and helm
on Windows I recommend using Chocolatey:
-
Start a PowerShell terminal running as Administrator (this is needed for all Chocolatey commands).
-
Install Chocolatey by following the directions on https://docs.chocolatey.org/en-us/choco/setup.
-
Install the
kubernetes-cli
Chocolatey package to installkubectl
:Note: Install a version that is within one minor version (older or newer) of the Kubernetes version the cluster uses (according to the Version Skew Policy of kubectl: https://kubernetes.io/releases/version-skew-policy/#kubectl). This is regardless if you use Chocolatey or some other method to install
kubectl
.-
View the list of
kubernetes-cli
versions that Chocolatey has and pick an appropriate version:choco list -e kubernetes-cli -a
For example, if your cluster uses Kubernetes version 1.20.9 then pick a
kubernetes-cli
version from this list that is at least 1.19.0 and at most 1.21.14. Chocolatey does not have every version, but for each minor version it does have the first few patch version as well as the latest patch version. -
Install the specific version you want. (In this case I am installing the highest patch version available, 1.20.15, of the same 1.20 minor version of my Kubernetes cluster):
choco install kubernetes-cli --version 1.20.15
-
-
Install the
kubernetes-helm
Chocolatey package to installhelm
:choco install kubernetes-helm
-
Install the Helm Diff Plugin to show a diff of changes prior to running an Helm chart upgrade.
If you are on Windows the
helm plugin install
method as listed in the instructions on https://github.com/databus23/helm-diff won't work as it will install a Linux version instead of a Windows version. For Windows you need to do the following:-
Download the latest Windows release tarball from the plugin's releases page on GitHub.
-
Using a PowerShell terminal run the following command to extract the file and place the plugin in your Helm plugins folder (replacing the download path with your actual file download path):
tar -C $env:APPDATA\helm\plugins -xzf <download path of helm-diff-windows-amd64.tgz...>
-
-
Make sure you always run Chocolatey (choco) commands in a terminal running as Administrator.
-
To view the Chocolatey packages you have installed locally run the command:
choco list --local-only