Configuring direct namespace creation on OpenShift

By default, on OpenShift Container Platform clusters, Che uses the ProjectRequest API to create projects. This triggers cluster-specific Project Templates, which can apply additional resources or policies.

On OpenShift Container Platform, you can bypass Project Templates and create standard Kubernetes Namespaces directly. For example, this is useful when Project Templates introduce unwanted side effects.

Prerequisites
  • An active kubectl session with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl.

Procedure
  1. Set the createNamespaceDirectly field to true:

    kubectl patch checluster eclipse-che \
      --namespace eclipse-che \
      --type merge \
      --patch '{
        "spec": {
          "devEnvironments": {
            "defaultNamespace": {
              "createNamespaceDirectly": true
            }
          }
        }
      }'
This setting applies only to OpenShift Container Platform clusters. On Kubernetes clusters, Namespaces are always created directly regardless of this setting.