calicoctl ipam

This section describes the calicoctl ipam show command.

Read the calicoctl Overview for a full list of calicoctl commands.

Displaying the help text for ‘calicoctl ipam show’ command

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

  1. Usage:
  2. calicoctl ipam show [--ip=<IP> | --show-blocks] [--config=<CONFIG>]
  3. Options:
  4. -h --help Show this screen.
  5. --ip=<IP> Report whether this specific IP address is in use.
  6. --show-blocks Show detailed information for IP blocks as well as pools.
  7. --show-borrowed Show detailed information for "borrowed" IP addresses.
  8. --show-configuration Show current Calico IPAM configuration.
  9. -c --config=<CONFIG> Path to the file containing connection
  10. configuration in YAML or JSON format.
  11. [default: /etc/calico/calicoctl.cfg]
  12. Description:
  13. The ipam show command prints information about a given IP address, or about
  14. overall IP usage.

Examples

  1. Print the information associated with an IP address.

    1. calicoctl ipam show --ip=192.168.1.2

    The following result indicates that the IP is not assigned to an endpoint.

    1. IP 192.168.1.2 is not currently assigned
  2. Print the information associated with a different IP address.

    1. calicoctl ipam show --ip=10.244.118.70

    For a Kubernetes pod IP, attributes indicate the pod name and namespace:

    1. IP 10.244.118.70 is in use
    2. Attributes:
    3. pod: nano-66d4c99f8b-jm5s9
    4. namespace: default
    5. node: ip-172-16-101-160.us-west-2.compute.internal
  3. Print a summary of IP usage.

    1. calicoctl ipam show

    The table shows usage for each IP Pool:

    1. +----------+-------------------+------------+------------+-------------------+
    2. | GROUPING | CIDR | IPS TOTAL | IPS IN USE | IPS FREE |
    3. +----------+-------------------+------------+------------+-------------------+
    4. | IP Pool | 10.65.0.0/16 | 65536 | 5 (0%) | 65531 (100%) |
    5. | IP Pool | fd5f:abcd:64::/48 | 1.2089e+24 | 7 (0%) | 1.2089e+24 (100%) |
    6. +----------+-------------------+------------+------------+-------------------+
  4. Print more detailed IP usage by blocks.

    1. calicoctl ipam show --show-blocks

    As well as the total usage per IP Pool, the table shows usage for block that has been allocated from those pools:

    1. +----------+-------------------------------------------+------------+------------+-------------------+
    2. | GROUPING | CIDR | IPS TOTAL | IPS IN USE | IPS FREE |
    3. +----------+-------------------------------------------+------------+------------+-------------------+
    4. | IP Pool | 10.65.0.0/16 | 65536 | 5 (0%) | 65531 (100%) |
    5. | Block | 10.65.79.0/26 | 64 | 5 (8%) | 59 (92%) |
    6. | IP Pool | fd5f:abcd:64::/48 | 1.2089e+24 | 7 (0%) | 1.2089e+24 (100%) |
    7. | Block | fd5f:abcd:64:4f2c:ec1b:27b9:1989:77c0/122 | 64 | 7 (11%) | 57 (89%) |
    8. +----------+-------------------------------------------+------------+------------+-------------------+
  5. Print more detailed information about borrowed IP addresses.

    1. calicoctl ipam show --show-borrowed

    Table shows which IP addresses have been borrowed by which node out of which block and the entity consuming it:

    1. +------------+-----------------+---------------+---------------+------+------------------------------------+
    2. | IP | BORROWING-NODE | BLOCK | BLOCK OWNER | TYPE | ALLOCATED-TO |
    3. +------------+-----------------+---------------+---------------+------+------------------------------------+
    4. | 172.16.0.1 | worker-node-1 | 172.16.0.0/29 | worker-node-2 | pod | external-ns/nginx-6db489d4b7-gln7h |
    5. | 172.16.0.2 | worker-node-3 | 172.16.0.0/29 | worker-node-2 | pod | external-ns/nginx-6db489d4b7-kzkbv |
    6. +------------+-----------------+---------------+---------------+------+------------------------------------+
  6. Print current IPAM configuration.

    1. calicoctl ipam show --show-configuration

    Table shows current IPAM configuration:

    1. +--------------------+-------+
    2. | PROPERTY | VALUE |
    3. +--------------------+-------+
    4. | StrictAffinity | false |
    5. | AutoAllocateBlocks | true |
    6. +--------------------+-------+

Options

  1. --ip=<IP> Specific IP address to show.
  2. --show-blocks Show detailed information for IP blocks as well as pools.
  3. --show-borrowed Show detailed information for "borrowed" IP addresses.
  4. --show-configuration Show current Calico IPAM configuration

General options

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

See also