chartmuseum / helm-push

Helm plugin to push chart package to ChartMuseum
Apache License 2.0
675 stars 170 forks source link

Support pushing the charts to the specified namespace when enabling multi-tenants #12

Open steven-zou opened 6 years ago

steven-zou commented 6 years ago

With chartmuseum, you can easily enable multiple tenants by setting depth > 0. But you need to helm repo add <name> <URL> to add the specified namespace as a separate helm repo (/:repo/index.yaml).

We have provided a unified single entry point (`/index.yaml') for all the namespaces(merge all the index.yaml into one with namespace prefix added) and then namespace info is required when pushing charts to the specified namespace through the single entry point. e.g.:

helm repo add myrepo https://repo-url/context

##
# The chart will be pushed to https://repo-url/context/library
helm push --namespace=library mychart-0.1.0.tgz myrepo
steven-zou commented 6 years ago

@jdolitsky any comments?

steven-zou commented 6 years ago

@jdolitsky

any comments about this part?

jdolitsky commented 6 years ago

@steven-zou sorry for delay here

I like this idea, but am a little hesitant to add it here.

This will currently break with a multitenant chartmuseum install:

helm repo add myrepo https://repo-url/context

I think that Helm/ChartMuseum need to think on this point, as it seems that pushing to multiple namespaces would be common. I encourage your participation in this discussion, as it seems you have a specific use case you are trying to solve: https://github.com/helm/community/pulls

Will the direct-to-URL option address your use-case? You can get away with not adding the repo altogether:

helm push mychart-0.1.0.tgz https://repo-url/context/library
helm push mychart-0.1.0.tgz https://repo-url/context/other
steven-zou commented 6 years ago

@jdolitsky

Thanks for the comments. Seems the direct-to-URL option can support the same functionality. But in my opinion, it seems to break the original repo flow. Add repo with helm repo add and then refer the repo with its name in the later commands like helm push. direct-to-URL does not need to add repo as a precondition.