Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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'
```