calicoctl ipam split

1 MINUTE READ

This section describes the calicoctl ipam split command.

Read the calicoctlOverview for a full list of calicoctl commands.

Display the help text for calicoctl ipam split command

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

Usage:
  <BINARY_NAME> ipam split <NUMBER> [--cidr=<CIDR>] [--name=<POOL_NAME>] [--config=<CONFIG>] [--allow-version-mismatch]

Options:
  -h --help                    Show this screen.
  -c --config=<CONFIG>         Path to the file containing connection configuration in
                               YAML or JSON format.
                               [default: /etc/calico/calicoctl.cfg]
     --cidr=<CIDR>             CIDR of the IP pool to split.
     --name=<POOL_NAME>        Name of the IP pool to split.
     --allow-version-mismatch  Allow client and cluster versions mismatch.

Description:
  The ipam split command splits an IP pool specified by the specified CIDR or name
  into the specified number of smaller IP pools. Each child IP pool will be of equal
  size. IP pools can only be split into a number of smaller pools that is a power
  of 2.

Examples:
  # Split the IP pool specified by 172.0.0.0/8 into 2 smaller pools
  <BINARY_NAME> ipam split --cidr=172.0.0.0/8 2

Prerequisites

In order to split an IP pool, you will first need to lock the Calico database so that no IPAM data can change during the split. This is accomplished by using the calicoctl datastore migrate lock command. In order to continue normal IPAM operation, you will need to unlock the calico datastore after the split with the calicoctl datastore migrate unlock command.

Examples

Lock the Calico datastore.

calicoctl datastore migrate lock

Split the IP pool specified by 172.0.0.0/15 into 2 smaller pools.

calicoctl ipam split --cidr=172.0.0.0/15 2

This should create 2 IP pools, one covering CIDR 172.0.0.0/16 and one covering CIDR 172.1.0.0/16.

Unlock the Calico datastore to restore normal IPAM operation.

calicoctl datastore migrate unlock

General options

  -c --config=<CONFIG>         Path to the file containing connection configuration in
                               YAML or JSON format.
                               [default: /etc/calico/calicoctl.cfg]

See also