Skip to content

Instantly share code, notes, and snippets.

@jsloyer
Created April 11, 2017 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsloyer/bd329093034f333ee3cebed5d9f6ad43 to your computer and use it in GitHub Desktop.
Save jsloyer/bd329093034f333ee3cebed5d9f6ad43 to your computer and use it in GitHub Desktop.
#!/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