Skip to content

Commit

Permalink
doc: Add description for admin cluster commands (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzottola authored May 24, 2024
1 parent 4f48eab commit 46ce563
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
58 changes: 58 additions & 0 deletions cmd/admin_cluster_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,64 @@ var (
adminClusterDeployCmd = &cobra.Command{
Use: "deploy",
Short: "Deploy or upgrade clusters",
Long: `This command has 2 main purposes:
* deploy / redeploy clusters: mainly used to update Qovery components (agent / charts / etc.)
* upgrade clusters: used to upgrade to next kube version supported
> Filters
---------
Apply filters using the "--filters" option: filters can be applied to one or more values separated by comma interpreted as logical OR.
The fields usable as filters are the following ones:
* OrganizationId
* OrganizationName
* OrganizationPlan
* ClusterId
* ClusterName
* ClusterType
* ClusterK8sVersion
* Mode
* IsProduction
* CurrentStatus
Not implemented yet: filtering from last deployed date or created date
> Parallel Run number
---------------------
The option "--parallel-run" (-n) specifies the number of parallel cluster deployments to be launched (default = 5)
The deployments are launched locally on the workstation, not on a server-side thread.
* if the value is > 20 the cluster autoscaler should be updated manually (the command displays a message and requires an approval to be launched)
* the maximum value cannot exceed 100
> Execution Mode
----------------
The option "--execution-mode" specifies which mode is applied on execution:
* "--execution-mode=batch" (default): deployments are triggered sequentially by batch of N parallel-runs. The next batch of deployments will be launched only after all previous batch deployments
* "--execution-mode=on-the-fly": deployments are triggered as soon as there is a slot available in a thread pool of N parallel-runs
> New K8S Version
-----------------
The option "--new-k8s-version" specifies the next kubernetes version to be applied.
When using this option, the recommendation is to have a low parallel runs number and an execution mode on batch, to be able to monitor clusters peacefully.
> Refresh Delay
---------------
The option "--refresh-delay" specifies the amount of time to wait before fetching new cluster statuses during the deployments.
> Disable Dry Run
-----------------
This option "--disable-dry-run" is mandatory to trigger the deployments
> Examples
----------
* Upgrade cluster having id "80981324-b6u7-400b-97fc-e2173d46a00e" to kube version "1.28" with refreshing statuses locally every "100" seconds
"qovery admin cluster deploy -f ClusterId=80981324-b6u7-400b-97fc-e2173d46a00e --new-k8s-version=1.28 --refresh-delay=100 --disable-dry-run"
* Upgrade by batch of "8" parallel runs every "1.27" Kubernetes "Production" clusters on "AWS" to kubernetes version "1.28" with refreshing statuses locally every "100" seconds
"qovery admin cluster deploy -f IsProduction=true --parallel-run=8 --refresh-delay=100 -f ClusterK8sVersion=1.27 --new-k8s-version=1.28 -f ClusterType=AWS" --disable-dry-run
* Redeploy by batch of "9" parallel runs every "1.27" Kubernetes clusters on "GCP" that have the last deployment status to "DEPLOYMENT_ERROR"
"qovery admin cluster deploy -f ClusterType=GCP --parallel-run=9 -f ClusterK8sVersion=1.27 -f CurrentStatus=DEPLOYMENT_ERROR --disable-dry-run"
`,
Run: func(cmd *cobra.Command, args []string) {
deployClusters()
},
Expand Down
28 changes: 28 additions & 0 deletions cmd/admin_cluster_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@ var (
adminClusterListCmd = &cobra.Command{
Use: "list",
Short: "List clusters by applying any filter",
Long: `This command is used to list clusters information using filters.
The endpoint fetched by the CLI return all clusters except the locked ones.
> Filters
---------
Apply filters using the "--filters" option: filters can be applied to one or more values separated by comma interpreted as logical OR.
The fields usable as filters are the following ones:
* OrganizationId
* OrganizationName
* OrganizationPlan
* ClusterId
* ClusterName
* ClusterType
* ClusterK8sVersion
* Mode
* IsProduction
* CurrentStatus
Not implemented yet: filtering from last deployed date or created date
> Examples
----------
* Display every production cluster on cloud providers AWS and GCP:
qovery admin cluster list -f IsProduction=true -f ClusterType=AWS,GCP
* Display every deployed cluster on organization "FooBar":
qovery admin cluster list -f OrganizationName=FooBar -f CurrentStatus=DEPLOYED
`,
Run: func(cmd *cobra.Command, args []string) {
listClusters()
},
Expand Down

0 comments on commit 46ce563

Please sign in to comment.