Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpsouza/k8s-create-user
This script creates a user in Kubernetes and adds it to the specified groups.
https://github.com/lpsouza/k8s-create-user
create-user kubernetes rbac shellscript
Last synced: about 1 month ago
JSON representation
This script creates a user in Kubernetes and adds it to the specified groups.
- Host: GitHub
- URL: https://github.com/lpsouza/k8s-create-user
- Owner: lpsouza
- Created: 2023-05-18T20:29:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-05-18T20:29:04.000Z (over 1 year ago)
- Last Synced: 2024-10-25T13:58:11.249Z (3 months ago)
- Topics: create-user, kubernetes, rbac, shellscript
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# User creator for Kubernetes
This script creates a user in Kubernetes and adds it to the specified groups.
## Usage
```bash
./create-user.sh
```## Examples
```bash
# Create a user and add it to the group "developers"
./create-user.sh john developers
```## Get a list of groups
```bash
# Cluster roles
kubectl get clusterrolebindings -o json | jq -r '.items[] | select(.subjects[0].kind=="Group") | .metadata.name'# Roles from all namespaces
kubectl get rolebindings -A -o json | jq -r '.items[] | select(.subjects[0].kind=="Group") | .metadata.name'
```