Skip to main content

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

image
object
required
Container image configuration.
configStore
object
required
Guardrail configuration source. Either ConfigMap or PVC must be specified, not both.
nimEndpoint
object
NIM endpoint configuration for LLM inference.
databaseConfig
object
Optional PostgreSQL database configuration for persistent storage.
otel
object
OpenTelemetry configuration.
expose
object
Service exposure configuration.
replicas
integer
default:"1"
Number of replicas (minimum: 1). Cannot be set when autoscaling is enabled.
scale
object
Autoscaling configuration.
metrics
object
Metrics collection configuration.
command
array
Override container command
args
array
Container arguments
env
array
Additional environment variables
resources
object
Resource requirements (CPU, memory)
nodeSelector
object
Node selector labels
tolerations
array
Pod tolerations
affinity
object
Pod affinity rules
labels
object
Custom labels
annotations
object
Custom annotations
userID
integer
User ID for container security context (default: 1000)
groupID
integer
Group ID for container security context (default: 2000)
runtimeClass
string
Runtime class name

Status Fields

conditions
array
Current state conditions
availableReplicas
integer
Number of available replicas
state
string
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

Build docs developers (and LLMs) love