Skip to content

Instantly share code, notes, and snippets.

@pasdam
Created December 3, 2020 13:45
Show Gist options
  • Save pasdam/ab7ea8c38799e11279b831fcd6be3e22 to your computer and use it in GitHub Desktop.
Save pasdam/ab7ea8c38799e11279b831fcd6be3e22 to your computer and use it in GitHub Desktop.
Seal specified secrets from a k8s cluster
#!/usr/bin/env bash
if [ 2 != $# ]; then
1>&2 echo "Please specify the required arguments: <namespace> <secret>"
exit 1
fi
NAMESPACE=$1
SECRET_NAME=$2
WORKING_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
PROJECT_ROOT=$(dirname ${WORKING_DIR})
kubectl get secret -n $NAMESPACE -o json $SECRET_NAME | kubeseal -o yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment