Skip to main content

Creating a NS for a user

Willard is working on building a system to easily create namespaces for users. Until then, they have to do it manually. Here's how:

 

Create the resources

```

apiVersion: v1
kind: Namespace
metadata:
  name: oxidized
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: oxidized-admin
  namespace: oxidized
rules:
- apiGroups:
  - ""
  - extensions
  - apps
  resources:
  - '*'
  verbs:
  - '*'
- apiGroups:
  - batch
  resources:
  - jobs
  - cronjobs
  verbs:
  - '*'
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: oxidized
  namespace: oxidized
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: oxidized-admin-binding
  namespace: oxidized
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: oxidized-admin
subjects:
- kind: ServiceAccount
  name: oxidized
  namespace: oxidized

```