Skip to content

Instantly share code, notes, and snippets.

@technosophos
Created November 29, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save technosophos/0363bdc408f79e8c2306fdef04a943db to your computer and use it in GitHub Desktop.
Save technosophos/0363bdc408f79e8c2306fdef04a943db to your computer and use it in GitHub Desktop.
Query a cluster to populate a Helm chart
#!/bin/bash
kinds="cs,cm,ds,deploy,ev,ep,hpa,ing,jobs,limits,po,pv,pvc,quota,rs,rc,secrets,sa,svc"
tpl="{{range .items}}{{.metadata.name}} {{end}}"
if [[ "" == $1 ]]; then
echo name of app is required
exit 1
fi
mkdir -p $1
kubectl get -l "app" --export -a $kinds -o yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment