Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to clean/delete some older packages in helm repo?

We've setup an AWS s3 storage as Helm repo.

But with development going on, more and more package files are uploade to the S3.

We want to cleanup/delete older files in S3, of course, I know we can't directly delete them from S3 as there're some mapping info stored in index.yaml.

I check the helm help, got few information about this. Is there any formal way to delete older helm packages?

like image 530
user10814765 Avatar asked Dec 26 '18 02:12

user10814765


People also ask

How do you clean a helm?

If you need to uninstall the deployed release, run the delete command on the Helm command line. The command removes all the Kubernetes components that are associated with the chart and deletes the release.

Does helm uninstall remove pods?

Doing helm uninstall ... won't just remove the pod, but it will remove all the resources created by helm when it installed the chart.


2 Answers

as mentioned in https://chartmuseum.com/docs/#helm-chart-repository

you can use Helm Museum api to do that

e.g.

# curl -XDELETE http://helm.chartrepo.url/api/charts/chart-name/version

please pay attention to the versions, you have to delete it one version per curl hit, means if you have 2 version and want to delete all the version you have to do it per version

# curl -XDELETE http://helm.chartrepo.url/api/charts/chart-name/1.0.1
# curl -XDELETE http://helm.chartrepo.url/api/charts/chart-name/1.0.2

ps: you can search your apps versions by hit

# curl http://helm.chartrepo.url/index.yaml
like image 59
HQM Avatar answered Oct 06 '22 11:10

HQM


I would recommend you to use the helm-s3 plugin and follow one of the two approaches for keeping your Helm S3 repo clean and up to date:

1 ) use helm s3 delete to delete specific chart version from the repository:

$ helm s3 delete <some-chart> --version X.Y.Z <repo-name>

Notice that both the remote and local repo indexes will be updated automatically.

2 ) Delete the old chart files (.tgz) directly with the S3 API and then run:

$ helm s3 reindex <repo-name>

It will recreate the index in accordance with the charts in the repository.

like image 33
RtmY Avatar answered Oct 06 '22 11:10

RtmY