Created
September 8, 2022 07:01
-
-
Save leadelngalame1611/ff3284fbd6dc62b05ca4e6f0aae26334 to your computer and use it in GitHub Desktop.
MOdify role in kubernetes
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
ROLE_ARN="arn:aws:iam::XXXXXXXXXXXX:role/developer | |
USERNAME="developer" | |
ROLE=" - rolearn: ${ROLE_ARN}\n username: ${USERNAME}\n groups:\n - system:masters" | |
kubectl get -n kube-system configmap/aws-auth -o yaml | awk "/mapRoles: \|/{print;print \"$ROLE\";next}1" > /tmp/aws-auth-patch.yml | |
kubectl patch configmap/aws-auth -n kube-system --patch "$(cat /tmp/aws-auth-patch.yml)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment