Kubernetes Deployment

AI Guard is deployed as a Kubernetes pod within the OneTrust Workernode namespace alongside existing Data Discovery services. This guide covers the Helm integration, configuration, and operational considerations.

Prerequisites

  • A running OneTrust Workernode Kubernetes cluster
  • TLS certificates (PEM format) for the AI Guard service
  • Network connectivity to the OneTrust tenant for token validation
  • The AI Guard Docker image available in your container registry

Helm Integration

The AI Guard installer uses the existing OneTrust on-prem installer framework (ot-onprem-installer-v2). Follow the pattern established by other Workernode services.

1. Define Environment Variables

Add AI Guard environment variables to data-discovery/shared/utils/all_envs.yaml with appropriate defaults:

  • AI_GUARD_SERVICE_PORT
  • OT_SERVICE_BASE_URL
  • JOB_EXECUTOR_BASE_URL
  • DATADISCOVERY_ONPREM_AGENT_URI
  • TLS_KEY_PATH
  • CERTIFICATE_PATH
  • RUST_LOG

2. Create a ConfigMap

Map Helm .Values to the environment variables:

apiVersion: v1
kind: ConfigMap
metadata:
  name: ai-guard-config
  namespace: {{ .Values.OT_NAMESPACE_DD }}
  labels:
    app: ai-guard
data:
  AI_GUARD_SERVICE_PORT: "{{ .Values.AI_GUARD_SERVICE_PORT }}"
  OT_SERVICE_BASE_URL: "{{ .Values.OT_SERVICE_BASE_URL }}"
  JOB_EXECUTOR_BASE_URL: "{{ .Values.JOB_EXECUTOR_BASE_URL }}"
  DATADISCOVERY_ONPREM_AGENT_URI: "{{ .Values.DATADISCOVERY_ONPREM_AGENT_URI }}"
  TLS_KEY_PATH: "{{ .Values.TLS_KEY_PATH }}"
  CERTIFICATE_PATH: "{{ .Values.CERTIFICATE_PATH }}"
  RUST_LOG: "{{ .Values.RUST_LOG }}"

3. Create a Deployment

Create a Deployment template for the ai-guard pod, referencing the ConfigMap and mounting TLS secrets:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ai-guard
  namespace: {{ .Values.OT_NAMESPACE_DD }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ai-guard
  template:
    metadata:
      labels:
        app: ai-guard
    spec:
      containers:
        - name: ai-guard
          image: docker.onetrust.dev/ai-guard:latest
          ports:
            - containerPort: 4443
          envFrom:
            - configMapRef:
                name: ai-guard-config
          volumeMounts:
            - name: tls-certs
              mountPath: /etc/ssl/litenode
              readOnly: true
          livenessProbe:
            httpGet:
              path: /health
              port: 4443
              scheme: HTTPS
            initialDelaySeconds: 5
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /health
              port: 4443
              scheme: HTTPS
            initialDelaySeconds: 5
            periodSeconds: 10
      volumes:
        - name: tls-certs
          secret:
            secretName: ai-guard-tls

4. Create a Service

Expose port 4443 within the cluster and, if required, externally:

apiVersion: v1
kind: Service
metadata:
  name: ai-guard
  namespace: {{ .Values.OT_NAMESPACE_DD }}
spec:
  selector:
    app: ai-guard
  ports:
    - port: 4443
      targetPort: 4443
      protocol: TCP
  type: ClusterIP  # Or LoadBalancer/NodePort for external access

Configuration Reference

All configuration is managed through environment variables set via the ConfigMap. See Service Configuration for the full reference.

Config PathEnv VarDefaultDescription
service.listenAI_GUARD_SERVICE_PORT0.0.0.0:4443Listen address and port
service.authorization.validation-endpointOT_SERVICE_BASE_URLβ€”OneTrust token validation URL
service.tls.key-pathTLS_KEY_PATH/etc/ssl/litenode/tls.keyTLS private key
service.tls.certificate-pathCERTIFICATE_PATH/etc/ssl/litenode/tls.crtTLS certificate
classification.client.classifier-base-urlJOB_EXECUTOR_BASE_URLhttp://scan-job-manager:8080Classification profiles URL
metrics.exporter.collector-endpointDATADISCOVERY_ONPREM_AGENT_URIhttp://datadiscovery-onprem-agent:8080Metrics endpoint
metrics.exporter.intervalMETRICS_EXPORT_INTERVALhourExport interval
β€”RUST_LOGinfoLog verbosity

Observability

Logging

AI Guard emits structured JSON logs in Elastic Common Schema (ECS) format to stdout. Logs fall into three categories:

CategoryDescriptionExamples
LifecycleStartup, shutdown, and configuration eventsserver not configured for TLS, server shutdown clean
RequestHTTP request/response loggingMethod, path, status, latency in ms
ErrorFatal errors causing process exitMissing config, TLS failures, crypto provider errors

Log severity is based on response status: INFO for 2xx/3xx, WARN for 4xx, ERROR for 5xx.

Graceful Shutdown

On SIGTERM or SIGINT:

  1. The signal name is logged
  2. The HTTP server stops accepting new connections
  3. The metrics exporter is flushed and shut down
  4. The process exits with code 0

What's Next?