Skip to content

Conversation

@gianlucam76
Copy link
Member

This PR introduces the components field to the ClusterProfile's KustomizationRef section, allowing users to include reusable Kustomize components in their deployments.

The components field is a list of relative paths to Kustomize component directories. Sveltos will now read the existing kustomization.yaml file at the specified path, add the paths from the components field, and then run a Kustomize build on the complete configuration. Finally, Sveltos applies the resulting manifest to the cluster.

Example usage:

apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
  name: component-demo
spec:
  clusterSelector:
    matchLabels:
      env: fv
  syncMode: Continuous
  kustomizationRefs:
  - namespace: flux-system
    name: flux-system
    kind: GitRepository
    path: ./import_components/overlays/community/
    targetNamespace: eng
    components:
    - ../../components/external_db
    - ../../components/recaptcha

This PR introduces the `components` field to the ClusterProfile's
`KustomizationRef` section, allowing users to include reusable
Kustomize components in their deployments.

The `components` field is a list of relative paths to Kustomize
component directories. Sveltos will now read the existing kustomization.yaml
file at the specified path, add the paths from the components field,
and then run a Kustomize build on the complete configuration.
Finally, Sveltos applies the resulting manifest to the cluster.

Example usage:

```yaml
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
  name: component-demo
spec:
  clusterSelector:
    matchLabels:
      env: fv
  syncMode: Continuous
  kustomizationRefs:
  - namespace: flux-system
    name: flux-system
    kind: GitRepository
    path: ./import_components/overlays/community/
    targetNamespace: eng
    components:
    - ../../components/external_db
    - ../../components/recaptcha
```
@gianlucam76 gianlucam76 merged commit cb36cba into projectsveltos:main Sep 9, 2025
8 checks passed
@gianlucam76 gianlucam76 deleted the components branch September 9, 2025 11:33
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