Created
October 23, 2024 19:03
-
-
Save Souheil-Yazji/d95cf571e08a57623aaac0fec887f8ca to your computer and use it in GitHub Desktop.
Kubeflow Rolebinding Email Puller
This file contains hidden or 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 | |
| # List all Kubeflow profiles, get name (profiles are 1:1 with namespaces) | |
| PROFILES=$(kubectl get profiles -o jsonpath='{.items[*].metadata.name}') | |
| # Iterate over each profile and get RoleBindings, extract user name | |
| for ns in $PROFILES; do | |
| echo "Namespace: $ns" | |
| kubectl get rolebindings -n $ns -o json | jq ' | |
| .items[] | select(.subjects[]?.kind == "User") | { | |
| user: .subjects[]?.name | |
| }' | |
| echo "-------------------------------------" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.