This script will convert all the helm repositories in your local helm environemnt into HelmRepository sources for fluxcd.
Dependencies:
#!/usr/bin/env bash | |
readarray repos < <(helm repo list -o yaml | yq -o=j -I=0 '.[]') | |
for repo in "${repos[@]}"; do | |
name=$(echo "$repo" | yq '.name' -) | |
url=$(echo "$repo" | yq '.url' -) | |
flux create source helm "$name" --url="$url" --interval=10m --export > "${name}-source.yaml" | |
done |