DEV Community

Cover image for A dynamic approach to Kubernetes add-on and application management
Gianluca
Gianluca

Posted on

A dynamic approach to Kubernetes add-on and application management

As the demand for scalable and efficient Kubernetes infrastructure continues to grow, so does the need for automated solutions to manage clusters. ClusterAPI has emerged as a powerful solution for programmatically creating, upgrading, and deleting clusters on demand.

One of the key challenges in managing Kubernetes clusters is the installation and upgrading of cluster add-ons and applications. This can be a time-consuming and complex process, especially for organizations that manage a large number of clusters. Existing solutions for automating cluster add-ons often require a significant degree of user interaction.

Add-on and application management

Projectsveltos is a set of Kubernetes controllers that takes a more intelligent approach to cluster add-on management.

It is able to automatically identify clusters, comprehend their current state, and install and upgrade add-ons with minimal user interaction. It offers support for Helm charts, raw YAMLs, and Kustomize or any combination of those.

Sveltos: Kubernetes add-on deployment

Orderly deploying Kubernetes add-ons with Projectsveltos

Templates

Add-ons and applications can be expressed as templates. At deployment time, Projectsveltos will instantiate the templates, using information gathered by fetching resources from the management cluster or the managed clusters. This allows to customize the deployment of add-ons and applications based on the specific needs of each cluster. For example, deploy an add-on with different configuration options depending on the cluster.

Expressing add-ons as templates

Projectsveltos templates can also be used to coordinate with other open source projects. For example, Projectsveltos can coordinate with Crossplane to create a Google Cloud Storage bucket for each managed cluster and then deploy an application in each managed cluster that uploads a file to the proper bucket.

Sveltos, ClusterAPI and Crossplane

Or with External Secret Operator:

Sveltos and External Secret Operator

Resource Deployment Order

Sveltos allows to specify the order in which Kubernetes resources are deployed.

Add-on deployment order

Deploy add-ons based on cluster runtime state

Projectsveltos can be instructed to classify clusters based on their run-time state and update deployed add-ons and application as run-time state changes.

In this example, when a cluster is upgraded, Projectsveltos automatically upgrades add-ons and applications deployed in such cluster.

Cluster classification based on run-time state

Conclusion

Projectsveltos is a powerful and flexible tool for managing Kubernetes cluster add-ons and applications:

  1. Reduced time and effort: Projectsveltos automates the installation and upgrading of cluster add-ons, freeing up IT staff to focus on other tasks.

  2. Improved consistency: Projectsveltos ensures that add-ons are installed and upgraded consistently across all clusters.

  3. Reduced risk: Projectsveltos reduces the risk of errors during the installation and upgrading process.

  4. Increased agility: Projectsveltos makes it easier to deploy and manage new add-ons, and to keep existing add-ons up to date.

If you enjoyed this article, please check out the Sveltos GitHub repo.

The GitHub repo is a great resource for getting started with Sveltos. It contains the code, documentation, and examples. You can also find the latest news and updates on the project on the GitHub repo.

If you have any feedback, bugs, or PRs, please feel free to contribute to the project. Your contributions will help make Sveltos even better.

Top comments (2)

Collapse
 
boubou81 profile image
Alexandre

Does it replace tool like argo/flux CD or it complementary?

I tried to understand from the article.
Maybe I should test it to better understand itπŸ˜….

Collapse
 
gianlucam76 profile image
Gianluca • Edited

Thanks Alexandre.

It is not meant to replace flux fully. I would still use Flux (so gitops approach) to push configuration to the management cluster. Once it gets to the management cluster, Sveltos can take care of pushing to the managed clusters.

The main difference for doing so is that Sveltos is more dynamic. It is more flexible because it can instantiate add-on and application templates at deployment time using resources present in the management cluster. This allows Sveltos to coordinate with other open source projects, such as Crossplane.

Here is an example of how Sveltos can be used to dynamically deploy a Pod that uploads a file to a Google Storage Bucket in each production cluster:

Provide a template to Sveltos that contains a Crossplane Bucket instance and a Pod instance (both expressed as templates).

Tell Sveltos to discover all production clusters.

For each production cluster, Sveltos will instantiate the Crossplane Bucket instance using cluster name for instance to create a unique per cluster bucket.

Once the Crossplane Bucket instance is created, and Crossplane is done creating the Google Bucket, Sveltos will fetch the bucket URL and ID from the Crossplane Bucket instance status section.

Sveltos will then instantiate the Pod template and deploy it to the managed cluster, using the bucket URL and ID from the Crossplane Bucket instance.

This approach allows you to dynamically deploy Pods to managed clusters, with the configuration of each Pod being customized based on the specific needs of the cluster at deployment time.

In other words, Sveltos can be used to implement a dynamic GitOps approach to deploying add-ons and applications to Kubernetes clusters.