11# Microsoft Azure CLI kubectl plugin
22
3- ` kubectl-az ` is a set of commands used to troubleshoot Kubernetes clusters in
4- Azure.
3+ ` kubectl-az ` is a ` kubectl ` plugin that provides a set of commands that can be
4+ used to debug an AKS cluster even when the cluster's control plane is not
5+ working correctly. For instance, when the API server is having problems.
6+
7+ This plugin is not meant to replace
8+ [ az] ( https://learn.microsoft.com/en-us/cli/azure/?view=azure-cli-latest ) , but
9+ to complement it by providing additional commands and, mainly, allowing users to
10+ have a kubectl-like experience when working with an AKS cluster.
511
612Going through the following documentation will help you to understand each
713available command and which one is the most suitable for your case:
@@ -10,26 +16,46 @@ available command and which one is the most suitable for your case:
1016- [ check-apiserver-connectivity] ( docs/check-apiserver-connectivity.md )
1117- [ config] ( docs/config.md )
1218
13- Consider ` kubectl-az ` expects the cluster to use virtual machine scale sets.
14- And, commands that allow using ` --node ` flag requires the Kubernetes API server
15- to up and running because it is used to retrieve the VMSS instance information
16- of nodes .
19+ Consider ` kubectl-az ` expects the cluster to use virtual machine scale sets,
20+ which is the case of an AKS cluster. And, the use of the ` --node ` flag requires
21+ the Kubernetes control plane to up and running, because the VMSS instance
22+ information of the node will be retrieved from the Kubernetes API server .
1723
18- However, in case of issues with the Kubernetes API server, we can retrieve the
19- VMSS instance information from the [ Azure portal] ( https://portal.azure.com/ ) and
20- pass it to the commands using the ` --id ` flag or separately with the
21- ` --subscription ` , ` --node-resource-group ` , ` --vmss ` and ` --instance-id ` flags.
24+ However, in case of issues with the Kubernetes control plane, you can reuse the
25+ already stored VMSS instance information, see [ config] ( docs/config.md ) command.
26+ Or, if it is a cluster you have never used before on that host, you can retrieve
27+ such information from the [ Azure portal] ( https://portal.azure.com/ ) and pass it
28+ to the commands using the ` --id ` flag or separately with the ` --subscription ` ,
29+ ` --node-resource-group ` , ` --vmss ` and ` --instance-id ` flags.
2230
2331## Install
2432
33+ There is multiple ways to install the ` kubectl-az ` .
34+
35+ ### Install a specific release
36+
37+ It is possible to download the asset for a given release and platform from the
38+ [ releases page] ( https://github.com/azure/kubectl-az/releases/ ) , uncompress and
39+ move the ` kubectl-az ` executable to any folder in your ` $PATH ` .
40+
2541``` bash
26- $ git clone https://github.com/Azure/kubectl-az.git
27- $ cd kubectl-az
28- # Build and copy the resulting binary in $HOME/.local/bin/
29- $ make install
42+ VERSION=v0.1.0
43+ curl -sL https://github.com/azure/kubectl-az/releases/latest/download/kubectl-az-linux-amd64-${VERSION} .tar.gz | sudo tar -C /usr/local/bin -xzf - kubectl-az
44+ kubectl az version
3045```
3146
32- Notice it requires Go version 1.17.
47+ ### Compile from source
48+
49+ To build ` kubectl-az ` from source, you'll need to have a Golang version 1.17
50+ or higher installed:
51+
52+ ``` bash
53+ git clone https://github.com/Azure/kubectl-az.git
54+ cd kubectl-az
55+ # Build and copy the resulting binary in $HOME/.local/bin/
56+ make install
57+ kubectl az version
58+ ```
3359
3460## Usage
3561
0 commit comments