Working with Helm Plugins
1. Installing Helm Plugins
Example: Install from Git
helm plugin install https://github.com/databus23/helm-diff
helm plugin install https://github.com/jkroepke/helm-secrets --version v4.5.1
helm plugin install /local/path/to/plugin
2. Listing Installed Plugins
| Command | Output |
|---|---|
helm plugin list | Name, version, description |
helm env | grep PLUGINS | Plugin install directory |
3. Updating Plugins
4. Removing Plugins
| Command | Effect |
|---|---|
helm plugin uninstall diff | Removes plugin directory |
| Manual | rm -rf $(helm env HELM_PLUGINS)/<name> |
5. Using helm-diff Plugin
Example: Preview upgrade
helm diff upgrade api ./chart -f values-prod.yaml
helm diff upgrade api ./chart --context 3 --show-secrets
helm diff release api1 api2 # Compare two releases
helm diff rollback api 5 # Preview rollback
6. Using helm-secrets Plugin
Example: SOPS workflow
helm secrets encrypt values-prod.yaml > secrets.yaml
helm secrets edit secrets.yaml
helm secrets upgrade api ./chart -f values.yaml -f secrets://secrets.yaml
7. Using helm-git Plugin
Example: Chart from Git repo
helm plugin install https://github.com/aslafy-z/helm-git
helm install api git+https://github.com/acme/charts@charts/api?ref=main
8. Using helm-s3 Plugin
Example: S3-backed repo
helm plugin install https://github.com/hypnoglow/helm-s3
helm s3 init s3://acme-charts/stable
helm repo add acme-stable s3://acme-charts/stable
helm s3 push api-1.4.2.tgz acme-stable
9. Creating Custom Plugins
Example: plugin.yaml
name: "myplugin"
version: "0.1.0"
usage: "helm myplugin [args]"
description: "Custom team workflow"
command: "$HELM_PLUGIN_DIR/bin/myplugin"
hooks:
install: "cd $HELM_PLUGIN_DIR; ./install.sh"
update: "cd $HELM_PLUGIN_DIR; ./install.sh"
10. Configuring Plugin Environment
| Variable | Purpose |
|---|---|
HELM_PLUGIN_DIR | Plugin's own directory (set by Helm) |
HELM_PLUGIN_NAME | Plugin name |
HELM_BIN | Path to helm executable for callbacks |
HELM_NAMESPACE | Current namespace |
HELM_KUBECONTEXT | Current kube context |