Skip to content

Add ability to patch resources deployed by shard-controller #210

@gianlucam76

Description

@gianlucam76

Is your feature request related to a problem? Please describe.
Sveltos has ability to horizontally scale. Documentation https://projectsveltos.io/main/scalability/horizontal_scaling_sharding/

When a new cluster shard is added, shard-controller deploys new resources to handle the new shard:

func deployControllers(ctx context.Context, c client.Client, shardKey string, //nolint: funlen // deploying sveltos controllers

There is currently no way to patch what the shard-controller deploys. Sometimes it is needed to patch those resources (by for instance adding imagePullSecrets or changing resources).

Describe the solution you'd like
Sveltos already supports a patching mechanism for other resources deployed by Sveltos when new clusters are added.
For instance for every new detected cluster Sveltos deploys a sveltos-agent deployment and a drift-detection-manager. Sveltos supports user patching: https://projectsveltos.io/main/getting_started/install/air_gapped_installation/

For instance, classifier when deploying the svetlos-agent component gets the patches (stored in a ConfigMap) and patches the default YAML before deploying it https://github.com/projectsveltos/classifier/blob/eef139ffa2cb6d5a70e2e388f85d1494eb962733/controllers/classifier_deployer.go#L1571

Likewise, addon-controller when deploying the drift-detection-manager component gets the user defined patches(stored in a ConfigMap) and patches the default YAML before deploying it
https://github.com/projectsveltos/addon-controller/blob/f59296975bc194fd7249254bac9ef1d3cd5860b3/controllers/resourcesummary.go#L83

Add a similar approach for shard-controller. Read user defined patches from a ConfigMap and patch the resources before deploying them,

Describe alternatives you've considered
Manually patching the resources after the shard-controller creates them

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions