Skip to content

Examples

Copy-paste scenarios for common tasks. The sample manifest in examples/manifest.yaml works with all of them.

Build a Bundle

# manifest.yaml
images:
  - nginx:1.16.0

charts:
  - name: hello-world
    repo: https://helm.github.io/examples
    version: 0.1.0
capsailer init --manifest manifest.yaml
capsailer build --manifest manifest.yaml --output bundle.tar.gz \
  --rewrite-image-references --registry-url registry.example.com:5000

Push to a Registry You Already Have

# Look first
capsailer push --bundle bundle.tar.gz --external-registry registry.example.com:5000 --dry-run

# Push, with the password read from a file instead of the command line
capsailer push --bundle bundle.tar.gz --external-registry registry.example.com:5000 \
  --username myuser --password-stdin < password.txt

The password can also come from the environment:

export CAPSAILER_PASSWORD='...'
capsailer push --bundle bundle.tar.gz --external-registry registry.example.com:5000 --username myuser

Then install the chart from the bundle. Charts are not uploaded to external registries:

mkdir work && cd work
capsailer unpack --file ../bundle.tar.gz
helm install my-hello charts/hello-world-0.1.0.tgz

Push Into a Path on a Registry (Harbor Project)

Build with the full path, and push to the same path:

capsailer build --manifest manifest.yaml --output bundle.tar.gz \
  --rewrite-image-references --registry-url harbor.example.com/nai

capsailer push --bundle bundle.tar.gz --external-registry harbor.example.com --target-prefix nai

nginx:1.16.0 is pushed as harbor.example.com/nai/nginx:1.16.0, which is the name in the chart.

Push Many Images Faster

capsailer push --bundle bundle.tar.gz --external-registry registry.example.com:5000 --jobs 4

Push a Registry That Uses Plain HTTP or a Self-Signed Certificate

# No TLS at all
capsailer push --bundle bundle.tar.gz --external-registry registry.example.com:5000 --plain-http

# TLS with a certificate your machine does not trust
capsailer push --bundle bundle.tar.gz --external-registry registry.example.com:5000 --skip-tls-verify

Registries on localhost, private IP addresses (such as 10.x.x.x) and .local names are tried over HTTP automatically if HTTPS is not available.

Push a Vendor docker save Archive

# See the new names
capsailer push --bundle nai-images.tar --external-registry 10.55.1.16:5000 --dry-run

# Push all images, four at a time
capsailer push --bundle nai-images.tar --external-registry 10.55.1.16:5000 \
  --username admin --password-stdin --jobs 4 < password.txt

See Pushing a vendor docker save archive for how names are rewritten.

Use the Built-In Registry in a Cluster

# Deploy a registry and ChartMuseum
capsailer registry --namespace my-registry

# Push images, and publish charts to ChartMuseum
capsailer push --bundle bundle.tar.gz --namespace my-registry

# Install from ChartMuseum
kubectl port-forward -n my-registry svc/chartmuseum 8080:8080 &
helm repo add local-charts http://localhost:8080
helm repo update
helm install my-hello local-charts/hello-world

Include a Values File

charts:
  - name: hello-world
    repo: https://helm.github.io/examples
    version: 0.1.0
    valuesFile: hello-values.yaml

The file is stored in the bundle's charts/ directory. Pass it to Helm yourself:

helm install my-hello charts/hello-world-0.1.0.tgz -f charts/hello-values.yaml

Push a Local Image From Docker

capsailer push --image myapp:1.0 --external-registry registry.example.com:5000

The image is read from your local Docker daemon and keeps its path: myorg/myapp:1.0 becomes registry.example.com:5000/myorg/myapp:1.0.