Missing key "meta.helm.sh/release-namespace": must be set

When I do

$ kubectl create namespace percona
$ helm install psmdb-operator percona/psmdb-operator --version 1.11.0 -f values.yaml --namespace percona

I get

Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: Namespace "percona" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "psmdb-operator"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "percona"

This is my values.yaml:

replicaCount: 3
image:
  repository: percona/percona-server-mongodb-operator
  tag: 1.11.0
  pullPolicy: IfNotPresent
watchNamespace: "percona"
createCRD: true

What am I missing here? I think the helm charts might be a bit buggy.

1 Like

Ok, for me the solution was that the key watchNamespace is not working at all. Please confirm that this key will break helm deployment in a reproduction.

1 Like

@devops-1 this flag was added there by mistake. Our MongoDB Operator does not support cluster-wide deployment yet and can only “watch” one namespace (so Operator per namespace).
We are going to remove it.

Thank you for bringing this up.

1 Like