Created
December 3, 2020 13:45
-
-
Save pasdam/ab7ea8c38799e11279b831fcd6be3e22 to your computer and use it in GitHub Desktop.
Seal specified secrets from a k8s cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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