0

I am trying to install two traefik. Each will be in its own namespace. Each traefik will use label selection. Below is the values override I use for each when I run helm install.

rbac:
  enabled: true

# Enable prometheus
additionalArguments:
  - "--metrics.prometheus=true"

# Options for the main traefik service, where the entrypoints traffic comes
# from.
service:
  enabled: true
  type: ClusterIP

kubernetes:
  namespaces: "{{NAMESPACE}}"

providers:
  kubernetesCRD:
    labelSelector: wsLabel={{NAMESPACE}}
  kubernetesIngress:
    labelSelector: wsLabel={{NAMESPACE}}

First traefik installs fine. When I attempt the second traefik, I get the following.

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 "namespace2": current value is "namespace1"

I am using:

chartVersion: 10.19.4
appVersion: 2.6.3

How can I use HELM to install multiple Traefik that use label selection?

Greg
  • 1
  • Use helm dry-run capabilities to insoect the output of the chart. It seems you are wrongly expanding the namesapce value here. As the passed namespace results in an empty string: "" – matteo nunziati Apr 23 '22 at 14:09

1 Answers1

0

error message is clear that there's a clusterrole named traefik already. just do a kubectl get clusterrole, it will list you an already installed traefik clusterrole.

All you have to do is update your helm to add the new custom clusterrole value in values.yaml and then run helm install with new clusterrole name. done