Skip to main content
Calico Open Source 3.33 (latest) documentation

calicoctl patch

This sections describes the calicoctl patch command.

Read the calicoctl command line interface user reference for a full list of calicoctl commands.

Displaying the help text for 'calicoctl patch' command​

Run calicoctl patch --help to display the following help menu for the command.

Patch a single existing Calico resource in place. Use patch to change specific
fields without supplying the whole resource, as you'd have to with replace.

Usage:
calicoctl patch KIND NAME [flags]

Examples:
# Set a route reflector cluster ID on a node.
calicoctl patch node node-0 --patch '{"spec":{"bgp":{"routeReflectorClusterID":"224.0.0.1"}}}'

Flags:
-c, --config string Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
-h, --help help for patch
-n, --namespace string Namespace of the resource.
-p, --patch string Spec to use to patch the resource.
-t, --type string Format of patch type: strategic, json, or merge. (default "strategic")

Global Flags:
--allow-version-mismatch Allow client and cluster versions mismatch
--context string The name of the kubeconfig context to use
-l, --log-level string Set the log level (panic, fatal, error, warn, info, debug) (default "panic")

Examples​

  1. Patch an IP Pool to enable outgoing NAT:

    calicoctl patch ippool ippool1 -p '{"spec":{"natOutgoing": true}}'

    Results indicate that a resource was successfully patched:

    Successfully patched 1 'ipPool' resource

Options​

-p, --patch string Spec to use to patch the resource.
-t, --type string Format of patch type: strategic, json, or merge. (default "strategic")
-n, --namespace string Namespace of the resource.

General options​

-c, --config string Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")

See also​