calicoctl(1)
Command-line interface for managing Calico networking and security policies in Kubernetes clusters.
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
| Flag | What it does |
|---|---|
--allow-version-mismatch | Allow client and cluster version mismatch (useful for testing) |
-f, --filename | Filename or directory of resource definitions (YAML/JSON) |
-o, --output | Output format: yaml, json, or table (default: yaml) |
--kubeconfig | Path to kubeconfig file for Kubernetes authentication |
-n, --namespace | Kubernetes namespace for the resource |
--config | Path to calicoctl configuration file |
-h, --help | Display help information |
--log-level | Set logging level: debug, info, warning, error (default: info) |
Examples
List all Calico nodes in the cluster
calicoctl get nodesDisplay all network policies in the default namespace
calicoctl get networkpolicy -n defaultCreate or update Calico resources from a YAML manifest
calicoctl apply -f policy.yamlDelete a specific network policy from the production namespace
calicoctl delete networkpolicy my-policy -n productionList all global network policies and output in YAML format
calicoctl get globalnetworkpolicy -o yamlDisplay all configured IP address pools
calicoctl get ippoolShow detailed information about a specific node
calicoctl describe node node-01Replace a resource with a new definition from a JSON file
calicoctl replace -f updated-policy.json