Skip to content

Commit

Permalink
Fix platform example in README and add examples for the new flags to …
Browse files Browse the repository at this point in the history
…skip images in some commands
  • Loading branch information
mpermar committed Aug 26, 2024
1 parent 4952969 commit 6d0d6cb
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Distribute your Helm charts with two easy commands

```console
# Wrap
# Wrap
$ helm dt wrap oci://docker.io/bitnamicharts/kibana
...
🎉 Helm chart wrapped into "/Users/martinpe/workspace/kibana/kibana-10.4.8.wrap.tgz"
Expand Down Expand Up @@ -36,7 +36,7 @@ $ helm plugin install https://github.com/vmware-labs/distribution-tooling-for-he

> **Note:** Windows installation
>
> If installing on Windows, the above command must be run in a bash emulator such as Git Bash.
> If installing on Windows, the above command must be run in a bash emulator such as Git Bash.
### Downloading and using standalone

Expand Down Expand Up @@ -67,7 +67,7 @@ For the sake of following this guide, let's pull one of the Bitnami Helm charts
```console
$ git clone [email protected]:vmware-labs/distribution-tooling-for-helm.git
$ cd distribution-tooling-for-helm
$ bash -c "mkdir examples & helm pull oci://docker.io/bitnamicharts/mariadb -d examples --untar"
$ bash -c "mkdir examples & helm pull oci://docker.io/bitnamicharts/mariadb -d examples --untar"
```

The two simplest and most powerful commands on this tool are `wrap` and `unwrap`. With these two commands **you can relocate any Helm chart to any OCI registry in two steps**.
Expand Down Expand Up @@ -135,6 +135,19 @@ kibana-10.4.8/artifacts/images/kibana/kibana/8.10.4-debian-11-r0.metadata.sig
>
> Chart signatures are not bundled as they would be invalidated at chart unwrap because of the relocation. All the container images wrapped will maintain their signatures and metadata.
#### Light wraps

Sometimes you might actually want to wrap your Helm charts without fetching the container images. This is not exactly a wrap from the point of view of the initial conception of this tool but we acknowledge that this case can be useful when you already know that the Helm charts exist in the target registry. Hence you can skip wrapping the container images by using the `--skip-pull-images` flag:

```console
$ helm dt wrap oci://docker.io/bitnamicharts/magento --skip-pull-images
» Wrapping Helm chart "oci://docker.io/bitnamicharts/magento"
✔ Helm chart downloaded to "/var/folders/cr/jn5532p51390yx_6ctd7c6_40000gn/T/chart-2437949055/chart-1972871498/magento"
✔ Images.lock file written to "/var/folders/cr/jn5532p51390yx_6ctd7c6_40000gn/T/chart-2437949055/wrap/chart/Images.lock"
✔ Compressed into "/Users/martinpe/workspace/distribution-tooling-for-helm/magento-28.0.4.wrap.tgz"

🎉 Helm chart wrapped into "/Users/martinpe/workspace/distribution-tooling-for-helm/magento-28.0.4.wrap.tgz"
```

### Unwrapping Helm charts

Expand Down Expand Up @@ -250,7 +263,7 @@ $ helm dt images lock ../charts/jenkins --annotations-key artifacthub.io/images
The above `lock` command can be constrained to specific architectures. This is pretty useful to create lighter wraps as many of the images will be dropped when wrapping.

```console
$ helm dt images lock ../charts/jenkins --platform linux/amd64
$ helm dt images lock ../charts/jenkins --platforms linux/amd64
```

If we now look at generated `Images.lock` we will notice that it contains only `linux/amd64` digests:
Expand Down Expand Up @@ -343,6 +356,8 @@ images:
image: acme.com/federal/bitnami/os-shell:11-debian-11-r22
```

Note that in some scenarios one might actually not be interested in relocating the images. Perhaps one is only interested in pushing the Helm chart to a different registry but retaining the images. For such scenarios the `--skip-relocation` flag can be used when unwrapping the chart.

### Pushing images

Based on the `Images.lock` file, this command pushes all images (that must have been previously pulled into the `images/` folder) into their respective registries. Note that this command does not relocate anything. It will simply try to push the images to wherever they are pointing.
Expand Down Expand Up @@ -448,7 +463,7 @@ INFO[0000] Helm chart annotated successfully

### Converting a Helm chart into a Carvel bundle (EXPERIMENTAL)

From `dt` v0.2.0 we have introduced a new command to create a [Carvel bundle](https://carvel.dev/imgpkg/docs/v0.37.x/resources/#bundle) from any Helm chart.
From `dt` v0.2.0 we have introduced a new command to create a [Carvel bundle](https://carvel.dev/imgpkg/docs/v0.37.x/resources/#bundle) from any Helm chart.


```console
Expand Down

0 comments on commit 6d0d6cb

Please sign in to comment.