# Creating a project

Access to OpenShift is self-managed, you can request it yourself after [logging in](https://datalab.tuwien.ac.at/de/infrastructure/openshift/logging-in/) and setting up your
[CLI tools](https://datalab.tuwien.ac.at/de/infrastructure/openshift/cli/). Create a file with the following content:

```yaml
apiVersion: tuwien.ac.at/v1
kind: NamespaceRequest
metadata:
  name: <PROJECT NAME>
spec:
  owner: <username>
```

!!! warning
    Your username in the Datalab is in the format of `firstname.lastname`, not your normal TU Wien username!

!!! tip
    Your project name must follow the [naming conventions for Kubernetes resources](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/).

Once saved, you can apply this NamespaceRequest by running `oc apply -f yourfile.yaml`. Then run the following command:

```
oc project project-<PROJECT NAME>
```

Congratulations! You are now the proud owner of a project in OpenShift! Next, you can
[deploy a demo application](https://datalab.tuwien.ac.at/de/infrastructure/openshift/demo-app/) or [grant access to teammates](https://datalab.tuwien.ac.at/de/infrastructure/openshift/granting-access/).

!!! tip
    You cannot rename, delete or hand over projects to other users at this time. Please contact us if you need help.

## Increasing quotas (admins only)

!!! note
    This section is for OpenShift administrators only. If you need a limit increase for your project, please ask an
    administrator.

`NamespaceRequest` objects include the following limits by default:

| Resource               | Limit   |
|------------------------|---------|
| CPU limit              | *none*  |
| Memory limit           | `8Gi`   |
| CPU requests           | `1`     |
| Memory requests        | `2Gi`   |
| Storage                | `10Gi`  |
| Ephemeral storage      | `100Mi` |
| Pods                   | `20`    |
| PersistentVolumeClaims | `10`    |
| Services               | `20`    |
| Secrets                | `50`    |
| Loadbalancers          | `0`     |
| NodePorts              | `0`     |

You can update the limits by editing the original `NamespaceRequest` object to the following effect:

```yaml
kind: NamespaceRequest
metadata:
  name: myproject
spec:
  owner: someone
  quotas: # Add this section
    configmaps: 20
    imagestreams: 10
    limits:
      cpu: "" # This field is allowed to be empty, the others are not
      memory: 8Gi
    loadbalancers: 0
    nodeports: 0
    persistentvolumeclaims: 10
    pods: 20
    requests:
      cpu: "1"
      ephemeralStorage: 100Mi
      memory: 2Gi
      storage: 10Gi
    secrets: 50
    services: 20
```

!!! warning
    NodePorts and Loadbalancers require extra network configuration, they should not be granted without checking what's
    needed on the firewall side first. Ideally, these should be created only be administrators.