---
title: "calicoctl patch"
description: "Reference for the calicoctl patch command in Calico Open Source, used to apply a partial update to a resource."
product: "Calico Open Source"
version: "3.33 (latest)"
section: "Reference"
canonical_url: "https://docs.tigera.io/calico/latest/reference/calicoctl/patch"
---

# calicoctl patch

This sections describes the `calicoctl patch` command.

Read the [calicoctl command line interface user reference](https://docs.tigera.io/calico/latest/reference/calicoctl/overview.md) 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.

```text
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:

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

   Results indicate that a resource was successfully patched:

   ```text
   Successfully patched 1 'ipPool' resource
   ```

### Options

```text
  -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

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

## See also

- [Installing calicoctl](https://docs.tigera.io/calico/latest/operations/calicoctl/install.md)
- [Resources](https://docs.tigera.io/calico/latest/reference/resources/overview.md) for details on all valid resources, including file format and schema
