emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.36k stars 683 forks source link

Helm chart should be installable in two different namespaces with the same release name #3380

Open acookin opened 3 years ago

acookin commented 3 years ago

If you have an ambassador installed with helm in a namespace:

helm status -n one  ambassador
NAME: ambassador
LAST DEPLOYED: Mon May  3 12:35:58 2021
NAMESPACE: one
STATUS: deployed

Then you try to install the chart with the same release name in a different namespace:

helm install --set scope.singleNamespace=true ambassador -n two datawire/ambassador

The cluster-wide resources conflict with each other, and you get this error:

Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "ambassador-agent" 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 "two": current value is "one"

The chart should have a value that templates out the cluster wide resources so that we can enable this behavior.

hendrikhalkow commented 3 years ago

Thanks for bringing this up, @acookin. I'd go even one step further and say that in single namespace mode, Ambassador must not create any non-namespaced objects like ClusterRole or ClusterRoleBinding. Instead, Role and RoleBinding should be used. This would automatically solve the naming conflict issue.

zencircle commented 1 year ago

In my case it was disabling agent and ingcressClass in values.yaml that fixed the problem

ingressClassResource:
  enabled: false

agent:
  enabled: false