Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Created November 2, 2020 10:05
Show Gist options
  • Save developer-guy/e80436ecb52cff730f2dad2c2be6e4b2 to your computer and use it in GitHub Desktop.
Save developer-guy/e80436ecb52cff730f2dad2c2be6e4b2 to your computer and use it in GitHub Desktop.
#!/bin/bash
ROOT=$(cd $(dirname $0)/../../; pwd)
set -o errexit
set -o nounset
set -o pipefail
export CA_BUNDLE=$(kubectl config view --minify --flatten -o json | jq -r '.clusters[] | select(.name == "'$(kubectl config current-context)'") | .cluster."certificate-authority-data"')
if command -v envsubst >/dev/null 2>&1; then
envsubst
else
sed -e "s|\${CA_BUNDLE}|${CA_BUNDLE}|g"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment