cli: add status cmd

The new command allows checking the status of an upgrade
and which versions are installed.
Also remove the unused restclient.
And make GetConstellationVersion a function.
This commit is contained in:
Otto Bittner 2023-03-24 11:51:18 +01:00
parent 93e55d2f78
commit c8c2953d7b
19 changed files with 707 additions and 835 deletions

View file

@ -34,6 +34,7 @@ Commands:
* [azure](#constellation-iam-create-azure): Create IAM configuration on Microsoft Azure for your Constellation cluster
* [gcp](#constellation-iam-create-gcp): Create IAM configuration on GCP for your Constellation cluster
* [destroy](#constellation-iam-destroy): Destroy an IAM configuration and delete local Terraform files
* [status](#constellation-status): show status of a Constellation cluster
## constellation config
@ -673,3 +674,31 @@ constellation iam destroy [flags]
--force disable version compatibility checks - might result in corrupted clusters
```
## constellation status
show status of a Constellation cluster
### Synopsis
Show status of a constellation cluster.
Shows microservice, image and Kubernetes versions installed in the cluster. Also show status of current version upgrades.
```
constellation status [flags]
```
### Options
```
-h, --help help for status
```
### Options inherited from parent commands
```
--config string path to the configuration file (default "constellation-conf.yaml")
--debug enable debug logging
--force disable version compatibility checks - might result in corrupted clusters
```

View file

@ -57,3 +57,38 @@ If you are interested, you can monitor pods restarting in the `kube-system` name
Image and Kubernetes upgrades take longer.
For each node in your cluster, a new node has to be created and joined.
The process usually takes up to ten minutes per node.
## Check the status
Upgrades are asynchronous operations.
After you run `upgrade apply`, it will take a while until the upgrade has completed.
To understand if an upgrade is finished, you can run:
```bash
constellation status
```
This command displays the following information:
* The installed services and their versions
* The image and Kubernetes version the cluster is expecting on each node
* How many nodes are up to date
Here's an example output:
```shell-session
Target versions:
Image: v2.6.0
Kubernetes: v1.25.8
Installed service versions:
Cilium: v1.12.1
cert-manager: v1.10.0
constellation-operators: v2.6.0
constellation-services: v2.6.0
Cluster status: Some node versions are out of date
Image: 23/25
Kubernetes: 25/25
```
This output indicates that the cluster is running Kubernetes version `1.25.8`, and all nodes have the appropriate binaries installed.
23 out of 25 nodes have already upgraded to the targeted image version of `2.6.0`, while two are still in progress.