Skip to content

Conversation

@gianlucam76
Copy link
Member

@gianlucam76 gianlucam76 commented Dec 12, 2025

This commit introduces the sveltosctl redeploy cluster command, allowing users to
forcefully trigger the re-application of all Sveltos-managed add-ons and resources
on a specified cluster.

Mechanism and Implementation Details

The command operates by resetting the cluster's internal reconciliation status.
This is done in a dependency-aware manner:

  1. A dependency graph is built based on the ClusterSummary resources,
    which link profiles and add-ons to their prerequisites (using dependsOn field).
  2. This graph is then traversed in dependency order (e.g., using a topological sort).

The reconciliation status is reset starting with resources that have no dependencies,
ensuring that dependent resources are reset only after their prerequisites have been addressed.

Command Usage

Usage:
  sveltosctl redeploy cluster [options] --namespace=<name> --cluster=<name> --cluster-type=<type> [--verbose]

     --namespace=<name>     Specifies the namespace where the Cluster resource is located.
     --cluster=<name>       Defines the name of the target cluster to force redeployment on.
     --cluster-type=<type>  Specifies the type of cluster. Accepted values are 'Capi' and 'Sveltos'.

Options:
  -h --help                Show this screen.
     --verbose             Verbose mode. Print each step.

Description:
  The 'sveltosctl redeploy cluster' command forces Sveltos to re-apply all
  configured add-ons and resources for the specified cluster. This is achieved by
  resetting the cluster's internal reconciliation status, compelling the Addon Controller
  to immediately re-process all associated ClusterProfile/Profile configurations.

  Use this command to trigger a rolling update or configuration re-application
  without making any changes to the ClusterProfile/Profile Spec.

This commit introduces the `sveltosctl redeploy cluster` command, allowing users to
forcefully trigger the re-application of all Sveltos-managed add-ons and resources
on a specified cluster.

The command operates by resetting the cluster's internal reconciliation status.
This is done in a dependency-aware manner:

1. A dependency graph is built based on the ClusterSummary resources,
which link profiles and add-ons to their prerequisites (using `dependsOn` field).
2. This graph is then traversed in dependency order (e.g., using a topological sort).

The reconciliation status is reset starting with resources that have no dependencies,
ensuring that dependent resources are reset only after their prerequisites have been addressed.

```./bin/sveltosctl redeploy cluster --help
Usage:
  sveltosctl redeploy cluster [options] --namespace=<name> --cluster=<name> --cluster-type=<type> [--verbose]

     --namespace=<name>     Specifies the namespace where the Cluster resource is located.
     --cluster=<name>       Defines the name of the target cluster to force redeployment on.
     --cluster-type=<type>  Specifies the type of cluster. Accepted values are 'Capi' and 'Sveltos'.

Options:
  -h --help                Show this screen.
     --verbose             Verbose mode. Print each step.

Description:
  The 'sveltosctl redeploy cluster' command forces Sveltos to re-apply all
  configured add-ons and resources for the specified cluster. This is achieved by
  resetting the cluster's internal reconciliation status, compelling the Addon Controller
  to immediately re-process all associated ClusterProfile/Profile configurations.

  Use this command to trigger a rolling update or configuration re-application
  without making any changes to the ClusterProfile/Profile Spec.
```
@gianlucam76 gianlucam76 merged commit 6184c22 into projectsveltos:main Dec 12, 2025
4 checks passed
@gianlucam76 gianlucam76 deleted the force-redeploy branch December 12, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant