Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Last active February 19, 2020 23:05
Show Gist options
  • Save rms1000watt/786ce6c1c29598f3e8e819aff4642105 to your computer and use it in GitHub Desktop.
Save rms1000watt/786ce6c1c29598f3e8e819aff4642105 to your computer and use it in GitHub Desktop.
Get diff for helmfile against actual k8s state
#!/usr/bin/env bash
# Render all the k8s yaml
helmfile -f hello.yml template > ~/Desktop/hello.helmfile.yml
# Diff the new yaml with what's actually deployed
tail -n +2 ~/Desktop/hello.helmfile.yml | kubectl diff -f - > ~/Desktop/hello.helmfile.diff
# If diff is acceptable, run k8s
kubectl apply -f ~/Desktop/hello.helmfile.yml
# Then you can do a helmfile apply on top of it
helmfile -f hello.yml apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment