Examples
This page provides examples of common Capsailer usage scenarios.
Basic Bundle Creation
This example shows how to create a basic bundle with a few container images and Helm charts.
Manifest File
# manifest.yaml
images:
- nginx:1.25
- redis:7.0
charts:
- name: redis
repo: https://charts.bitnami.com/bitnami
version: 17.11.7
- name: nginx
repo: https://charts.bitnami.com/bitnami
version: 15.1.4
Build Command
capsailer init --manifest manifest.yaml
capsailer build --manifest manifest.yaml --output capsailer-bundle.tar.gz
Deploying a Registry with Persistence
This example shows how to deploy a registry with persistent storage.
Pushing Images to an External Registry
This example shows how to push images from a bundle to an external registry.
capsailer push --bundle capsailer-bundle.tar.gz --external-registry registry.example.com --username myuser --password mypassword
Complete Air-Gapped Workflow
This example shows the complete workflow for air-gapped deployments.
In the Connected Environment
# Create a manifest file
cat > manifest.yaml << EOF
images:
- nginx:1.25
- redis:7.0
- bitnami/postgresql:15.4.0
- registry:2
charts:
- name: redis
repo: https://charts.bitnami.com/bitnami
version: 17.11.7
- name: nginx
repo: https://charts.bitnami.com/bitnami
version: 15.1.4
EOF
# Validate the manifest
capsailer init --manifest manifest.yaml
# Build the bundle
capsailer build --manifest manifest.yaml --output capsailer-bundle.tar.gz
In the Air-Gapped Environment
# Deploy a registry
./capsailer registry --namespace my-registry
# Push all images from the bundle to the registry
./capsailer push --bundle capsailer-bundle.tar.gz --namespace my-registry
# Deploy applications using standard Helm commands
kubectl port-forward -n my-registry svc/chartmuseum 8080:8080 &
helm repo add local-charts http://localhost:8080
helm repo update
helm install my-redis local-charts/redis
Using Values Files with Charts
This example shows how to include values files with Helm charts.
Manifest File
# manifest.yaml
images:
- nginx:1.25
- redis:7.0
charts:
- name: redis
repo: https://charts.bitnami.com/bitnami
version: 17.11.7
valuesFile: redis-values.yaml
- name: nginx
repo: https://charts.bitnami.com/bitnami
version: 15.1.4
valuesFile: nginx-values.yaml