Skip to content

Instantly share code, notes, and snippets.

@kerin
Created May 11, 2017 14:33
Show Gist options
  • Save kerin/0368e264551e45429119201c8a0e737d to your computer and use it in GitHub Desktop.
Save kerin/0368e264551e45429119201c8a0e737d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
users="user1 user2 user3 etc"
for user in $users; do
helm upgrade $user-rstudio charts/rstudio \
-f chart-env-config/dev/rstudio.yml \
--set Username=$user \
--set AWS.AccessKeyId=$ACCESS_KEY_ID \
--set AWS.SecretAccessKey=$SECRET_KEY \
--namespace user-$user \
--install
done
@xoen
Copy link

xoen commented May 12, 2017

@kerin we should be able to list of users from the namespaces:

$ kubectl get namespaces
NAME                   STATUS    AGE
default                Active    71d
ns1            Active    71d
ns2               Active    68d
...
user-aldo        Active    36d
user-kerin     Active    50d
...

by using cut:

$ kubectl get namespaces | grep user- | cut -d " " -f1 | cut -d "-" -f2
aldo
kerin

(Annoyingly just use $ kubectl get namespaces | grep user- | cut -f1 doesn't seem to work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment