harbor/tools/migrate_chart
DQ 4f5c3568bc Add tool for migration chart v2 to oci format
chartmuseum might deprecated in future. This tool is used for migrate the charts

Signed-off-by: DQ <dengq@vmware.com>
2020-11-23 16:45:42 +08:00
..
Dockerfile Add tool for migration chart v2 to oci format 2020-11-23 16:45:42 +08:00
migrate_chart.py Add tool for migration chart v2 to oci format 2020-11-23 16:45:42 +08:00
migrate_chart.sh Add tool for migration chart v2 to oci format 2020-11-23 16:45:42 +08:00
Readme.md Add tool for migration chart v2 to oci format 2020-11-23 16:45:42 +08:00

Chart Migrating Tool

Harbor supports two different ways to storage the chart data.

  1. stored in Harbor registry storage directly via OCI API.
  2. stored in Harbor hosted chartmuseum backend via chartmuseam's API

There is an performance issue in chartmuseam. For example, on my 2 core 8G memory test environment, to get 10000 charts infomation needs about 10s to return, In 50000 charts situation, It will cause a timeout error.

After version 2.0, Harbor becomes to the OCI registry. So It can storage chart content directly without chartmuseum.

This tool used to migrate the legacy helm charts stored in the chartmuseum backend to Harbor OCI registry backend.

On test environment( 2 core 8G memory), using this tool to migrate 10000 charts needs about 2~3 hours

Usages

Compile the chart with command

docker build -t goharbor/migrate-chart:0.1.0 .

Migrate charts run command below:

docker run -it --rm -v {{your_chart_data_location}}:/chart_storage -v {{harbor_ca_cert_location}}:/usr/local/share/ca-certificates/harbor_ca.crt  goharbor/migrate-chart:0.1.0 --hostname {{harbor_hostname}} --password {{harbor_admin_password}}
  • your_chart_data_location: The location of your chart storage chart. By default, it's the chart_storage dir inside Harbor's data_volumn

  • harbor_ca_cert_location: If Harbor enabled HTTPS, you need to add the ca_cert for connecting Harbor

  • harbor_hostname: The hostname of Harbor

  • harbor_admin_password: The password of harbor admin user