Difference between revisions of "Helm diff"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "This is a great plugin for helm. helm plugin install https://github.com/databus23/helm-diff helm diff upgrade -n mynamespace myapp foo/myapp -f custom-values.yaml You could...")
 
Line 3: Line 3:
 
helm plugin install https://github.com/databus23/helm-diff
 
helm plugin install https://github.com/databus23/helm-diff
  
helm diff upgrade -n mynamespace myapp foo/myapp -f custom-values.yaml
+
helm diff upgrade -n mynamespace myapp foo/myapp -f custom-values.yaml
  
 
You could use it like so
 
You could use it like so
  
```
+
```bash
 
#!/bin/bash
 
#!/bin/bash
 
lines=$(helm diff upgrade -n mynamespace myapp foo/myapp  -f custom-values.yaml)
 
lines=$(helm diff upgrade -n mynamespace myapp foo/myapp  -f custom-values.yaml)
Line 16: Line 16:
 
fi
 
fi
 
```
 
```
 +
 +
You can use terraform helm provider as well.
 +
 +
https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release

Revision as of 20:57, 27 December 2022

This is a great plugin for helm.

helm plugin install https://github.com/databus23/helm-diff

helm diff upgrade -n mynamespace myapp foo/myapp -f custom-values.yaml

You could use it like so

#!/bin/bash
lines=$(helm diff upgrade -n mynamespace myapp foo/myapp  -f custom-values.yaml)
if [[ $(echo $lines | wc -l) > 0 ]]; then
  echo "$lines" | grep "^+\|^-"
  echo "Helm changes detected."
  echo "Running upgrade in 5."; sleep 5  helm upgrade --install -n mynamespace myapp foo/myapp  -f custom-values.yaml
fi

You can use terraform helm provider as well.

https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release