Created
April 11, 2017 22:46
-
-
Save jsloyer/bd329093034f333ee3cebed5d9f6ad43 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
mkdir oidc-update | |
cd oidc-update | |
if [[ "$(hostname)" == "prod"* ]]; then | |
url=https://iam.ng.bluemix.net/kubernetes | |
else | |
url=https://iam.stage1.ng.bluemix.net/kubernetes | |
fi | |
deploys=$(kubectl -n kubx-masters get deploy -o name) | |
for deploy in $deploys; do | |
name=$(basename $deploy) | |
kubectl -n kubx-masters get $deploy -o yaml > $name.yml | |
cp $name.yml $name.yml.orig | |
sed -i $name.yml -e s," - --authorization-mode=RBAC"," - --oidc-issuer-url=$url\n - --oidc-client-id=bx\n - --authorization-mode=RBAC",g | |
# WARNING: | |
kubectl -n kubx-masters apply -f $name.yml | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment