Install Kube CLI Tools
Install kubectl
To interact with a Kubernetes cluster, you need a tool to interact with the Kubernetes API. One of the most popular CLIs available is kubectl
(take your pick of pronunciations!).
The installation instructions for kubectl
are available in the Kubernetes documentation
. I recommend using a package manager (such as apt
or brew
for Linux, brew
for macOS, or Chocolatey for Windows) so you can easily update kubectl
in the future.
If you are going to work with multiple clusters across multiple versions of Kubernetes, you may also want to look into the asdf
tool, which can be used to manage multiple runtime versions of apps like kubectl
, allowing you to quickly switch to the correct version of kubectl
to match your cluster. Installation instructions are available here
, but not that this tool is not required for this workshop.
Install kubelogin
Azure Kubelogin is a utility that implements Azure authentication to your AKS clusters.
It is simple to install by following these instructions .
Tip
These tools are not required to complete the workshop, but you may find it easier to work with your cluster(s) if you do have them. But don’t worry if you’re not able to install it locally.
Install kubectx and kubens
kubectx
and kubens
are tools that make it quicker and easier to switch between Kubernetes clusters (kubectx
) and cluster namespaces (kubens
).
You can install them both together by following these instructions .
These tools are not required, but make life easier when working with multiple clusters and namespaces. For example, to switch between clusters using kubectl
, you would issue a command like:
kubectl config set-context --cluster <cluster-name>
Whereas with kubectx
you would simply type:
kubectx <cluster-name>
Similarly to change the namespaces within the current cluster using kubectl
, you would issue a command like:
kubectl config set-context --current --namespace <namespace-name>
Whereas with kubens
you would simple type:
kubens <namespace-name>
You can further extend their capabilities by adding completion scripts
so that you can use Tab to auto-complete names, and by integrating with fzf
to enable interactive mode
where you can select clusters and namespaces from a list, instead of entering the names on the command line.