-1

I am trying to install some helm charts into custom namespaces on a Microk8s cluster but get the following errors. What am I doing wrong? The cluster is fresh and none of these namespaces or resources exist.

> helm install loki grafana/loki-stack -f values/loki-stack.yaml --namespace loki --create-namespace
W0902 08:08:35.878632 1610435 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
Error: rendered manifests contain a resource that already exists. Unable to continue with install: 
PodSecurityPolicy "loki-grafana" in namespace "" exists and cannot be imported into the current release: 
invalid ownership metadata; annotation validation error: 
key "meta.helm.sh/release-namespace" must equal "loki": current value is "default"

> helm install traefik traefik/traefik -f values/traefik.yml --namespace traefik --create-namespace
Error: rendered manifests contain a resource that already exists. Unable to continue with install: 
ClusterRole "traefik" in namespace "" exists and cannot be imported into the current release: 
invalid ownership metadata; annotation validation error: 
key "meta.helm.sh/release-namespace" must equal "traefik": current value is "default"
Johan Book
  • 153
  • 1
  • 3
  • 10

1 Answers1

1

The resource (loki) to be deployed already exists in the specified namespace.

Please check with helm list -n loki.

So before you install it, you need to uninstall it first.

  1. helm uninstall loki -n loki
  2. helm install loki grafana/loki-stack -f values/loki-stack.yaml --namespace loki

Or you can try to update it directly:

helm upgrade loki grafana/loki-stack -f values/loki-stack.yaml --namespace loki

z.x
  • 1,905
  • 7
  • 11
  • I checked `helm list -n loki`, there are no resources there. I tried uninstalling it but it fails as it was not installed – Johan Book Sep 08 '21 at 17:15