calicoctl ipam split

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.

  1. Usage:
  2. <BINARY_NAME> ipam split <NUMBER> [--cidr=<CIDR>] [--name=<POOL_NAME>] [--config=<CONFIG>] [--allow-version-mismatch]
  3. Options:
  4. -h --help Show this screen.
  5. -c --config=<CONFIG> Path to the file containing connection configuration in
  6. YAML or JSON format.
  7. [default: /etc/calico/calicoctl.cfg]
  8. --cidr=<CIDR> CIDR of the IP pool to split.
  9. --name=<POOL_NAME> Name of the IP pool to split.
  10. --allow-version-mismatch Allow client and cluster versions mismatch.
  11. Description:
  12. The ipam split command splits an IP pool specified by the specified CIDR or name
  13. into the specified number of smaller IP pools. Each child IP pool will be of equal
  14. size. IP pools can only be split into a number of smaller pools that is a power
  15. of 2.
  16. Examples:
  17. # Split the IP pool specified by 172.0.0.0/8 into 2 smaller pools
  18. <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.

  1. calicoctl datastore migrate lock

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

  1. 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.

  1. calicoctl datastore migrate unlock

General options

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

See also