Difference between revisions of "Secrets diff"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "# Secrets diff and create ``` if ! kubectl get secret netbox-tls -o yaml | grep -q "$(base64 < tls.crt)"; then kubectl delete secret netbox-tls --ignore-not-found kubectl...")
(No difference)

Revision as of 18:52, 12 February 2025

Secrets diff and create

if ! kubectl get secret netbox-tls -o yaml | grep -q "$(base64 < tls.crt)"; then
  kubectl delete secret netbox-tls --ignore-not-found
  kubectl create secret tls netbox-tls --cert=tls.crt --key=tls.key
fi

kubectl get secret netbox-tls -o yaml | diff - <(kubectl create secret tls netbox-tls --cert=tls.crt --key=tls.key --dry-run=client -o yaml) || \
kubectl delete secret netbox-tls --ignore-not-found && \
kubectl create secret tls netbox-tls --cert=tls.crt --key=tls.key