calicoctl ipam show
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.
Show details of Calico IP address usage. With no flags it summarizes pool
usage; the flags drill into a specific address, individual blocks, borrowed
addresses, or the current IPAM configuration.
Usage:
calicoctl ipam show [flags]
Examples:
# Summarize IP pool usage.
calicoctl ipam show
# Check whether a specific IP is in use.
calicoctl ipam show --ip 10.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 show
--ip string Report whether this specific IP address is in use.
--show-blocks Show detailed information for IP blocks as well as pools.
--show-borrowed Show detailed information for borrowed IP addresses.
--show-configuration Show current Calico IPAM configuration.
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
-
Print the information associated with an IP address.
calicoctl ipam show --ip=192.168.1.2The following result indicates that the IP is not assigned to an endpoint.
IP 192.168.1.2 is not currently assigned -
Print the information associated with a different IP address.
calicoctl ipam show --ip=10.244.118.70For a Kubernetes pod IP, the output shows the handle ID and owner attributes:
IP 10.244.118.70 is in useHandle ID: k8s-pod-network.abc123Active Owner Attributes:pod: nano-66d4c99f8b-jm5s9namespace: defaultnode: ip-172-16-101-160.us-west-2.compute.internalFor a KubeVirt VM IP, alternate owner attributes may also be shown (for example, during a live migration):
IP 10.244.118.80 is in useHandle ID: k8s-pod-network.def456Active Owner Attributes:namespace: defaultnode: worker-node-1vmi: my-vmpod: virt-launcher-my-vm-abc12Alternate Owner Attributes:namespace: defaultnode: worker-node-2vmi: my-vmpod: virt-launcher-my-vm-def34 -
Print a summary of IP usage.
calicoctl ipam showThe table shows usage for each IP Pool:
+----------+-------------------+------------+------------+-------------------+| GROUPING | CIDR | IPS TOTAL | IPS IN USE | IPS FREE |+----------+-------------------+------------+------------+-------------------+| IP Pool | 10.65.0.0/16 | 65536 | 5 (0%) | 65531 (100%) || IP Pool | fd5f:abcd:64::/48 | 1.2089e+24 | 7 (0%) | 1.2089e+24 (100%) |+----------+-------------------+------------+------------+-------------------+ -
Print more detailed IP usage by blocks.
calicoctl ipam show --show-blocksAs well as the total usage per IP Pool, the table shows usage for block that has been allocated from those pools:
+----------+-------------------------------------------+------------+------------+-------------------+| GROUPING | CIDR | IPS TOTAL | IPS IN USE | IPS FREE |+----------+-------------------------------------------+------------+------------+-------------------+| IP Pool | 10.65.0.0/16 | 65536 | 5 (0%) | 65531 (100%) || Block | 10.65.79.0/26 | 64 | 5 (8%) | 59 (92%) || IP Pool | fd5f:abcd:64::/48 | 1.2089e+24 | 7 (0%) | 1.2089e+24 (100%) || Block | fd5f:abcd:64:4f2c:ec1b:27b9:1989:77c0/122 | 64 | 7 (11%) | 57 (89%) |+----------+-------------------------------------------+------------+------------+-------------------+ -
Print more detailed information about borrowed IP addresses.
calicoctl ipam show --show-borrowedTable shows which IP addresses have been borrowed by which node out of which block and the entity consuming it:
+------------+-----------------+---------------+---------------+------+------------------------------------+| IP | BORROWING-NODE | BLOCK | BLOCK OWNER | TYPE | ALLOCATED-TO |+------------+-----------------+---------------+---------------+------+------------------------------------+| 172.16.0.1 | worker-node-1 | 172.16.0.0/29 | worker-node-2 | pod | external-ns/nginx-6db489d4b7-gln7h || 172.16.0.2 | worker-node-3 | 172.16.0.0/29 | worker-node-2 | pod | external-ns/nginx-6db489d4b7-kzkbv |+------------+-----------------+---------------+---------------+------+------------------------------------+ -
Print current IPAM configuration.
calicoctl ipam show --show-configurationTable shows current IPAM configuration:
+--------------------+-------+| PROPERTY | VALUE |+--------------------+-------+| StrictAffinity | false || AutoAllocateBlocks | true |+--------------------+-------+
Options
--ip string Report whether this specific IP address is in use.
--show-blocks Show detailed information for IP blocks as well as pools.
--show-borrowed Show detailed information for borrowed IP addresses.
--show-configuration Show current Calico IPAM configuration.
General options
-c, --config string Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")