cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
200 stars 59 forks source link

Improve the cmd: get clusters #449

Open cmoulliard opened 1 week ago

cmoulliard commented 1 week ago

Usage: idpbuilder [command]

Available Commands: completion Generate the autocompletion script for the specified shell create (Re)Create an IDP cluster delete Delete an IDP cluster get get information from the cluster help Help about any command version Print idpbuilder version and environment info

Flags: --color Enable colored log messages. -h, --help help for idpbuilder --kubePath string kube config file Path.

- Command currently shows:

Cluster: my-konflux URL of the kube API server: https://127.0.0.1:63473 TLS Verify: false Node: my-konflux-control-plane Internal IP: 10.89.0.2


- #445
cmoulliard commented 1 week ago

If several clusters/contexts/nodes have been created, then the command will output the following information:

Cluster: dabou
URL of the kube API server: https://127.0.0.1:53369
TLS Verify: false
External Port: 9443

Node: dabou-control-plane
Internal IP: 10.89.0.4
Capacity of the node: 
  cpu                  8
  memory               12.66 GB
  pods                 110
Allocated resources on node:
  CPU Requests: 1050m
  Memory Requests: 380Mi
----------------------------------------
Cluster: my-konflux
URL of the kube API server: https://127.0.0.1:63473
TLS Verify: false
External Port: 8443

Node: my-konflux-control-plane
Internal IP: 10.89.0.2
Capacity of the node: 
  cpu                  8
  memory               12.66 GB
  pods                 110
Allocated resources on node:
  CPU Requests: 2820m
  Memory Requests: 6898Mi
----------------------------------------
cmoulliard commented 1 week ago

I refactored the code to show the clusters using a Table

❯ ./idpbuilder get clusters
Nov 15 12:12:21 INFO enabling experimental podman provider 
NAME         EXTERNAL-PORT   KUBE-API                  TLS     KUBE-PORT
my-konflux   8443            https://127.0.0.1:65073   false   6443
test         9443            https://127.0.0.1:53454   false   6443

@nabuskey