IBM Fusion

IBM Fusion

Ask questions, exchange ideas, and learn about IBM Fusion

 View Only

Quickstart: Fusion Namespace as a Service

By Christo Abraham posted 09/07/26 11:42 AM

  

If you run an OpenShift cluster for a team, you already know this story. A developer raises a ticket: "Can I get a namespace for my new project?" The platform team fields the request, remembers the right quotas, applies the RBAC, wires up GitOps, double-checks the network policies, and eventually the namespace is live, maybe a day later, maybe a week.

Multiply that by every project, every environment tier, and every team update, and you have a significant chunk of the platform team's week gone to repetitive provisioning work.

Namespace as a Service (NaaS) eliminates that queue. It turns namespace provisioning into a self-service form in Developer Hub. A developer fills in their project name, picks a size, names their team groups, and clicks Create. A GitOps Pull Request is opened automatically, and once a platform team approves it, ArgoCD provisions a fully configured, policy-compliant namespace, with no manual oc commands on either side.

What Gets Provisioned?

Every namespace created through NaaS gets the following Kubernetes manifests applied automatically:

Manifest What it does
namespace.yaml Creates the namespace with cost, environment, ArgoCD management, and Pod Security Standards labels. When ArgoCD Application wiring is enabled, namespace annotations store the ArgoCD Application details for later pre-population by the Update template.
resource-quota.yaml Enforces CPU, memory, pod count, and storage caps, values vary by the Small / Medium / Large size tier chosen in the wizard
limit-range.yaml Sets per-container and per-pod CPU/memory defaults and maximums, plus a per-PVC storage limit, so pods without explicit resource requests don't exhaust the quota
network-policy.yaml Applies four policies: deny all ingress by default, allow intra-namespace pod traffic, allow the OpenShift router, and allow Prometheus scraping from openshift-monitoring
rbac-role.yaml Creates three roles (namespace-admin, namespace-developer, namespace-viewer) with group bindings, plus a dedicated <projectName>-cicd ServiceAccount for pipelines
catalog-info.yaml Backstage Resource entity — registered in the Developer Hub Software Catalog at submission time so the namespace is discoverable immediately
argocd-application.yaml (optional) An ArgoCD Application that targets the new namespace — rendered only when the developer enables the Create an ArgoCD Application? toggle in the wizard

Nothing is applied by hand. Every resource is declared in Git, owned by ArgoCD, and auditable.

Architecture Overview


┌──────────────────────────────────────────────────────────────────────┐
│  Developer Hub                                                       │
│                                                                      │
│  Software Templates  ──── fetch:template ────►  skeleton/ files      │
│  (3 × template file)      publish:github:pr  ──► GitOps repository   │
│                                                                      │
│  Namespace Validator Plugin                                          │
│  ↳ naas:namespace:available  ─── pre-flight check before PR          │
│  ↳ NamespaceName field       ─── live availability indicator         │
│  ↳ OcGroupField              ─── live OpenShift group picker         │
│  ↳ NaaSProjectField          ─── pre-populated update selector       │
│  ↳ NaaSDeleteField           ─── pre-populated delete selector       │
│  ↳ ArgoAppField              ─── pre-populated ArgoCD wiring form    │
└──────────────────────────────────────────────────────────────────────┘
                                     │
                                     │  Pull Request merged
                                     ▼
┌──────────────────────────────────────────────────────────────────────┐
│  GitOps repository                                                   │
│                                                                      │
│  <namespacesPath>/                                                   │
│    <project>-<env>/                                                  │
│      namespace.yaml         ─── Namespace + labels + annotations     │
│      resource-quota.yaml    ─── CPU / memory caps                    │
│      limit-range.yaml       ─── Per-container defaults               │
│      network-policy.yaml    ─── Ingress isolation rules              │
│      rbac-role.yaml         ─── Roles + RoleBindings + SA            │
│      catalog-info.yaml      ─── Backstage resource entity            │
│      argocd-application.yaml ── ArgoCD Application (optional)        │
└──────────────────────────────────────────────────────────────────────┘
                                     │
                                     │  ArgoCD watches <namespacesPath>/
                                     ▼
┌──────────────────────────────────────────────────────────────────────┐
│  ArgoCD                                                              │
│                                                                      │
│  Application: <release>-naas-controller                              │
│  ↳ Syncs, self-heals drift, prunes deleted resources                 │
└──────────────────────────────────────────────────────────────────────┘
                                     │
                                     ▼
                          OpenShift Cluster Namespace

Four components work together:

  1. Developer Hub Software Templates — three separate template files (Request, Update, Delete) that collect inputs and drive automation.
  2. Namespace Validator Plugin — a required backend + frontend plugin that provides live namespace availability checks, OpenShift group pickers, and pre-populated selectors for the Update and Delete flows.
  3. Your GitOps repository — the source of truth. Every namespace is a directory of YAML files under <namespacesPath>/.
  4. ArgoCD (<release>-naas-controller) — watches namespacesPath recursively and reconciles the cluster to match Git. Sync is automated with selfHeal: true and prune: true.

Part 1: Administrator Setup

Prerequisites

Before you start, make sure you have:

  • Developer Hub deployed and accessible (follow the Developer Hub Quickstart if you haven't already).
  • OpenShift GitOps (ArgoCD) installed on the cluster (follow the GitOps (ArgoCD) Quickstart if you haven't already).
  • A GitOps repository where namespace manifests will live.
  • oc CLI access with cluster-admin permissions.
  • Helm CLI installed (if deploying via Helm rather than ArgoCD GitOps).
  • Node.js ≥ 20 and podman on a build machine (for building the Namespace Validator Plugin OCI artifacts).

Step 1 — Set Up GitHub Authentication

NaaS uses GitHub in three distinct ways:

Token Source Purpose
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET GitHub OAuth App "Sign in with GitHub" — authenticates users and establishes their session
USER_OAUTH_TOKEN User's live GitHub OAuth session Scaffolder actions — creates the branch, commits manifests, opens the PR, adds labels on behalf of the developer
GITHUB_TOKEN Personal Access Token (PAT) Backend — reads the three template YAML files and skeleton/ files from GitHub at runtime

All three are stored in a single Kubernetes Secret named github-auth-secret.

1a. Create a GitHub OAuth App

  1. Navigate to GitHub → Settings → Developer Settings → OAuth Apps → New OAuth App.
  2. Fill in the form:
Field Value
Application name Developer Hub (or any name users will recognise)
Homepage URL https://rhdh.<your-apps-domain>
Authorization callback URL https://rhdh.<your-apps-domain>/api/auth/github/handler/frame

Replace rhdh.<your-apps-domain> with your actual Developer Hub hostname.

  1. Click Register application. Note the Client ID and generate a Client Secret, you will need both in Step 1c.

GitHub Enterprise: Instead of github.com, navigate to your GHE instance, e.g. https://<your-ghe-hostname>/settings/developers. The application name, Homepage URL, and Authorization callback URL fields are filled in exactly the same way. Only the GHE base domain differs.

1b. Create a GitHub Personal Access Token

Go to github.com/settings/tokens and create a PAT with the repo scope. This token lets Developer Hub's backend read the three template YAML files and the skeleton/ files from your GitOps repository at runtime.

GitHub Enterprise: Create the token at https://<your-ghe-hostname>/settings/tokens instead. The repo scope requirement is identical.

1c. Create the github-auth-secret

Create the Secret in your Developer Hub namespace. The Helm chart's extraEnvs.secrets list already references github-auth-secret, so Developer Hub automatically mounts all three values as environment variables once the Secret exists, no additional Helm changes are needed.

# Replace each placeholder with your actual values:
# <namespace>      — your Developer Hub namespace (e.g. rhdh, developer-hub)
# <client-id>      — GitHub OAuth App Client ID
# <client-secret>  — GitHub OAuth App Client Secret
# <your-pat>       — GitHub Personal Access Token with 'repo' scope

oc create secret generic github-auth-secret \
  --from-literal=GITHUB_CLIENT_ID=<client-id> \
  --from-literal=GITHUB_CLIENT_SECRET=<client-secret> \
  --from-literal=GITHUB_TOKEN=<your-pat> \
  -n <namespace>

Step 2 — Build and Publish the Namespace Validator Plugin

The namespace-validator plugin is a required component of NaaS. When naas.enabled: true, the Helm chart unconditionally loads both the frontend and backend plugin packages. The plugin provides six custom fields and a scaffolder action used by all three templates:

Component Type What it does
naas:namespace:available Scaffolder action Fails the provision template before any PR is created when the requested namespace already exists in the cluster
NamespaceName Frontend field extension Combines projectName + environment into a live availability indicator shown while the developer types
OcGroupField Frontend field extension Populates group pickers (Owner / Developer / Viewer) with live OpenShift group names from the cluster
NaaSProjectField Frontend field extension Fetches all NaaS-managed namespaces and pre-populates the Update template with the selected namespace's existing configuration
NaaSDeleteField Frontend field extension Fetches all NaaS-managed namespaces and renders the Delete template's selection and confirmation fields
ArgoAppField Frontend field extension Renders the ArgoCD Application wiring fields in the Request and Update templates; pre-fills from stored namespace annotations when updating

Both plugin packages must be built from source, packaged as OCI images, and pushed to your private registry. The source lives under plugins/namespace-validator/ in this repository.

2a. Update the package-oci script in each package.json

Before building, update the OCI image reference to point at your registry. For the backend plugin (plugins/namespace-validator/backend/package.json):

"package-oci": "npx --yes @red-hat-developer-hub/cli@latest plugin package --tag <your-registry>/<your-org>/namespace-validator-backend:<tag>"

For the frontend plugin (plugins/namespace-validator/frontend/package.json):

"package-oci": "npx --yes @red-hat-developer-hub/cli@latest plugin package --tag <your-registry>/<your-org>/namespace-validator-frontend:<tag>"

2b. Build and push the backend plugin

cd plugins/namespace-validator/backend
npm install
npm run build
npm run export-dynamic
npm run package-oci
podman push <your-registry>/<your-org>/namespace-validator-backend:<tag>

2c. Build and push the frontend plugin

cd plugins/namespace-validator/frontend
npm install
npm run build
npm run export-dynamic
npm run package-oci
podman push <your-registry>/<your-org>/namespace-validator-frontend:<tag>

The plugin backend calls the OpenShift/Kubernetes API from within the cluster using the Developer Hub workload's service account. It requires the following least-privilege RBAC permissions:

# Minimum cluster permissions required for the RHDH service account
# Namespace listing (all three templates)
apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list"]

# OpenShift group listing (OcGroupField)
apiGroups: ["user.openshift.io"]
resources: ["groups"]
verbs: ["get", "list"]

Step 3 — Enable NaaS in Your Helm Values

NaaS is disabled by default (catalog.naas.enabled: false). Open your environment values file (e.g. deploy/helm/environments/dev/values.yaml) and update the following block:

argocd:
  enabled: true    # Required: allows the Helm chart to render the naas-controller ArgoCD Application
  rbac:
    enabled: true
    namespace: openshift-gitops

developerHub:
  auth:
    github:
      enabled: true    # Required: enables "Sign in with GitHub" and USER_OAUTH_TOKEN
      allowSignInWithoutCatalog: true   # permit users not yet in the catalog

  catalog:
    github:
      enterpriseHost: ""    # Leave empty for public GitHub, or set your GHE hostname only
                            # (e.g. github.example.com — hostname only, no https://)
      target: "https://github.com/your-org"    # Full org URL, no trailing slash

    naas:
      enabled: true
      repoName: "your-gitops-repo"                 # Name of the repo containing the template files
      templateBranch: "main"                       # Branch holding the templates and skeleton/
      requestTemplatePath: "quickstarts/fusion-developerhub/templates/naas/naas-request-template.yaml"
      updateTemplatePath: "quickstarts/fusion-developerhub/templates/naas/naas-update-template.yaml"
      deleteTemplatePath: "quickstarts/fusion-developerhub/templates/naas/naas-delete-template.yaml"
      gitopsRepoURL: "https://github.com/your-org/your-gitops-repo.git"    # Full clone URL watched by ArgoCD
      namespacesPath: "namespaces"                 # Repo-relative directory where manifests land

      # Namespace validator plugin — required when naas.enabled is true
      namespaceValidator:
        ociRepository: "your-registry.example.com/your-org"   # OCI registry prefix
        frontendPackage: "namespace-validator-frontend"
        backendPackage: "namespace-validator-backend"
        version: "<tag>"    # must match the tag used when building

What each key field does:

Field Description
argocd.enabled Must be true for the Helm chart to render the naas-controller ArgoCD Application resource
auth.github.enabled Enables the "Sign in with GitHub" button and the USER_OAUTH_TOKEN used to open PRs, without this every template run fails
catalog.github.enterpriseHost GHE hostname only, no https://. Leave empty for public GitHub
catalog.github.target Full org URL, used to construct the catalog location URLs for all three template files
catalog.naas.repoName Repository name that holds the template files
catalog.naas.templateBranch Branch the templates are read from; also the branch ArgoCD tracks
catalog.naas.requestTemplatePath Repo-relative path to the Request (Provision) template
catalog.naas.updateTemplatePath Repo-relative path to the Update template
catalog.naas.deleteTemplatePath Repo-relative path to the Delete template
catalog.naas.gitopsRepoURL Full .git clone URL that the ArgoCD naas-controller Application watches
catalog.naas.namespacesPath Subdirectory inside the repo where provisioned manifests land (default: namespaces)
catalog.naas.namespaceValidator.ociRepository OCI registry prefix for the validator plugin artifacts — must always be set
catalog.naas.namespaceValidator.version Image tag to pull — must match the tag used when building

The Helm chart uses these values to construct three catalog location URLs (one per template) that Developer Hub uses to load each template at startup:

https://github.com/my-org/my-platform-repo/blob/main/quickstarts/fusion-developerhub/templates/naas/naas-request-template.yaml
https://github.com/my-org/my-platform-repo/blob/main/quickstarts/fusion-developerhub/templates/naas/naas-update-template.yaml
https://github.com/my-org/my-platform-repo/blob/main/quickstarts/fusion-developerhub/templates/naas/naas-delete-template.yaml

After editing, apply the Helm upgrade:

helm upgrade <release> ./deploy/helm \
  -f deploy/helm/values.yaml \
  -f deploy/helm/environments/<env>/values.yaml \
  -n <namespace>

Alternatively, Enable via ArgoCD valuesObject

If Developer Hub is itself deployed as an ArgoCD Application, add the same overrides directly to spec.source.helm.valuesObject in your application.yaml. This avoids editing values files on disk, ArgoCD re-renders the Helm chart automatically when the Application manifest changes.

The valuesObject block only needs to include the fields you are changing. The three *TemplatePath and namespacesPath fields default to the correct values for this repository and do not need to be repeated unless you have moved the templates. namespaceValidator.ociRepository must always be set — without it Developer Hub cannot pull the plugin images and NaaS will not be usable.

# spec.source.helm.valuesObject in your ArgoCD Application manifest
argocd:
  enabled: true
  rbac:
    enabled: true
    namespace: openshift-gitops    # ← CHANGE if your ArgoCD is in a different namespace

developerHub:
  catalog:
    github:
      enterpriseHost: ""    # ← CHANGE: set your GHE hostname (e.g. github.example.com)
                            # Leave empty for public GitHub
      target: "https://github.com/your-org"    # ← CHANGE: full org URL, no trailing slash
    naas:
      enabled: true
      repoName: "your-gitops-repo"    # ← CHANGE: repo name containing the templates
      templateBranch: "main"          # ← CHANGE: branch holding the templates
      gitopsRepoURL: "https://github.com/your-org/your-gitops-repo.git"    # ← CHANGE
      namespaceValidator:
        ociRepository: "your-registry.example.com/your-org"    # ← CHANGE: REQUIRED
        frontendPackage: "namespace-validator-frontend"
        backendPackage: "namespace-validator-backend"
        version: "<tag>"    # ← CHANGE: must match the tag used when building

Then apply the updated Application manifest:

oc apply -f deploy/gitops/environments/<env>/application.yaml -n openshift-gitops

ArgoCD detects the updated spec, re-renders the Helm chart with the new valuesObject, and applies the diff, no manual helm upgrade needed.

Step 4 — Configure the Template's Hidden Platform Fields

Each of the three template files (naas-request-template.yaml, naas-update-template.yaml, naas-delete-template.yaml) contains a set of hidden parameters. These are never shown to developers in the wizard UI (ui:widget: hidden, review: show: false), but their default: values drive where the scaffolder opens PRs and how resources are labelled.

Find the block that begins with # Platform settings and update every default: value to match your deployment:

githubHost:
  type: string
  ui:widget: hidden
  default: ''    # Leave empty for public GitHub, or set your GHE hostname
                 # (e.g. github.example.com, hostname only, no https://)

repoOrg:
  type: string
  ui:widget: hidden
  default: 'your-org'    # ← GitHub organisation that owns the GitOps repository

repoName:
  type: string
  ui:widget: hidden
  default: 'your-gitops-repo'    # ← Repository name

targetBranch:
  type: string
  ui:widget: hidden
  default: 'main'    # ← Branch the PR targets

prReviewers:
  type: string
  ui:widget: hidden
  default: ''    # ← Comma-separated GitHub usernames auto-added as PR reviewers
                 #   (optional, leave empty to skip)

namespacesPath:
  type: string
  ui:widget: hidden
  default: 'namespaces'    # ← Must exactly match catalog.naas.namespacesPath in values.yaml

argoCdInstance:
  type: string
  ui:widget: hidden
  default: 'openshift-gitops'    # ← Namespace of your ArgoCD instance

acmReplicate:
  type: string
  ui:widget: hidden
  default: 'false'    # ← Set 'true' to replicate namespaces to ACM managed clusters

podSecurityStandard:
  type: string
  ui:widget: hidden
  default: 'baseline'    # ← 'privileged', 'baseline', or 'restricted'

catalogOwner:
  type: string
  ui:widget: hidden
  default: 'platform-team'    # ← Backstage group that owns the catalog entries

catalogSystem:
  type: string
  ui:widget: hidden
  default: 'naas-platform'    # ← Backstage system the resource belongs to

consoleBaseUrl:
  type: string
  ui:widget: hidden
  default: 'https://console-openshift-console.apps.<cluster-domain>'
  # OpenShift web console URL — used in catalog-info.yaml for quick-access links

argocdBaseUrl:
  type: string
  ui:widget: hidden
  default: 'https://openshift-gitops-server-openshift-gitops.apps.<cluster-domain>'
  # ArgoCD UI URL — used in catalog-info.yaml for ArgoCD Application links

Keep namespacesPath, repoOrg, repoName, and targetBranch in sync across all three templates and your Helm values. The hidden fields tell the scaffolder where to write manifests and open PRs. The Helm values tell the ArgoCD controller what to watch. A mismatch means PRs are raised to a location ArgoCD is not monitoring, namespaces will never be provisioned.

Developer Hub re-fetches each template file from GitHub on every template run. Once you push the updated defaults to the configured branch, the change takes effect immediately, no redeployment of Developer Hub is required. You must update all three template files.

Step 5 — Verify the ArgoCD NaaS Controller

When both argocd.enabled: true and catalog.naas.enabled: true are set in your values, the Helm chart renders an ArgoCD Application named <release>-naas-controller in the openshift-gitops namespace. This Application is configured as follows:

source:
  repoURL: <catalog.naas.gitopsRepoURL>
  targetRevision: <catalog.naas.templateBranch>
  path: <catalog.naas.namespacesPath>
  directory:
    recurse: true
    exclude: '**/catalog-info.yaml'    # Backstage entity, not a Kubernetes manifest

syncPolicy:
  automated:
    prune: true    # Removes cluster resources when manifests are deleted from Git
    selfHeal: true    # Reverts manual out-of-band changes
    allowEmpty: false
  syncOptions:
    - CreateNamespace=true
    - ServerSideApply=true    # Avoids client-side size limits; tracks field managers
    - RespectIgnoreDifferences=true
  retry:
    limit: 5
    backoff:
      duration: 5s
      factor: 2
      maxDuration: 3m

ignoreDifferences:
  - group: ""
    kind: Namespace
    jsonPointers:
      - /status
  - group: "v1"
    kind: ResourceQuota
    jsonPointers:
      - /status

catalog-info.yaml is excluded because it is a Backstage entity, not a Kubernetes resource — applying it to the cluster would fail. The ignoreDifferences configuration suppresses drift detection on Namespace.status and ResourceQuota.status fields, which are managed by the Kubernetes control plane and should not be treated as configuration drift.

Verify the controller is healthy after deployment:

oc get applications.argoproj.io -n openshift-gitops | grep naas-controller

You should see Synced and Healthy.

What the sync policy means for day-to-day operations:

  • New <namespacesPath>/<ns>/ directory merged → ArgoCD provisions the namespace and all its resources within the next sync cycle (with up to 5 retries using exponential backoff from 5s to 3m).
  • Directory removed from Git (deletion PR merged) → ArgoCD prunes all Kubernetes objects, including the Namespace itself.
  • Someone manually edits a namespace label or quota → ArgoCD reverts it back to the Git-declared state on the next sync. This is intentional.

Step 6 — Verify Template Registration

Enabling NaaS causes the Helm chart to render all three NaaS template URLs as catalog locations inside the app-config-catalog-locations ConfigMap — the single source of truth for all catalog.locations entries. Developer Hub loads this ConfigMap last, ensuring the NaaS locations are registered at startup.

Inspect the rendered ConfigMap to confirm the URLs are correct:

oc get configmap app-config-catalog-locations -n <namespace> -o yaml

Check the catalog.locations[].target fields in the output. For a default configuration they should look like:

https://github.com/your-org/your-gitops-repo/blob/main/quickstarts/fusion-developerhub/templates/naas/naas-request-template.yaml
https://github.com/your-org/your-gitops-repo/blob/main/quickstarts/fusion-developerhub/templates/naas/naas-update-template.yaml
https://github.com/your-org/your-gitops-repo/blob/main/quickstarts/fusion-developerhub/templates/naas/naas-delete-template.yaml

If a URL looks wrong, the most common cause is a mismatch between catalog.github.target (which must be a full org URL, e.g. https://github.com/your-org) and catalog.naas.repoName.

Pre-flight Checklist for Administrators

Before handing over NaaS to your developers, verify the following:

  • ☐ github-auth-secret exists in the Developer Hub namespace with GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, and GITHUB_TOKEN.
  • ☐ auth.github.enabled: true is set in your values so users can sign in with GitHub.
  • ☐ catalog.naas.enabled: true is set in your values (Helm or GitOps valuesObject).
  • ☐ argocd.enabled: true and argocd.rbac.enabled: true are set so the naas-controller Application is rendered.
  • ☐ Both namespace-validator OCI artifacts are built, tagged, and pushed to the registry referenced in namespaceValidator.ociRepository.
  • ☐ Helm values (naas.repoName, naas.templateBranch, naas.gitopsRepoURL, naas.namespacesPath) and the hidden fields in all three templates (repoOrg, repoName, targetBranch, namespacesPath) point at the same repository, branch, and path.
  • ☐ The app-config-catalog-locations ConfigMap is present and the three catalog.locations[].target URLs resolve correctly: oc get configmap app-config-catalog-locations -n <namespace> -o yaml.
  • ☐ The <release>-naas-controller ArgoCD Application is in Synced / Healthy state: oc get applications.argoproj.io -n openshift-gitops | grep naas-controller.
  • ☐ The Developer Hub service account has get/list on namespaces and user.openshift.io/groups in the cluster.
  • ☐ At least one test namespace can be created end-to-end (signed in as a GitHub user, not guest) before announcing to the wider team.

Part 2: Developer Guide

Once your platform team has completed setup, here is everything developers need to know.

You must be signed in with your GitHub account. Guest sessions do not produce a USER_OAUTH_TOKEN and cannot raise Pull Requests. If you see "Sign in with GitHub" on the Developer Hub homepage, click it before proceeding.

Requesting a New Namespace

  1. Open Developer Hub and sign in with your GitHub account.
  2. Click Create in the left sidebar (or the + icon).
  3. Search for naas or filter by the naas tag. You will see three templates:
    • Request OpenShift Namespace (NaaS) — create a new namespace
    • Update OpenShift Namespace (NaaS) — resize or change access on an existing namespace
    • Delete OpenShift Namespace (NaaS) — permanently remove a namespace
  4. Click Request OpenShift Namespace (NaaS) and walk through the four-step wizard.

Step 1 — Namespace Details

Field Description Example Notes
Project Name Unique lowercase identifier. The namespace will be named <projectName>-<environment>. A live availability indicator shows as you type. payments-api Must match ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$, no uppercase, no underscores
Environment Target tier. development Options: development, staging, production
Business Unit / Cost Center Applied as a chargeback label on the namespace. engineering Options: engineering, marketing, finance, retail

Step 2 — Resource Sizing

Choose a pre-configured size tier. The tier drives the ResourceQuota and the LimitRange applied to the namespace. You can always upsize later using the Update template.

Tier CPU Requests CPU Limits Memory Requests Memory Limits Max Pods Max Services Storage Max PVCs
Small 4 cores 8 cores 8 Gi 16 Gi 20 10 100 Gi 10
Medium 8 cores 16 cores 16 Gi 32 Gi 40 20 200 Gi 20
Large 16 cores 32 cores 32 Gi 64 Gi 100 50 500 Gi 50

The LimitRange also sets per-container defaults (used by pods that don't specify their own resources):

Tier Container Default CPU Container Default Memory Container Default Request CPU Container Default Request Memory
Small 1 core 2 Gi 250m 512 Mi
Medium 2 cores 4 Gi 250m 512 Mi
Large 4 cores 8 Gi 250m 512 Mi

Step 3 — Access Control

The group fields are populated from live OpenShift group names in the cluster via the namespace-validator plugin (OcGroupField). Three roles are created in the namespace:

Field Role bound Permissions Required?
Owner Group namespace-admin Full control (* on all resources) — for team leads and namespace owners Yes
Developer Group namespace-developer Create/update Deployments, StatefulSets, Pods, Services, ConfigMaps, Jobs, Routes; read Secrets No
Viewer Group namespace-viewer Read-only (get, list, watch) on all resources — for stakeholders and auditors No

A <projectName>-cicd ServiceAccount is also automatically created and bound to namespace-admin for pipeline use, no manual action required.

The groups must already exist in the cluster. If your group hasn't been created yet, ask your platform team before submitting.

Step 4 — ArgoCD Application (Optional)

This step lets you wire an ArgoCD Application to the namespace at provision time. Set the toggle to Yes and fill in the repository details to have ArgoCD automatically deploy your application manifests into the new namespace.

Field Description Example
Create an ArgoCD Application? Toggle to Yes to reveal the ArgoCD fields No (default)
Repository URL HTTPS URL of the application repository https://github.com/my-org/my-app
Application Name Short name used as the ArgoCD Application name my-app
Target Revision Branch, tag, or commit SHA to track main
Path Path within the repository where manifests or Helm chart live deploy/overlays/dev
Source Type How ArgoCD interprets the path: Directory or Helm chart Directory

Leave the toggle as No to skip ArgoCD wiring — you can add it later using the Update template. When wiring is enabled, the Application details are stored as namespace annotations (naas.fusion.ibm.com/argo-*), so the Update template can pre-populate this step the next time you edit the namespace.

Review and Submit

After completing the wizard, a pre-flight check validates that <projectName>-<environment> does not already exist in the cluster. A Review step then summarises your visible selections (hidden platform fields are not displayed). Click Create to submit.

What Happens After You Click Create

The scaffolder runs up to six automated steps in sequence, you can watch progress in real time in the output panel:

  1. Validate Namespace Availability (naas:namespace:available) — the scaffolder checks <projectName>-<environment> directly with the cluster before generating any files. The request fails immediately before a PR is opened when the namespace already exists.
  2. Fetch Manifest Skeleton (fetch:template) — Your wizard inputs and the hidden platform defaults are substituted into the skeleton/ YAML templates using Nunjucks. The rendered files are placed at <namespacesPath>/<projectName>-<environment>/ ready to be committed.
  3. Fetch ArgoCD Application Skeleton (fetch:template, conditional) — if you opted in to ArgoCD wiring in Step 4, the scaffolder also renders argocd-application.yaml and places it alongside the other manifests. Skipped when the toggle is No.
  4. Publish to GitOps Repository (publish:github:pull-request) — The rendered files are pushed to a new branch named naas-<projectName>-<environment> using your USER_OAUTH_TOKEN, and a Pull Request is opened against the configured base branch (typically main). The PR description includes a formatted Markdown table of all your inputs. Configured reviewers (if any) are automatically requested.
  5. Tag Pull Request Labels (github:issues:label) — The PR is labelled with NaaS - Provision, Project Name: <name>, Environment: <env>, Business Unit: <bu>, and Size: <size> for easy filtering by the platform team.
  6. Register in Catalog (catalog:register) — The catalog-info.yaml from the PR branch is registered as a Backstage Resource entity in the Developer Hub Software Catalog immediately — before the PR is even merged.

At the end of the run, two links appear in the output panel:

  • View Pull Request — takes you directly to the GitHub PR
  • View Catalog Entry — takes you to the namespace resource in the catalog

Note: The availability check fails closed when cluster availability cannot be determined. It reduces duplicate requests but does not eliminate the time-of-check/time-of-use gap: a namespace can be created after validation and before ArgoCD applies the manifests. Cluster admission and ownership controls remain authoritative where strict global uniqueness is required.

Approval and Provisioning

The Pull Request is the approval gate. Once your platform team reviews and merges it:

  1. ArgoCD detects the new <namespacesPath>/<projectName>-<environment>/ directory in the repository within its next sync cycle.
  2. ArgoCD applies all manifests to the cluster using server-side apply. Namespace infrastructure (quota, limits, network policies, RBAC) syncs at wave 0; the ArgoCD Application (if wired) syncs at wave 1, after the namespace exists.
  3. The namespace is live, fully configured, and ready for workloads.

You can confirm provisioning is complete with:

# Namespace is Active
oc get namespace <projectName>-<environment>

# All resources are present
oc get resourcequota,limitrange,networkpolicy,role,rolebinding \
  -n <projectName>-<environment>

Updating an Existing Namespace

Use the Update OpenShift Namespace (NaaS) template to resize quota or change team access. The first step presents a pre-populated Namespace Selection field (NaaSProjectField) that lists all NaaS-managed namespaces from the cluster and automatically fills in the current Business Unit, Size, Owner Group, Developer Group, and Viewer Group from the selected namespace's stored labels. The ArgoCD Application step pre-fills from the namespace's stored naas.fusion.ibm.com/argo-* annotations when an ArgoCD Application was previously configured.

The update PR branch is named naas-update-<projectName>-<environment> and is labelled NaaS - Update. ArgoCD applies the updated manifests over the existing ones using server-side apply, changing only what has changed. Common scenarios:

Scenario What to change
Workload hitting quota limits Increase the Size tier
A new team member joined Add their group to Developer Group
Cost centre changed Update Business Unit / Cost Center
Transferring ownership Change Owner Group to the new team's group
Adding GitOps deployment wiring Enable the ArgoCD Application toggle and fill in the details

Changing Project Name or Environment in the Update form does not rename the namespace, it creates a new set of manifests at a different path. To rename, delete the old namespace and create a new one.

Deleting a Namespace

Use the Delete OpenShift Namespace (NaaS) template when a project is retired. The first step presents a Namespace Selection field (NaaSDeleteField) that lists only NaaS-managed namespaces.

The template opens a PR that removes the entire <namespacesPath>/<projectName>-<environment>/ directory from the GitOps repository, including namespace.yaml, resource-quota.yaml, limit-range.yaml, network-policy.yaml, rbac-role.yaml, catalog-info.yaml, and argocd-application.yaml (if present). When merged, ArgoCD detects the removed manifests and deprovisions all Kubernetes objects, including the Namespace itself, thanks to the prune: true setting. The PR branch is named naas-delete-<projectName>-<environment> and is labelled NaaS - Delete.

The deletion field includes a safety confirmation: you must type the namespace name exactly as it will appear (<projectName>-<environment>) before you can submit.

⚠️ Deletion is permanent. All workloads, PVCs, and configuration inside the namespace are gone once the PR is merged and ArgoCD syncs. Back up anything important before merging the deletion PR.

Viewing Your Namespaces in the Catalog

Every namespace provisioned through NaaS appears in the Developer Hub Software Catalog as a Resource entity of type openshift-namespace, tagged with namespace, openshift, naas, and the environment name.

  1. Click Catalog in the left sidebar.
  2. Filter by Kind: Resource and search for your project name.

The entry is created at submission time, so your team can discover it immediately, even before the PR is approved. The entity is kept in the catalog until the deletion PR is merged and the catalog-info.yaml file is removed from the repository.

Summary

Namespace as a Service brings self-service, policy-compliant namespace provisioning to OpenShift through a Developer Hub wizard backed by GitOps. Developers get their namespaces faster with no ticket queue. Platform teams get a clear, auditable approval gate. ArgoCD ensures the cluster never drifts from the declared state. The Namespace Validator Plugin adds live availability checks and pre-populated selectors that make the Request, Update, and Delete flows fast and error-resistant.

0 comments
46 views

Permalink