calicoctl ipam show
calicoctl ipam show 명령어는 Calico IP 주소 사용 현황을 보여줘요. 플래그 없이 실행하면 IP 풀 사용량 요약을 표시하고, 특정 IP 주소의 소유자와 상세 정보를 확인할 수도 있어요. 블록, 빌린(borrowed) 주소, 현재 IPAM 설정까지 들여다볼 수 있어요.
출처: 문서
본문
이 섹션은 calicoctl ipam show 명령어를 설명해요.
calicoctl 명령어 전체 목록은 calicoctl 개요에서 확인하세요.
'calicoctl ipam show' 명령어 도움말 표시하기
calicoctl ipam show --help를 실행하면 다음과 같은 도움말 메뉴가 표시돼요.
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")
예시
-
IP 주소와 관련된 정보를 출력해요.
calicoctl ipam show --ip=192.168.1.2다음 결과는 그 IP가 엔드포인트에 할당되지 않았다는 뜻이에요.
IP 192.168.1.2 is not currently assigned -
다른 IP 주소와 관련된 정보를 출력해요.
calicoctl ipam show --ip=10.244.118.70Kubernetes 파드 IP라면 출력에 handle ID와 소유자(owner) 속성이 표시돼요:
IP 10.244.118.70 is in use Handle ID: k8s-pod-network.abc123 Active Owner Attributes: pod: nano-66d4c99f8b-jm5s9 namespace: default node: ip-172-16-101-160.us-west-2.compute.internalKubeVirt VM IP라면 대체(alternate) 소유자 속성이 함께 표시될 수 있어요 (예: 라이브 마이그레이션 중):
IP 10.244.118.80 is in use Handle ID: k8s-pod-network.def456 Active Owner Attributes: namespace: default node: worker-node-1 vmi: my-vm pod: virt-launcher-my-vm-abc12 Alternate Owner Attributes: namespace: default node: worker-node-2 vmi: my-vm pod: virt-launcher-my-vm-def34 -
IP 사용량 요약을 출력해요.
calicoctl ipam show표에는 각 IP 풀의 사용량이 보여요:
+----------+-------------------+------------+------------+-------------------+ | 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%) | +----------+-------------------+------------+------------+-------------------+ -
블록 단위의 더 자세한 IP 사용량을 출력해요.
calicoctl ipam show --show-blocksIP 풀별 전체 사용량뿐 아니라, 그 풀에서 할당된 블록의 사용량도 표에 함께 보여요:
+----------+-------------------------------------------+------------+------------+-------------------+ | 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%) | +----------+-------------------------------------------+------------+------------+-------------------+ -
빌린(borrowed) IP 주소에 대한 더 자세한 정보를 출력해요.
calicoctl ipam show --show-borrowed표에는 어떤 IP 주소가 어느 노드가, 어느 블록에서 빌렸는지, 그리고 그것을 소비하는 개체가 무엇인지 보여요:
+------------+-----------------+---------------+---------------+------+------------------------------------+ | 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 | +------------+-----------------+---------------+---------------+------+------------------------------------+ -
현재 IPAM 설정을 출력해요.
calicoctl ipam show --show-configuration표에는 현재 IPAM 설정이 보여요:
+--------------------+-------+ | PROPERTY | VALUE | +--------------------+-------+ | StrictAffinity | false | | AutoAllocateBlocks | true | +--------------------+-------+
옵션
--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.
일반 옵션
-c, --config string Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
더 보기
더 알아보기 (Learn more)
ipam show는 IP 주소가 누구에게 할당됐는지, 풀과 블록 사용량이 어떤지 진단할 때 유용해요. --show-blocks와 --show-borrowed 플래그로 더 깊이 들여다보세요. KubeVirt 라이브 마이그레이션 중에는 대체 소유자 속성도 함께 표시된다는 점도 기억하세요.