Using the Istioctl Command-line Tool
The istioctl
tool is a configuration command line utility that allows service operators to debug and diagnose their Istio service mesh deployments. The Istio project also includes two helpful scripts for istioctl
that enable auto-completion for Bash and ZSH. Both of these scripts provide support for the currently available istioctl
commands.
istioctl
only has auto-completion enabled for non-deprecated commands.
We recommend you use an istioctl
version that is the same version as your Istio control plane. Using matching versions helps avoid unforeseen issues.
If you have already , you should already have istioctl
and do not need to install it again.
Install istioctl
Install the istioctl
binary with curl
:
Download the latest release with the command:
Add the
istioctl
client to your path, on a macOS or Linux system:$ export PATH=$PATH:$HOME/.istioctl/bin
You can optionally enable the when working with a bash or ZSH console.
You can get an overview of your mesh using the proxy-status
or ps
command:
$ istioctl proxy-status
If a proxy is missing from the output list it means that it is not currently connected to a Pilot instance and so it will not receive any configuration. Additionally, if it is marked stale, it likely means there are networking issues or Pilot needs to be scaled.
Get proxy configuration
allows you to retrieve information about proxy configuration using the proxy-config
or pc
command.
For example, to retrieve information about cluster configuration for the Envoy instance in a specific pod:
$ istioctl proxy-config cluster <pod-name> [flags]
To retrieve information about bootstrap configuration for the Envoy instance in a specific pod:
$ istioctl proxy-config bootstrap <pod-name> [flags]
To retrieve information about route configuration for the Envoy instance in a specific pod:
To retrieve information about endpoint configuration for the Envoy instance in a specific pod:
See Debugging Envoy and Istiod for more advice on interpreting this information.
If you are using the macOS operating system with the Bash terminal shell, make sure that the bash-completion
package is installed. With the package manager for macOS, you can check to see if the bash-completion
package is installed with the following command:
$ brew info bash-completion
bash-completion: stable 1.3 (bottled)
If you find that the bash-completion
package is not installed, proceed with installing the bash-completion
package with the following command:
$ brew install bash-completion
Once the bash-completion package
has been installed on your macOS system, add the following line to your ~/.bash_profile
file:
If you are using a Linux-based operating system, you can install the Bash completion package with the apt-get install bash-completion
command for Debian-based Linux distributions or yum install bash-completion
for RPM-based Linux distributions, the two most common occurrences.
Once the bash-completion
package has been installed on your Linux system, add the following line to your ~/.bash_profile
file:
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
To enable istioctl
completion on your system, follow the steps for your preferred shell:
You will need to download the full Istio release containing the auto-completion files (in the /tools
directory). If you haven’t already done so, download the full release now.
Installing the bash auto-completion file
If you are using bash, the istioctl
auto-completion file is located in the tools
directory. To use it, copy the file to your home directory, then add the following line to source the istioctl
tab completion file from your .bashrc
file:
$ source ~/istioctl.bash
Installing the ZSH auto-completion file
source ~/_istioctl
You may also add the _istioctl
file to a directory listed in the fpath
variable. To achieve this, place the _istioctl
file in an existing directory in the fpath
, or create a new directory and add it to the fpath
variable in your ~/.zshrc
file.
If you get an error like complete:13: command not found: compdef
, then add the following to the beginning of your ~/.zshrc
file:
$ compinit
If your auto-completion is not working, try again after restarting your terminal. If auto-completion still does not work, try resetting the completion cache using the above commands in your terminal.
Using auto-completion
If the completion file has been installed correctly, press the Tab key while writing an istioctl
command, and it should return a set of command suggestions for you to choose from:
See also
Analyze your Istio configuration to detect potential issues and get general insights.
Introducing the Istio Operator
Introduction to Istio’s new operator-based installation and control plane management feature.
Shows you how to use istioctl analyze to identify potential issues with your configuration.
Install and customize any Istio configuration profile for in-depth evaluation or production use.