OpenShift
Red Hat OpenShift is an enterprise Kubernetes platform for hybrid and multicloud environments. Deploy NIM on self-managed OpenShift Container Platform (OCP), Red Hat OpenShift Service on AWS (ROSA), Azure Red Hat OpenShift (ARO), and Red Hat OpenShift Dedicated on Google Cloud with GPU Operator setup, deployment, and verification. The commands on this page have been tested on self-managed OCP, ROSA, ARO, and OpenShift Dedicated (GCP).
Note: The instructions for self-managed OCP apply universally to any OpenShift cluster provisioned by the user, whether running on bare metal, VMware vSphere, or cloud VMs such as GCP, AWS, or Azure. No cloud-specific deployment steps are required once the cluster is running.
Prerequisites
Before deploying NIM on OpenShift, make sure you have the following:
- An OpenShift cluster (self-managed OCP, ROSA, ARO, or OpenShift Dedicated on GCP) with GPU-capable nodes
- The
ocCLI, installed and authenticated withoc login - Helm 3
- An NGC API key for pulling NIM container images and downloading model artifacts
Install GPU Operators
NIM requires NVIDIA GPUs to be available as schedulable resources. This requires the Node Feature Discovery (NFD) Operator and the NVIDIA GPU Operator.
Install NFD Operator
To install the NFD Operator and label GPU nodes, complete the following steps:
-
Create the
openshift-nfdnamespace: -
Create the
OperatorGroup: -
Create the
Subscription: -
Wait for the NFD Operator to install:
-
Create a
NodeFeatureDiscoveryinstance to label GPU nodes:
Install NVIDIA GPU Operator
To install the NVIDIA GPU Operator and configure GPU drivers and device plugins, complete the following steps:
-
Create the
nvidia-gpu-operatornamespace: -
Create the
OperatorGroup: -
Create the
Subscription: -
Wait for the GPU Operator to install:
-
Create a
ClusterPolicyto configure GPU drivers and device plugins:
Verify GPU Availability
Wait for the GPU driver to build and for the device plugin to register GPUs. This process can take up to 20 minutes:
At least one node should show a GPU count of 1 or more.
Common Setup
The following resources are shared across all deployment methods. These commands have been tested on OpenShift 4.18.36 (ROSA), 4.19.20 (ARO), 4.21.0 (self-managed OCP), and 4.21.8 (OpenShift Dedicated on GCP) with NVIDIA GPU Operator v24.6, v25.3, and v25.10.
Create OpenShift Project
Create an OpenShift project for the NIM deployment:
Create NGC Image Pull Secret
Create an image pull secret so OpenShift can pull NIM container images from nvcr.io:
Create NGC API Secret
Create a secret that stores your NGC API key for use by the NIM container:
Configure the Security Context Constraint
OpenShift enforces SecurityContextConstraints (SCCs) that restrict which user IDs a pod can run as. The NIM container defaults to UID 1000 (non-root) and supports arbitrary UIDs that OpenShift assigns.
The Helm chart detects OpenShift and selects an SCC profile. The supported profiles are:
restricted-v2nonroot-v2
The chart renders pod, container, and init container security contexts that satisfy the selected SCC. This includes chart-managed init containers, such as ngc-model-puller, user-provided containers in initContainers.extraInit, and Helm test hook pods that run when you use helm test. The chart also annotates pods with openshift.io/required-scc so admission uses the selected SCC consistently. The openshift.scc value is the source of truth for this annotation. If you also set podAnnotations.openshift.io/required-scc, the chart replaces that annotation with the selected openshift.scc value and prints a note during Helm rendering.
For restricted-v2, user-provided podSecurityContext.runAsUser, podSecurityContext.runAsGroup, and podSecurityContext.fsGroup values from values.yaml are not rendered, and OpenShift injects namespace-valid UID and GID values during admission. For nonroot-v2, the chart keeps the default explicit pod security context values.
When an SCC profile is active, initContainers.extraInit[*].securityContext cannot override SCC-required fields. The chart rejects extra init containers that set privileged: true, allowPrivilegeEscalation: true, runAsUser: 0, or capabilities.add values other than NET_BIND_SERVICE.
Selection works in one of two modes:
- When
openshift.lookupScc: true, the chart probes the cluster and selects the first profile listed inopenshift.sccPrioritythat exists on the cluster. The Helm identity must have permission to get SCC resources at the cluster scope. - When
openshift.lookupScc: false(the default), the chart cannot verify which profiles the cluster supports, so automatic selection returns the first entry inopenshift.sccPriority. With the default priority list this resolves torestricted-v2, which is broadly available: it is included with every supported OpenShift release (4.11 and later) and is granted to all authenticated users by default. Overrideopenshift.sccPriorityto change which profile is selected in this mode.
On OpenShift 4.20 and later, restricted-v3 is the cluster’s default selected SCC for authenticated users. The chart’s openshift.io/required-scc: restricted-v2 annotation (rendered when openshift.annotateRequiredSCC is true, the default) overrides that cluster default and keeps admission on restricted-v2. If you see pod admission errors mentioning restricted-v3 or restricted-v2 access, refer to Troubleshooting OpenShift SCC Admission Failures.
If your service account does not have access to the selected SCC, grant the SCC before you deploy. For example, to grant restricted-v2 to the default service account:
To pin a specific SCC instead of using automatic selection, add the following values to your Helm values file:
Note: Support for the
restricted-v3SCC (introduced in OpenShift 4.20, with pod-level user namespaces) is deferred pending NVIDIA GPU Operator device plugin compatibility withhostUsers: false. When the upstream blocker is resolved, the chart will reintroducerestricted-v3as an available profile.
Create Model Cache PVC
Optional: For persistent model caching across pod restarts, create a PVC. NIM downloads models into ephemeral storage at startup when no PVC is configured.
Adjust storageClassName based on your OpenShift edition:
Note:
gp3-csi(ROSA) andstandard-csi(OpenShift Dedicated on GCP) only supportReadWriteOnce. Change theaccessModesin the PVC manifest fromReadWriteManytoReadWriteOncewhen using these StorageClasses.
Deploy NIM with Helm
The NIM LLM Helm chart is compatible with OpenShift. The chart defaults handle security context, GPU resources (nvidia.com/gpu: 1), image pull secrets (ngc-secret), the NGC API secret (ngc-api), and service configuration. Override only the values that are specific to your deployment.
Single GPU Deployment
The following examples show single-GPU deployment options using either a model-specific NIM image or a model-free NIM image.
Model-Specific NIM
To deploy a model-specific NIM container, complete the following steps:
-
Create a values file:
-
Deploy the chart:
Model-Free NIM
For model-free NIM container using the vLLM-OSS stack, complete the following steps:
-
Create a values file and set the model through environment variables:
-
Optional: For gated Hugging Face models, create an HF token secret:
-
Optional: Add
model.hfTokenSecret: hf-tokento your values file. -
Deploy the chart:
Enable Persistent Cache
Optional: To use the PVC created earlier, add these lines to your values file:
Monitor Deployment
Wait for the pod to be ready:
Wait until the pod status is Running and ready, then press Ctrl+C.
Expose NIM Service
OpenShift Routes provide automatic TLS termination and DNS. Create a Route for external access by using the following steps:
-
Create the Route:
-
Get the route host:
-
Print the endpoint:
Alternatively, use port-forward for local testing:
Verify Deployment
Verify that the deployment is ready and can serve inference requests through the OpenShift Route. If you are using port-forward for local testing, replace http://${NIM_URL} with http://127.0.0.1:8000 in the following commands.
-
Call the readiness endpoint to confirm that the service is ready:
-
Query the
/v1/modelsendpoint to discover the model name to use in inference requests: -
Send a chat completion request using the model name returned by
/v1/models:
Use the same model value as NIM_SERVED_MODEL_NAME for a model-free NIM or model.name for a model-specific NIM.
Run Helm Tests
Verify your deployment with built-in tests:
View Logs
Stream real-time logs from your NIM pods:
Cleanup
Use this section to remove the OpenShift deployment and related resources.
Uninstall NIM
Remove the NIM deployment resources in the following order.
-
Uninstall the Helm release:
-
Delete the persistent volume claims:
-
Delete the project:
Remove GPU Operators
Remove the GPU Operator resources first, and then remove the NFD resources.
-
Delete the GPU Operator
ClusterPolicy: -
Delete the GPU Operator CSV and subscription:
-
Delete the GPU Operator project:
-
Delete the
NodeFeatureDiscoveryinstance: -
Delete the NFD CSV and subscription:
-
Delete the NFD project:
OpenShift Dedicated (GCP): Remove GPU Machine Pool
If you created a GPU machine pool for OpenShift Dedicated on GCP, delete it:
ROSA: Remove GPU Machine Pool
If you created a GPU machine pool for ROSA, delete it:
ARO: Remove GPU MachineSet
If you created a GPU MachineSet for ARO, scale it down and delete it: