-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from travisgroth/pomerium/3.0.0
Refactor TLS secrets (#17347)
- Loading branch information
Showing
10 changed files
with
435 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash -e | ||
|
||
if [ "${1}" == "" ] || [ "${2}" == "" ]; then | ||
echo "Usage: $0 [secret name] [namespace]" | ||
fi | ||
|
||
DIR=$(mktemp -d) | ||
NAME=${1:-pomerium} | ||
NAMESPACE=${2:-default} | ||
for service in authenticate authorize proxy; do | ||
kubectl get secrets "${NAME}" -n "${NAMESPACE}" -o jsonpath="{.data.${service}-key}" | base64 -D | base64 -D >"${DIR}/${service}.key" | ||
kubectl get secrets "${NAME}" -n "${NAMESPACE}" -o jsonpath="{.data.${service}-cert}" | base64 -D | base64 -D >"${DIR}/${service}.crt" | ||
|
||
kubectl create secret tls "${NAME}-${service}-tls" \ | ||
--cert="${DIR}/${service}.crt" \ | ||
--key="${DIR}/${service}.key" | ||
done | ||
|
||
kubectl get secrets "${NAME}" -n "${NAMESPACE}" -o jsonpath="{.data.ca-cert}" | base64 -D | base64 -D >"${DIR}/ca.crt" | ||
kubectl create secret generic "${NAME}-ca-tls" \ | ||
--from-file=ca.crt="${DIR}/ca.crt" | ||
echo "Please delete ${DIR} to clean up temporary certificate storage" | ||
echo "# rm ${DIR}/*.{key,crt} && rmdir ${DIR}" |
This file contains 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
Oops, something went wrong.