Install calicoctl
Big picture
calicoctl
allows you to create, read, update, and delete Calico Enterprise objects
from the command line. These objects represent the networking and policy
of your cluster.
You should limit access to calicoctl
and your Calico Enterprise datastore to
trusted administrators. We discuss methods of limiting access to the
Calico Enterprise datastore in the configuration section.
You can run calicoctl
on any host with network access to the
Calico Enterprise datastore as either a binary or a container.
As a binary on a single host, you can also run it as a kubectl plugin.
How to
Make sure you always install the version of calicoctl
that matches the version of Calico Enterprise 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
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
Consider navigating to a location that's in your PATH
. For example, /usr/local/bin/
.
Use the following command to download the calicoctl
binary.
curl -o calicoctl -L https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl
curl -o calicoctl -L https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl
Set the file to be executable.
chmod +x calicoctl
If the location of calicoctl
is not already in your PATH
, move the file to one that is or add its location to your PATH
. 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.
Consider navigating to a location that's in your PATH
. For example, /usr/local/bin/
.
Use the following command to download the calicoctl
binary.
curl -o calicoctl -L https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl-darwin-amd64
Set the file to be executable.
chmod +x calicoctl
If you get the error, cannot be opened because the developer cannot be verified
when using calicoctl
for the first time, go to Applications > System Preferences > Security & Privacy
in the General
tab at the bottom of the window click Allow anyway
.
If the location of calicoctl
is not already in your PATH
, move the file to one that is or add its location to your PATH
. This will allow you to invoke it without having to prepend its location.
Use the following PowerShell command to download the calicoctl
binary.
Consider running PowerShell as administrator and navigating
to a location that's in your PATH
. For example, C:\Windows
.
Invoke-WebRequest -Uri "https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl-windows-amd64.exe" -OutFile "calicoctl.exe"
Install calicoctl as a kubectl plugin on a single host
- Linux
- Mac OSX
- Windows
Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.
Consider navigating to a location that's in your PATH
. For example, /usr/local/bin/
.
Use the following command to download the calicoctl
binary.
curl -o kubectl-calico -L https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl
Set the file to be executable.
chmod +x kubectl-calico
If the location of kubectl-calico
is not already in your PATH
, move the file to one that is or add its location to your PATH
. This is required 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.
Consider navigating to a location that's in your PATH
. For example, /usr/local/bin/
.
Use the following command to download the calicoctl
binary.
curl -o kubectl-calico -L https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl-darwin-amd64
Set the file to be executable.
chmod +x kubectl-calico
If you get the error, "cannot be opened because the developer cannot be verified" when using calicoctl
for the first time, go to Applications > System Preferences > Security & Privacy in the General tab at the bottom of the window click Allow anyway
.
If the location of kubectl-calico
is not already in your PATH
, move the file to one that is or add its location to your PATH
. This is required for kubectl
to detect the plugin.
Use the following PowerShell command to download the calicoctl
binary.
Consider running PowerShell as administrator and navigating
to a location that's in your PATH
. For example, C:\Windows
.
Invoke-WebRequest -Uri "https://downloads.tigera.io/ee/binaries/v3.19.4/calicoctl-windows-amd64.exe" -OutFile "kubectl-calico.exe"
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
-
Ensure that you have the
config.json
file with the private Tigera registry credentials. -
From a terminal prompt, use the following command to either create or open the
~/.docker/config.json
file.vi ~/.docker/config.json
-
Depending on the existing contents of the file, edit it in one of the following ways.
-
New file: Paste in the entire contents of the
config.json
file from Tigera. -
Existing file without quay.io object: Add the following lines from the
config.json
inside the"auth"
object."quay.io": {
"auth": "<ROBOT-TOKEN-VALUE>",
"email": ""
} -
Existing file with quay.io object: Add the following lines from the
config.json
inside the"quay.io"
object."auth": "<ROBOT-TOKEN-VALUE>",
"email": ""
-
-
Save and close the file.
-
Use the following commands to pull the
calicoctl
image from the Tigera registry.docker pull quay.io/tigera/calicoctl:v3.19.4
-
Confirm that the image has loaded by typing
docker images
.REPOSITORY TAG IMAGE ID CREATED SIZE
tigera/calicoctl v3.19.4 e07d59b0eb8a 2 minutes ago 42MB
Next step: