calicoctl command mostly used

Jbn1233
2 min readDec 3, 2022

--

# calicoctl  ipam show
+----------+---------------------+------------+------------+-------------------+
| GROUPING | CIDR | IPS TOTAL | IPS IN USE | IPS FREE |
+----------+---------------------+------------+------------+-------------------+
| IP Pool | 10.169.0.0/16 | 65536 | 44 (0%) | 65492 (100%) |
| IP Pool | fddb:ffeb:2139::/48 | 1.2089e+24 | 0 (0%) | 1.2089e+24 (100%) |
+----------+---------------------+------------+------------+-------------------+

# calicoctl ipam show --show-blocks
+----------+---------------------+------------+------------+-------------------+
| GROUPING | CIDR | IPS TOTAL | IPS IN USE | IPS FREE |
+----------+---------------------+------------+------------+-------------------+
| IP Pool | 10.169.0.0/16 | 65536 | 44 (0%) | 65492 (100%) |
| Block | 10.169.119.128/26 | 64 | 21 (33%) | 43 (67%) |
| Block | 10.169.152.192/26 | 64 | 1 (2%) | 63 (98%) |
| Block | 10.169.198.128/26 | 64 | 22 (34%) | 42 (66%) |
| IP Pool | fddb:ffeb:2139::/48 | 1.2089e+24 | 0 (0%) | 1.2089e+24 (100%) |
+----------+---------------------+------------+------------+-------------------+

# calicoctl ipam check
Checking IPAM for inconsistencies...

Loading all IPAM blocks...
Found 3 IPAM blocks.
IPAM block 10.169.119.128/26 affinity=host:tamarix-0002:
IPAM block 10.169.152.192/26 affinity=host:tamarix-0003:
IPAM block 10.169.198.128/26 affinity=host:tamarix-0001:
IPAM blocks record 44 allocations.

Loading all IPAM pools...
10.169.0.0/16
fddb:ffeb:2139::/48
Found 2 active IP pools.

Loading all nodes.
Found 3 node tunnel IPs.

Loading all workload endpoints.
Found 41 workload IPs.
Workloads and nodes are using 44 IPs.
...
...
...
Found 0 in-use IPs that are not in active IP pools.
Found 0 in-use IPs that are in active IP pools but have no corresponding IPAM allocation.

# calicoctl get felixconfiguration
NAME
default
node.tamarix-0001
node.tamarix-0002
node.tamarix-0003

# calicoctl get felixconfiguration default -o json|jq .spec
{
"logSeverityScreen": "Info",
"ipipEnabled": true,
"reportingInterval": "0s",
"bpfEnabled": true,
"bpfLogLevel": ""
}

# calicoctl get ipPool
NAME CIDR SELECTOR
default-ipv4-ippool 10.169.0.0/16 all()
default-ipv6-ippool fddb:ffeb:2139::/48 all()

# calicoctl get workloadEndpoint
WORKLOAD NODE NETWORKS INTERFACE
echo-5fc5b5bc84-7w7dh tamarix-0001 10.169.198.157/32 cali6cb6b93278f
echo-deployment-94fbdc958-8l6ph tamarix-0001 10.169.198.159/32 cali5014ed64b0c
nick-prometheus-adapter-689b95f6bd-k7jvh tamarix-0001 10.169.198.150/32 calib84b5e87cbd
nick-prometheus-stack-kube-operator-555686bbcd-grhrk tamarix-0001 10.169.198.147/32 caliaf79c55b107
nick-prometheus-stack-kube-state-metrics-979d6f885-zt7d7 tamarix-0001 10.169.198.148/32 calid8baff84ec7
prometheus-nick-prometheus-stack-kube-prometheus-0 tamarix-0001 10.169.198.160/32 calid4a5fb41631
busybox-test tamarix-0002 10.169.119.157/32 cali3620363bb51
echo-5fc5b5bc84-zgqqg tamarix-0002 10.169.119.155/32 caliac1f2c2d60c
nginx-6c4c7f844f-7hbqw tamarix-0002 10.169.119.153/32 cali1c076a47520
nick-prometheus-stack-grafana-6f4676fb57-m85t6 tamarix-0002 10.169.119.146/32 calia12510a9204
ubuntu-85f4dbbc77-k49t7 tamarix-0002 10.169.119.147/32 calieddb2caad30

# calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+---------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+---------------+---------------+-------+----------+-------------+
| 192.168.0.146 | global | up | 20:38:21 | Established |
| 192.168.0.171 | node specific | up | 20:38:20 | Established |
| 192.168.0.200 | node specific | up | 20:38:20 | Established |
+---------------+---------------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet