diff --git a/vcluster_versioned_docs/version-0.34.0/third-party-integrations/git-operations/flux.mdx b/vcluster_versioned_docs/version-0.34.0/third-party-integrations/git-operations/flux.mdx index bea55717a..5855f3aca 100644 --- a/vcluster_versioned_docs/version-0.34.0/third-party-integrations/git-operations/flux.mdx +++ b/vcluster_versioned_docs/version-0.34.0/third-party-integrations/git-operations/flux.mdx @@ -680,3 +680,31 @@ kubectl get secret -n -o jsonpath= ```yaml title="Recommended server URL format" server: https://vcluster-name.vcluster-namespace.svc.cluster.local:443 ``` + +#### Snapshots fail when HelmRelease is in a different namespace {#snapshot-namespace-mismatch} + +When you deploy a tenant cluster through a `HelmRelease` resource that lives in a different namespace than the tenant cluster itself (for example, `HelmRelease` in `flux-system` and the tenant cluster in `mytestcluster`), Flux stores the Helm release secret in the `HelmRelease` namespace. The snapshot controller searches for the Helm release secret in the tenant cluster's namespace and fails to find it, which causes snapshots to fail. + +To fix this, set `spec.storageNamespace` in the `HelmRelease` to the tenant cluster's namespace: + +```yaml title="Set storageNamespace to match the tenant cluster namespace" {7} +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: my-vcluster + namespace: flux-system +spec: + storageNamespace: mytestcluster # Must match the tenant cluster namespace + targetNamespace: mytestcluster + interval: 10m + chart: + spec: + chart: vcluster + version: "0.26.x" + sourceRef: + kind: HelmRepository + name: vcluster + namespace: flux-system +``` + +With `storageNamespace` set, Flux stores the `helm.sh/release.v1` secret in `mytestcluster`, where the snapshot controller can find it.