Overview
The NemoGuardrails resource provides guardrail services for AI safety and content moderation. It integrates with NIM endpoints and supports configuration via ConfigMap or PVC.
API Group: apps.nvidia.com
API Version: v1alpha1
Kind: NemoGuardrail
Spec Fields
Container image configuration. Container image repository
Guardrail configuration source. Either ConfigMap or PVC must be specified, not both. ConfigMap containing guardrail configuration ConfigMap name (minimum length: 1)
PVC containing guardrail configuration Whether to create the PVC
Subdirectory in PVC (defaults to “guardrails-config-store”)
NIM endpoint configuration for LLM inference. Base URL for NIM service or NIM proxy (pattern: ^https?:\/\/[^\s]+\/v1\/?$, format: uri)
Secret containing API key for NIM proxy access
apiKeyKey
string
default: "NIM_ENDPOINT_API_KEY"
Key in secret containing API key
Optional PostgreSQL database configuration for persistent storage. Database hostname (minimum length: 1)
Database name (minimum length: 1)
Database credentials Secret containing password
Key in secret for password
OpenTelemetry configuration. Enable OpenTelemetry tracing
OTLP collector endpoint URL
Disable Python logging auto-instrumentation
Exporter configuration Traces exporter (enum: otlp, console, none)
Metrics exporter (enum: otlp, console, none)
Logs exporter (enum: otlp, console, none)
excludedUrls
array
default: "[\"health\"]"
URLs to exclude from tracing
Log level (enum: INFO, DEBUG)
Service exposure configuration. Service configuration Service type (e.g., ClusterIP, LoadBalancer)
Ingress/Gateway router configuration
Number of replicas (minimum: 1). Cannot be set when autoscaling is enabled.
Autoscaling configuration. Enable horizontal pod autoscaling
Metrics collection configuration. Enable metrics collection
Prometheus ServiceMonitor configuration
Override container command
Additional environment variables
Resource requirements (CPU, memory)
User ID for container security context (default: 1000)
Group ID for container security context (default: 2000)
Status Fields
Number of available replicas
Current state (Pending, NotReady, Ready, Failed)
Example
apiVersion : apps.nvidia.com/v1alpha1
kind : NemoGuardrail
metadata :
name : nemoguardrails-sample
namespace : nemo
spec :
configStore :
pvc :
name : "pvc-guardrail-config"
create : true
storageClass : ""
volumeAccessMode : ReadWriteOnce
size : "1Gi"
nimEndpoint :
baseURL : "http://meta-llama-3-1-8b-instruct.nemo.svc.cluster.local:8000/v1"
databaseConfig :
host : guardrail-pg-postgresql.nemo.svc.cluster.local
port : 5432
databaseName : guardraildb
credentials :
user : guardrailuser
secretName : guardrail-pg-existing-secret
passwordKey : password
expose :
service :
type : ClusterIP
port : 8000
image :
repository : nvcr.io/nvidia/nemo-microservices/guardrails
tag : "25.10"
pullPolicy : IfNotPresent
pullSecrets :
- ngc-secret
metrics :
serviceMonitor : {}
replicas : 1
resources :
limits :
cpu : "1"
ephemeral-storage : 10Gi