
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
By default, once a user has signed into OpenShift, they are allowed to create new projects. This can be disabled in the following ways:
- Add projectRequestMessage to project.config.openshift.io/cluster
- Set clusterrolebindings.rbac self-provisioners subjects to null
Edit the project.config.openshift.io/cluster resource.
oc edit project.config.openshift.io/cluster
And add projectRequestMessage. This might be something you want to do in a scenario where you have some other method for creating projects, such as with an orchestration technology such as Terraform.
spec:
projectRequestMessage: New project creation has been disabled
The pods in the openshift-apiserver namespace should automatically restart. After each pod has restarted, the change should be live.
~]$ oc get pods --namespace openshift-apiserver
NAME READY STATUS RESTARTS AGE
apiserver-59c8df77f6-qpzmx 0/2 Pending 0 41s
apiserver-846d775c67-kjjdx 2/2 Running 0 44d
apiserver-846d775c67-r8n5c 2/2 Terminating 0 44d
apiserver-846d775c67-wj665 2/2 Running 0 44d
Let use the oc new-project to try to create a new project.
oc new-project my-project
And something like this should be returned.
~]$ oc new-project my-project
Error from server (Forbidden): New project creation has been disabled
Did you find this article helpful?
If so, consider buying me a coffee over at