nokia / danm-utils

BSD 3-Clause "New" or "Revised" License
6 stars 9 forks source link

Introduce cmd/showalloc to show IP allocation map of dnet/cnet/tnet #11

Closed TothFerenc closed 4 years ago

TothFerenc commented 4 years ago

This PR introduces the showalloc command to show IP allocation map of DanmNets, ClusterNetworks and TenantNetworks.

Parameters:

Example run:

# showalloc --kubeconfig .kube/config -dnet sriov-a -n kube-system
DANM network Kind: DanmNet
       IP version: IPv4
             CIDR: 10.100.100.0/24
       Pool start: 10.100.100.1
       Pool   end: 10.100.100.254
--------------------------------------------------------------
   10.100.100.0 : reserved (network base address)
   10.100.100.1 : allocated (Pod: danmtest-869444956b-vxshh)
   10.100.100.2 : allocated (Pod: danmtest-869444956b-gk2wh)
   10.100.100.3 : allocated (Pod: danmtest-869444956b-rrfpr)
   10.100.100.4 : allocated (Pod: danmtest-869444956b-z92pl)
   10.100.100.5 : allocated (Pod: danmtest-869444956b-2j2vp)
 10.100.100.255 : reserved (broadcast address)