Local Playground
What is Sveltos?
Sveltos is a set of Kubernetes controllers deployed in the management cluster. From the management cluster, it can manage add-ons and applications to multiple clusters.
Deploy Kubernetes Add-ons
The main goal of Sveltos is to deploy add-ons in managed Kubernetes clusters. So let's see that in action.
If you want to try the projectsveltos with a test cluster, follow the steps below:
The above will create a management cluster using Kind, deploy clusterAPI and projectsveltos, create a workload cluster powered by clusterAPI using Docker as infrastructure provider.
Note
The Sveltos Dashboard is an optional component of Sveltos. To include it in the deployment, follow the instructions found in the dashboard section.
v0.38.4 is the first Sveltos release that includes the dashboard and it is compatible with Kubernetes v1.28.0 and higher.
Deploy Helm Charts
To deploy the Kyverno Helm chart in any Kubernetes cluster with labels env: fv create this ClusterProfile instance in the management cluster:
Example - Helm Chart
cat > clusterprofile_kyverno.yaml <<EOF
---
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
name: deploy-kyverno
spec:
clusterSelector:
matchLabels:
env: fv
syncMode: Continuous
helmCharts:
- repositoryURL: https://kyverno.github.io/kyverno/
repositoryName: kyverno
chartName: kyverno/kyverno
chartVersion: v3.3.3
releaseName: kyverno-latest
releaseNamespace: kyverno
helmChartAction: Install
EOF
Deploy Raw YAMl/JSON
Download this file
which contains:
- Namespace projectcontour to run the Gateway provisioner
- Contour CRDs
- Gateway API CRDs
- Gateway provisioner RBAC resources
- Gateway provisioner Deployment
and create a Secret in the management cluster containing the contents of the downloaded file:
$ kubectl create secret generic contour-gateway-provisioner-secret \
--from-file=contour-gateway-provisioner.yaml \
--type=addons.projectsveltos.io/cluster-profile
To deploy all these resources in any cluster with labels env: fv, create a ClusterProfile instance in the management cluster referencing the Secret created above:
Example - Raw Yaml/Json
cat > clusterprofile_gateway.yaml <<EOF
---
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
name: gateway-configuration
spec:
clusterSelector:
matchLabels:
env: fv
syncMode: Continuous
policyRefs:
- name: contour-gateway-provisioner-secret
namespace: default
kind: Secret
EOF
Deploy Resources Assembled with Kustomize
Sveltos can work along with Flux to deploy content of Kustomize directories.
Example - Kustomize
cat > clusterprofile_flux.yaml <<EOF
---
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
name: flux-system
spec:
clusterSelector:
matchLabels:
env: fv
syncMode: Continuous
kustomizationRefs:
- namespace: flux-system
name: flux-system
kind: GitRepository
path: ./helloWorld/
targetNamespace: eng
EOF
Full examples can be found here.
ClusterProfile can reference:
- GitRepository (synced with flux);
- OCIRepository (synced with flux);
- Bucket (synced with flux);
- ConfigMap whose BinaryData section contains kustomize.tar.gz entry with tar.gz of kustomize directory;
- Secret (type addons.projectsveltos.io/cluster-profile) whose Data section contains kustomize.tar.gz entry with tar.gz of kustomize directory;
Carvel ytt and Jsonnet
Sveltos offers support for Carvel ytt and Jsonnet as tools to define add-ons that can be deployed in a managed cluster. For additional information, please consult the Carvel ytt and Jsonnet sections.