Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Allow installing 2 or more agents to the same cluster under different namespaces #78

Open
immanuelfodor opened this issue Mar 14, 2023 · 0 comments
Labels
kind/enhancement a new or improved feature.

Comments

@immanuelfodor
Copy link

I tried to install 2 agents with the helm command Hub provided by changing the namespaces:

helm upgrade --install hub-agent traefik/hub-agent \
    --set token="XXXXX" --namespace hub-agent ...

helm upgrade --install hub-agent traefik/hub-agent \
    --set token="YYYYY" --namespace hub-agent-test ...

Installation fails because the ClusterRole it tries to create already exists:

Release "hub-agent" does not exist. Installing it now.
Error: rendered manifests contain a resource that already exists. Unable to continue with install: 
ClusterRole "hub-agent-auth-server" 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 "hub-agent-test": current value is "hub-agent"

It also doesn't help if I change the release name, it causes more validation errors:

helm upgrade --install hub-agent-test traefik/hub-agent \
    --set token="YYYYYY" --namespace hub-agent-test ...
Release "hub-agent-test" does not exist. Installing it now.
Error: rendered manifests contain a resource that already exists. Unable to continue with install: 
ClusterRole "hub-agent-auth-server" in namespace "" exists and cannot be imported into the current 
release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must 
equal "hub-agent-test": current value is "hub-agent"; annotation validation error: key 
"meta.helm.sh/release-namespace" must equal "hub-agent-test": current value is "hub-agent"

Probably, if a ClusterRole exists with the same name, helm shouldn't create it, just the corresponding ClusterRoleBinding (as the ServiceAccount will be in a separate namespace) but that's just a rough idea.

@mloiseleur mloiseleur added the kind/enhancement a new or improved feature. label Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement a new or improved feature.
Projects
None yet
Development

No branches or pull requests

2 participants