Skip to content

Instantly share code, notes, and snippets.

@zmx
Created January 16, 2024 17:11
Show Gist options
  • Save zmx/d3de4a3e7672fbadb4d3e6605cd9f456 to your computer and use it in GitHub Desktop.
Save zmx/d3de4a3e7672fbadb4d3e6605cd9f456 to your computer and use it in GitHub Desktop.
K8s Sync Secrets from Template Job
# Origin: https://colocatedeventsna2023.sched.com/event/1Rj2e
kubectl -n preview-apps get secret db-secret -o yaml | \
yq 'del(.metadata.creationTimestamp, .metadata.uid, .metadata.resourceVersion, .metadata.namespace,
.metadata.annotations, .metadata.ownerReferences)' | \
kubectl apply --namespace $PR_NUMBER -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment