cluster-api-provider-bringyourownhost icon indicating copy to clipboard operation
cluster-api-provider-bringyourownhost copied to clipboard

[Feature] Centrally view host inventory in the capacity pool

Open anusha94 opened this issue 2 years ago • 3 comments

Describe the solution you'd like Currently when we issue a get request on byohost, only the name and namespace fields are presented to the user.

> kubectl get byohost
name     namespace
host1     ns1
host2     ns2

The operator should be able to view the host inventory with host information such as, OS, platform, hardware specs and any metadata on the host. This will be useful when deciding, which host one can choose for provisioning / deprovisioning nodes.

We should also add information on what cluster a particular host belongs to so that it is easier to view which hosts are occupied and which hosts are available in the capacity pool.

anusha94 avatar Apr 12 '22 09:04 anusha94

This might help us in defining the fields https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/pull/501#issuecomment-1110310832

shubham14bajpai avatar Apr 27 '22 05:04 shubham14bajpai

The cluster information already exists on the byohosts as a lable cluster.x-k8s.io/cluster-name and one can see that using below command. Adding it would be making the information repetitive.

$ kubectl get byohosts.infrastructure.cluster.x-k8s.io --show-labels 
NAME    OSNAME   OSIMAGE          ARCH    LABELS
host1   linux    Ubuntu 20.04.4   amd64   byoh.infrastructure.cluster.x-k8s.io/byomachine-name=default.byoh-cluster-md-0-8zn8f,cluster.x-k8s.io/cluster-name=byoh-cluster
host2   linux    Ubuntu 20.04.4   amd64   byoh.infrastructure.cluster.x-k8s.io/byomachine-name=default.byoh-cluster-control-plane-fkbwm,cluster.x-k8s.io/cluster-name=byoh-cluster

shubham14bajpai avatar Apr 27 '22 15:04 shubham14bajpai

Would the below two commands make it more informative to decide hosts to choose for provisioning.

The standard command would give the os, arch, distribution for the hosts.

$ kubectl get byohosts
NAME    OSNAME   OSIMAGE          ARCH
host1   linux    Ubuntu 20.04.4   amd64
host2   linux    Ubuntu 20.04.4   amd64

we tried using ResourceList for representing the capacity of hosts as there is a lot of tooling/libraries build around it in kubernetes and can help us build features later on.

$ kubectl get byohosts -o wide     
NAME    OSNAME   OSIMAGE          ARCH    CPU   Memory
host1   linux    Ubuntu 20.04.4   amd64   4     16398040Ki
host2   linux    Ubuntu 20.04.4   amd64   4     16398040Ki

shubham14bajpai avatar Apr 28 '22 11:04 shubham14bajpai