Installing calicoctl

About installing calicoctl

calicoctl allows you to create, read, update, and delete Calico objects from the command line. You can run it on any host with network access to the Calico datastore in either of the following formats.

  • Binary: provides full functionality, including node commands for instances of calico/node on the same host.

  • Container: provides less functionality than the binary format, such as no use of the node commands.

Installing calicoctl as a binary

  1. Log into the host, open a terminal prompt, and navigate to the location where you want to install the binary.

    Tip: Consider navigating to a location that’s in your PATH. For example, /usr/local/bin/.

  2. Use the following command to download the calicoctl binary.

    curl -O -L https://github.com/projectcalico/calicoctl/releases/download/v2.0.7/calicoctl
    
  3. Set the file to be executable.

    chmod +x calicoctl
    

    Note: 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.

Next step:

Configure calicoctl to connect to your datastore.

Installing calicoctl as a container

If you are on Kubernetes, we provide two manifests that make it easy to deploy calicoctl as a pod.

  • etcd datastore:

     kubectl apply -f https://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/calicoctl.yaml
    
  • Kubernetes API datastore:

     kubectl apply -f https://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calicoctl.yaml
    

In other environments, use the following command.

docker pull quay.io/calico/ctl:v2.0.7

Next step:

Configure calicoctl to connect to your datastore.