Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
Last active February 3, 2019 04:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdolitsky/99c7364a892c8e350c85314705a9a7c1 to your computer and use it in GitHub Desktop.
Save jdolitsky/99c7364a892c8e350c85314705a9a7c1 to your computer and use it in GitHub Desktop.
Current progress of Helm 3 changes related to working with registries

Helm 3 chart command

Note: this is a work in progress, and is subject to change soon.

Chart Subcommands

save

save a chart directory

$ helm chart save mychart/ localhost:5000/myrepo/mychart:latest
Saving localhost:5000/myrepo/mychart:latest

list

list all saved charts

$ helm chart list
REF                                                     NAME                    VERSION DIGEST  SIZE            CREATED
localhost:5000/myrepo/mychart:latest                    mychart                 2.7.1   84059d7 454 B           27 seconds
localhost:5000/stable/acs-engine-autoscaler:latest      acs-engine-autoscaler   2.2.2   d8d6762 4.3 KiB         2 hours
localhost:5000/stable/aerospike:latest                  aerospike               0.2.1   4aff638 3.7 KiB         2 hours
localhost:5000/stable/airflow:latest                    airflow                 0.13.0  c46cc43 28.1 KiB        2 hours
localhost:5000/stable/anchore-engine:latest             anchore-engine          0.10.0  3f3dcd7 34.3 KiB        2 hours
...

export

export a chart to directory

$ helm chart export localhost:5000/myrepo/mychart:latest
Exported to mychart/

push

push a chart to remote

$ helm chart push localhost:5000/myrepo/mychart:latest
Pushing localhost:5000/myrepo/mychart:latest

pull

pull a chart from remote

$ helm chart pull localhost:5000/stable/wordpress:latest
Pulling localhost:5000/stable/wordpress:latest

remove

$ helm chart remove localhost:5000/myrepo/mychart:latest
Deleting localhost:5000/myrepo/mychart:latest

Chart Manifest

This is the manifest of a Helm chart as stored in a registry:

$ curl -s -H 'Accept: application/vnd.oci.image.manifest.v1+json' http://localhost:5000/v2/myrepo/mychart/manifests/latest | jq
{
  "schemaVersion": 2,
  "config": {
    "mediaType": "application/vnd.oci.image.config.v1+json",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 2
  },
  "layers": [
    {
      "mediaType": "application/vnd.cncf.helm.chart.meta.v1+json",
      "digest": "sha256:c356ec641a696eb5f3320bed9e8ceeb505fcc84b7ee072a85a8098fc362e13b7",
      "size": 210,
      "annotations": {
        "org.opencontainers.image.title": "chart-meta.json"
      }
    },
    {
      "mediaType": "application/vnd.cncf.helm.chart.content.v1+tar",
      "digest": "sha256:84059d7403f496a1c63caf97fdc5e939ea39e561adbd98d0aa864d1b9fc9653f",
      "size": 454,
      "annotations": {
        "sh.helm.chart.name": "mychart",
        "sh.helm.chart.version": "2.7.1",
        "org.opencontainers.image.title": "chart-content.tgz"
      }
    }
  ]
}

The manifest is built using deislabs/oras.

Here is an example of how Helm is using oras as a library for push/pull: https://github.com/jdolitsky/oras-helm-demo

Chart Storage

Chart content is currently stored locally in $HELM_HOME/registry:

$ tree ~/.helm/registry
/Users/me/.helm/registry
├── blobs
│   ├── content
│   │   └── sha256
│   │       └── 84
│   │           └── 059d7403f496a1c63caf97fdc5e939ea39e561adbd98d0aa864d1b9fc9653f
│   └── meta
│       └── sha256
│           └── c3
│               └── 56ec641a696eb5f3320bed9e8ceeb505fcc84b7ee072a85a8098fc362e13b7
├── charts
│   └── mychart
│       └── versions
│           └── 2.7.1
└── refs
    └── localhost:5000
        └── myrepo
            └── mychart
                └── tags
                    └── latest
                        ├── chart -> /Users/me/.helm/registry/charts/mychart/versions/2.7.1
                        ├── content -> /Users/me/.helm/registry/blobs/content/sha256/84/059d7403f496a1c63caf97fdc5e939ea39e561adbd98d0aa864d1b9fc9653f
                        └── meta -> /Users/me/.helm/registry/blobs/meta/sha256/c3/56ec641a696eb5f3320bed9e8ceeb505fcc84b7ee072a85a8098fc362e13b7

Note: This is using a simple filesystem layout, but this is subject to change. We will potentially use something like bbolt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment