Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
This repository was 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

Description

@immanuelfodor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions