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

CommandOutput
helm plugin listName, version, description
helm env | grep PLUGINSPlugin install directory

3. Updating Plugins

Example: Update commands

helm plugin update diff
helm plugin update --all     # Helm 3.13+

4. Removing Plugins

CommandEffect
helm plugin uninstall diffRemoves plugin directory
Manualrm -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

VariablePurpose
HELM_PLUGIN_DIRPlugin's own directory (set by Helm)
HELM_PLUGIN_NAMEPlugin name
HELM_BINPath to helm executable for callbacks
HELM_NAMESPACECurrent namespace
HELM_KUBECONTEXTCurrent kube context