$linuxjunkies
>

calicoctl(1)

Command-line interface for managing Calico networking and security policies in Kubernetes clusters.

UbuntuDebianFedoraArch

Synopsis

calicoctl [OPTION] COMMAND [ARG]...

Description

calicoctl is the command-line tool for managing Calico, a container networking and network security solution for Kubernetes. It allows you to create, read, update, and delete Calico resources such as NetworkPolicies, BGP peers, IP pools, and nodes directly from the CLI or through resource definitions.

calicoctl can operate in two modes: as a Kubernetes client (communicating with the Calico API via the Kubernetes API server) or as a direct etcd client. It supports both imperative commands and declarative YAML manifests for infrastructure-as-code workflows.

Common options

FlagWhat it does
--allow-version-mismatchAllow client and cluster version mismatch (useful for testing)
-f, --filenameFilename or directory of resource definitions (YAML/JSON)
-o, --outputOutput format: yaml, json, or table (default: yaml)
--kubeconfigPath to kubeconfig file for Kubernetes authentication
-n, --namespaceKubernetes namespace for the resource
--configPath to calicoctl configuration file
-h, --helpDisplay help information
--log-levelSet logging level: debug, info, warning, error (default: info)

Examples

List all Calico nodes in the cluster

calicoctl get nodes

Display all network policies in the default namespace

calicoctl get networkpolicy -n default

Create or update Calico resources from a YAML manifest

calicoctl apply -f policy.yaml

Delete a specific network policy from the production namespace

calicoctl delete networkpolicy my-policy -n production

List all global network policies and output in YAML format

calicoctl get globalnetworkpolicy -o yaml

Display all configured IP address pools

calicoctl get ippool

Show detailed information about a specific node

calicoctl describe node node-01

Replace a resource with a new definition from a JSON file

calicoctl replace -f updated-policy.json

Related commands