Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat): ClusterProfile HelmCharts can be expressed as a template #800

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gianlucam76
Copy link
Member

For instance

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:     |-
      {{$version := index .Cluster.metadata.labels "k8s-version" }}{{if eq $version "v1.29.0"}}v3.2.5
      {{else}}v3.2.6
      {{end}}
    releaseName:      kyverno-latest
    releaseNamespace: kyverno
    helmChartAction:  Install

Sveltos will fetch Cluster and use it to instantiate this template before deploying it.

Issue: if Cluster.Labels changes, Sveltos won't redeploy as hash is not changing.

Fixes #794

For instance

```yaml
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:     |-
      {{$version := index .Cluster.metadata.labels "k8s-version" }}{{if eq $version "v1.29.0"}}v3.2.5
      {{else}}v3.2.6
      {{end}}
    releaseName:      kyverno-latest
    releaseNamespace: kyverno
    helmChartAction:  Install
```

Sveltos will fetch Cluster and use it to instantiate this template before deploying it.

Issue: if Cluster.Labels changes, Sveltos won't redeploy as hash is not changing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO_NOT_MERGE Do not merge PR yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template-Based Helm Chart Versioning in ClusterProfile Using Labels
1 participant