sherpack
The Kubernetes package manager with Jinja2 templates.
Overview
Sherpack is a modern Kubernetes package manager that uses Jinja2 templating instead of Go templates. It provides a simpler, more readable syntax while maintaining full lifecycle management capabilities including install, upgrade, rollback, and dependency management.
Installation
From Binary
# Download latest release
From Source
Quick Start
# Create a new pack
# Edit templates and values
# Render templates (dry-run)
# Install to cluster
# Upgrade
# Rollback
# Uninstall
Commands
Templating Commands
sherpack template
Render templates without installing.
# Render to stdout
# With custom values
# Output to directory
# Show only specific template
sherpack lint
Validate pack structure and templates.
# With schema validation
# Skip schema validation
sherpack validate
Validate values against schema.
# Validate with default values
# With custom values file
# JSON output (for CI/CD)
sherpack show
Display pack information.
# Show pack metadata
# Show values
# Show computed values (with defaults)
sherpack create
Create a new pack from template.
# Basic pack
# With options
sherpack convert
Convert Helm chart to Sherpack pack.
# Basic conversion
# Force overwrite
# Dry run (show what would change)
# Verbose output
Packaging Commands
sherpack package
Create a distributable archive.
# Create archive
# Output: my-pack-1.0.0.tgz
# Custom destination
# Include dependencies
sherpack inspect
Show archive contents.
# Output:
# my-pack-1.0.0/
# ├── Pack.yaml
# ├── values.yaml
# ├── MANIFEST
# └── templates/
# ├── deployment.yaml
# └── service.yaml
sherpack verify
Verify archive integrity.
# Verify manifest checksums
# Verify signature
Signing Commands
sherpack keygen
Generate signing keypair.
# Output:
# Generated keypair:
# Private key: ~/.config/sherpack/keys/sherpack.key
# Public key: ~/.config/sherpack/keys/sherpack.pub
# Custom path
sherpack sign
Sign a package archive.
# Sign with default key
# Output: my-pack-1.0.0.tgz.sig
# With specific key
Kubernetes Commands
sherpack install
Install a pack to the cluster.
# Basic install
# With namespace
# Create namespace if missing
# With values
# Wait for resources
# Dry run (show manifests)
sherpack upgrade
Upgrade an existing release.
# Upgrade with new values
# Reuse previous values
# Reset to pack defaults
# Force upgrade (recreate resources)
# Install if not exists
sherpack uninstall
Remove a release.
# Basic uninstall
# With namespace
# Keep history
# Dry run
sherpack rollback
Rollback to a previous revision.
# Rollback to previous
# Rollback to specific revision
# With wait
sherpack list
List installed releases.
# All namespaces
# Specific namespace
# Filter by status
# Output formats
sherpack history
Show release history.
# Output:
# REVISION STATUS DESCRIPTION DATE
# 1 superseded Install complete 2024-01-15 10:00:00
# 2 superseded Upgrade to v2.0 2024-01-16 11:00:00
# 3 deployed Upgrade to v3.0 2024-01-17 12:00:00
sherpack status
Show release status.
# Output:
# NAME: my-release
# NAMESPACE: production
# STATUS: deployed
# REVISION: 3
#
# RESOURCES:
# Deployment/my-app: 3/3 ready
# Service/my-app: ClusterIP
# Ingress/my-app: my-app.example.com
sherpack recover
Recover a stale release.
# Find stale releases
# Recover (mark as failed)
Repository Commands
sherpack repo add
Add a repository.
# HTTP repository
# OCI registry
# With credentials
sherpack repo list
List configured repositories.
# Output:
# NAME URL TYPE
# bitnami https://charts.bitnami.com/bitnami http
# myorg oci://ghcr.io/myorg/charts oci
sherpack repo update
Update repository indexes.
# Update all
# Update specific
sherpack repo remove
Remove a repository.
sherpack search
Search for packs.
# Search in all repos
# Search in specific repo
# Show all versions
sherpack pull
Download a pack.
# Pull latest
# Pull specific version
# Extract to directory
sherpack push
Push to OCI registry.
Dependency Commands
sherpack dependency list
List dependencies.
# Output:
# NAME VERSION REPOSITORY STATUS
# redis ^17.0.0 https://charts.bitnami.com/bitnami [condition: true]
# postgresql ^12.0.0 https://charts.bitnami.com/bitnami [disabled]
sherpack dependency update
Resolve and lock dependencies.
# Output:
# Resolving dependencies for my-app...
#
# Skipping 1 dependencies:
# postgresql (enabled: false)
#
# Resolved 2 dependencies:
# redis @ 17.0.0
# common @ 2.0.0
#
# Dependency tree:
# └── redis@17.0.0
# └── common@2.0.0
#
# Wrote Pack.lock.yaml with 2 locked dependencies
sherpack dependency build
Download locked dependencies.
# With integrity verification
sherpack dependency tree
Show dependency tree.
# Output:
# my-app@1.0.0
# ├── redis@17.0.0
# │ └── common@2.0.0
# └── nginx@15.0.0
Pack Structure
my-pack/
├── Pack.yaml # Package metadata (required)
├── values.yaml # Default values (required)
├── values.schema.yaml # JSON Schema for validation (optional)
├── Pack.lock.yaml # Locked dependencies (generated)
├── packs/ # Downloaded dependencies
│ ├── redis/
│ └── postgresql/
└── templates/ # Jinja2 templates (required)
├── deployment.yaml
├── service.yaml
├── ingress.yaml
└── _helpers.tpl # Shared macros
Pack.yaml
apiVersion: sherpack/v1
kind: application
metadata:
name: my-app
version: 1.0.0
description: My awesome application
appVersion: "2.0"
keywords:
- web
- api
maintainers:
- name: John Doe
email: john@example.com
home: https://myapp.example.com
sources:
- https://github.com/myorg/myapp
dependencies:
- name: redis
version: "^17.0.0"
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
- name: postgresql
version: "^12.0.0"
repository: https://charts.bitnami.com/bitnami
enabled: false
resolve: never
values.yaml
# Application settings
name: my-app
replicas: 3
image:
repository: myorg/myapp
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: true
host: myapp.example.com
redis:
enabled: true
postgresql:
enabled: false
Template Example
{# templates/deployment.yaml #}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ release.name }}
labels:
app.kubernetes.io/name: {{ values.name }}
app.kubernetes.io/instance: {{ release.name }}
spec:
replicas: {{ values.replicas | default(1) }}
selector:
matchLabels:
app.kubernetes.io/name: {{ values.name }}
app.kubernetes.io/instance: {{ release.name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ values.name }}
app.kubernetes.io/instance: {{ release.name }}
spec:
containers:
- name: {{ values.name }}
image: {{ values.image.repository }}:{{ values.image.tag }}
imagePullPolicy: {{ values.image.pullPolicy }}
ports:
- containerPort: {{ values.service.port }}
{%- if values.env %}
env:
{{ values.env | toyaml | indent(12) }}
{%- endif %}
Configuration
Config File
Located at ~/.config/sherpack/config.yaml:
# Default namespace
namespace: default
# Storage driver: secrets, configmap, file
storage:
driver: secrets
namespace: sherpack-system # Optional override
# Default timeout
timeout: 5m
# Output format: table, json, yaml
output: table
Environment Variables
| Variable | Description |
|---|---|
KUBECONFIG |
Kubernetes config path |
SHERPACK_NAMESPACE |
Default namespace |
SHERPACK_DEBUG |
Enable debug output |
SHERPACK_NO_COLOR |
Disable colored output |
Exit Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Pack not found |
| 4 | Template error |
| 5 | Validation error |
| 6 | Kubernetes error |
| 7 | Repository error |
| 8 | Dependency error |
Comparison with Helm
| Feature | Helm | Sherpack |
|---|---|---|
| Template syntax | Go templates | Jinja2 |
| Learning curve | Steep | Gentle |
| Error messages | Cryptic | Contextual with suggestions |
| Schema validation | JSON Schema | JSON Schema + simplified |
| Dependencies | Auto-resolve | Explicit resolution |
| Conflict handling | Silent | Error with solutions |
| Signature format | PGP | Minisign |
Dependencies
clap- CLI argument parsingsherpack-core- Core typessherpack-engine- Template renderingsherpack-kube- Kubernetes operationssherpack-repo- Repository managementsherpack-convert- Helm conversionmiette- Error reportingconsole/indicatif- Terminal UIminisign- Signaturestokio- Async runtime
License
MIT OR Apache-2.0