helm / chartmuseum

helm chart repository server

Home Page:https://chartmuseum.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reload list of charts from persistence layer (disk, s3, etc)

migueleliasweb opened this issue · comments

Hi all,

Is there a way to reload the list of available charts from disk without restarting the pod?

Possibly related to: #562

Hi @migueleliasweb , we open #562 mainly for the replica deployment , if you deploy in the single instance , you should not restart the storage backend , we have the ticker to load your charts into the cache .

Hi @scbizu , thanks for que swift reply!

So, just to clarify. Are you saying that if I manually add a chart to the persistence layer (let's say a mount using the local option) I shouldn't need to restart the chartmuseum pod to pick the new chart?

@migueleliasweb Yes , if you just have a single instance of chartmuseum.

Interesting!

I am running with 2 instances using the local storage option and that might be causing some weird things to happen.

I will test with a single instance! Thanks!

Till now , we do not fully support the multi-instance setup , which you said would see some weird things happen .

If you want to setup the multi-instance or the replica , as I mentioned in the #148 (comment) , you should need redis(cluster)'s help .

@scbizu , after a few changes on my setup of Chartmuseum I think I have a somewhat stable installation.

As I really wanted to have a "stateless" chartmuseum install, I used ConfigMap mounts with the tgz charts packaged from helm. I've added a sidecar with the k8s-sidecar container. It basically generates files in disk based on ConfigMaps with specific labels in the cluster.

With this setup, each ChartMuseum pod has their own "storage". Nothing is really shared betweem the pods. This should facilitate the deployment with multiple replicas. At least in theory.

All is working just fine but sometimes I still need to reload the container for it to pick up new changes (new ConfigMaps added or changed). If I delete the pod, the new charts show up nicely.

I've found this code:

But, for some reason, althought it seems to be enabled by default (5m intervals), it doesn't seem to be pickig up the changes.

Any ideas?

Ping @scbizu (sorry to bother).

For the moment, the workaround I've found is to add a post hook that issues a rollout restart so the new pods get the new files from disk.

@migueleliasweb Sorry for late response , back from China Lunar New Year holiday XD.

You can set the --keep-chart-always-up-to-date to see if it gets better . BTW , you should use our HEAD(ghcr.io/helm/chartmuseum:canary) to enable this option .

See 3ae6ed2

I will check this out this week. 👌