A library to create a container image repository archive for airgap installations of a Helm Chart
Helmgap allows you to deploy a Helm Chart into airgap environments by generating a container image registry archive for a given chart. Under the hood it wraps a combination of Helm and kbld (k14s) to firstly generate the manifest with images and then derive the chart images.
The end product is a tar file containing all the images required by the chart which can be read using docker load registry.tar
or crd import registry.tar
You will need
brew install helm
)brew tap k14s/tap && brew install kbld
)<dependency>
<groupId>uk.co.solong</groupId>
<artifactId>helmgap</artifactId>
<version>1.7</version>
</dependency>
ChartDescriptor chartDescriptor = ChartDescriptor.byShortName("bitnami", "redis", "6.0.0");
HelmGap helmgap = new HelmGap();
AirgapInstall result = helmgap.buildAirgap(chartDescriptor);
File imageArchive = result.getAirgapInstallerArchive(); //the airgap registry you requested.
File lockFile = result.getLockFile(); //the associated lockfile requried for loading.
The above imageArchive
file is
redis-airgap-6.0.0.tgz
- the container images required by the helm chart, in KBLD image format.You can also get a copy of the helm chart (useful!).
File chart = files.getOriginalChart(); //the original chart
The above chart file is
redis-6.0.0.tgz
- the original helm chart.That's it!
There are 3 different chart descriptors supported which cover all valid helm pull
syntax:
helm repo add
)ChartDescriptor chartDescriptor = ChartDescriptor.byShortName("stable", "hackmd", "0.1.0");
ChartDescriptor chartDescriptor = ChartDescriptor.byRepoUrl("https://charts.bitnami.com/bitnami", "hackmd", "0.1.0");
ChartDescriptor chartDescriptor = ChartDescriptor.byChartUrl("http://storage.googleapis.com/kubernetes-charts/dask-1.1.0.tgz");
new HelmGap("/path/to/helm", "/path/to/kbld")