Install calicoctl
Big picture
This guide helps you install the calicoctl
command line tool to manage Calico resources
and perform administrative functions.
Value
The calicoctl
command line tool is required to use many of Calico's features. It
is used to manage Calico policies and configuration, as well as view detailed cluster status.
Concepts
API groups
All Kubernetes resources belong to an API group. The API group is indicated by the resource's apiVersion
. For example, Calico
uses resources in the projectcalico.org/v3
API group for configuration, and the operator uses resources in the operator.tigera.io/v1
API group.
You can read more about API groups in the Kubernetes documentation.
calicoctl and kubectl
To manage Calico APIs in the projectcalico.org/v3
API group, you should use calicoctl
. This is because
calicoctl
provides important validation and defaulting for these resources that is not available in kubectl
. However, kubectl
should still be used to manage other Kubernetes resources.
If you would like to use kubectl
to manage projectcalico.org/v3
API resources, you can use the
Calico API server.
Never modify resources in the crd.projectcalico.org
API group directly. These are internal data representations
and modifying them directly may result in unexpected behavior.
In addition to resource management, calicoctl
also enables other Calico administrative tasks such as viewing IP pool utilization
and BGP status.
Datastore
Calico objects are stored in one of two datastores, either etcd or Kubernetes. The choice of datastore is determined at the time Calico is installed. Typically for Kubernetes installations the Kubernetes datastore is the default.
You can run calicoctl
on any host with network access to the Calico datastore as either a binary or a container.
For step-by-step instructions, refer to the section that corresponds to your desired deployment.
How to
Make sure you always install the version of calicoctl
that matches the version of Calico running on your cluster.
- Install calicoctl as a binary on a single host
- Install calicoctl as a kubectl plugin on a single host
- Install calicoctl as a container on a single host
Install calicoctl as a binary on a single host
- Linux
- Mac OSX
- Windows
- Linux PPC64le
- Linux arm64
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-linux-amd64 -o calicoctl
-
Set the file to be executable.
chmod +x ./calicoctl
noteIf the location of
calicoctl
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This will allow you to invoke it without having to prepend its location.
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-darwin-amd64 -o calicoctl
-
Set the file to be executable.
chmod +x calicoctl
noteIf you are faced with
cannot be opened because the developer cannot be verified
error when usingcalicoctl
for the first time. go toApplications > System Preferences > Security & Privacy
in theGeneral
tab at the bottom of the window clickAllow anyway
.noteIf the location of
calicoctl
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This will allow you to invoke it without having to prepend its location.
-
Use the following PowerShell command to download the
calicoctl
binary.tipConsider running PowerShell as administrator and navigating to a location that's in your
PATH
. For example,C:\Windows
.
Invoke-WebRequest -Uri "https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-windows-amd64.exe" -OutFile "calicoctl.exe"
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-linux-ppc64le -o calicoctl
-
Set the file to be executable.
chmod +x calicoctl
noteIf the location of
calicoctl
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This will allow you to invoke it without having to prepend its location.
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-linux-arm64 -o calicoctl
-
Set the file to be executable.
chmod +x calicoctl
noteIf the location of
calicoctl
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This will allow you to invoke it without having to prepend its location.
Install calicoctl as a kubectl plugin on a single host
- Linux
- Mac OSX
- Windows
- Linux PPC64le
- Linux arm64
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-linux-amd64 -o kubectl-calico
-
Set the file to be executable.
chmod +x kubectl-calico
noteIf the location of
kubectl-calico
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This is required in order for kubectl to detect the plugin and allow you to use it.
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-darwin-amd64 -o kubectl-calico
-
Set the file to be executable.
chmod +x kubectl-calico
noteIf you are faced with
cannot be opened because the developer cannot be verified
error when usingcalicoctl
for the first time. go toApplications > System Preferences > Security & Privacy
in theGeneral
tab at the bottom of the window clickAllow anyway
.If the location of
kubectl-calico
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This is required in order for kubectl to detect the plugin and allow you to use it.
-
Use the following PowerShell command to download the
calicoctl
binary.tipConsider running PowerShell as administrator and navigating to a location that's in your
PATH
. For example,C:\Windows
.
Invoke-WebRequest -Uri "https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-windows-amd64.exe" -OutFile kubectl-calico.exe
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-linux-ppc64le -o kubectl-calico
-
Set the file to be executable.
chmod +x kubectl-calico
noteIf the location of
kubectl-calico
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This is required in order for kubectl to detect the plugin and allow you to use it.
-
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
tipConsider navigating to a location that's in your
PATH
. For example,/usr/local/bin/
. -
Use the following command to download the
calicoctl
binary.curl -L https://github.com/projectcalico/calico/releases/download/v3.29.1/calicoctl-linux-arm64 -o kubectl-calico
-
Set the file to be executable.
chmod +x kubectl-calico
noteIf the location of
kubectl-calico
is not already in yourPATH
, move the file to one that is or add its location to yourPATH
. This is required in order for kubectl to detect the plugin and allow you to use it.
Verify the plugin works.
kubectl calico -h
You can now run any calicoctl
subcommands through kubectl calico
.
If you run these commands from your local machine (instead of a host node), some of the node related subcommands will not work (like node status).
Install calicoctl as a container on a single host
To install calicoctl
as a container on a single host, log into the
target host and issue the following command.
docker pull calico/ctl:v3.29.1
Next step: