Skip to lesson

NVIDIANVIDIA-Certified Professional: Agentic AI2026-108.5 Ensure continuous uptime, transparency, and trust in live deployments.

Preserve service through updates and outages

Completed by the knowledge check

Learning objective

Deploy updates without downtime and fail over to fallback models during dependency outages.

Core idea

Continuous service requires two different recovery paths. A planned update replaces a working serving revision while preserving enough capacity and finishing accepted requests. A dependency outage requires another qualified inference path, or an explicit degraded outcome when that path cannot perform the task safely.

See 4.2.3 for canary, blue-green, and shadow delivery, and 8.4.3 for promotion and rollback ownership. Here you decide whether the live service can actually survive replacement and dependency loss. A successful rollout command is insufficient: users need complete responses, compatible tool behavior, and bounded waiting throughout the transition.

How it works

Keep capacity available during replacement

The NIM Helm chart deploys a StatefulSet by default (statefulSet.enabled: true). Set statefulSet.enabled: false to create a Deployment; only in that mode does the chart apply deployment.strategy. The Deployment controls below do not apply to the default StatefulSet. See 7.2.3 and 4.2.3 for workload-mode and rollout choices.

A Kubernetes Deployment uses .spec.strategy.type: RollingUpdate to scale replacement ReplicaSets up while scaling previous ones down. Set .spec.strategy.rollingUpdate.maxUnavailable to 0 when the rollout must preserve the desired available replica count. Give .spec.strategy.rollingUpdate.maxSurge a positive value so a replacement can start before an available replica leaves. These fields cannot both be zero.

This is a capacity commitment. A surge replica needs schedulable resources while the existing replicas still occupy theirs. If the replacement cannot obtain a GPU, inspect the pending Pod and provision the required headroom rather than deleting a healthy replica to make progress. See 4.5.3 for recovery capacity and placement. Account for terminating Pods too: Kubernetes documents that their resource use can persist during the grace period, exceeding the apparent replicas + maxSurge bound.

A NIM health probe distinguishes process health from inference readiness. GET /v1/health/live returns 200 when the container is running; GET /v1/health/ready returns 200 when the model is loaded and ready to accept inference requests. Use the latter for a Kubernetes readinessProbe. A startupProbe delays liveness and readiness probing until startup succeeds, avoiding premature restarts while initialization is legitimately slow. Size its allowance from measured cold starts; see 7.2.1 for startup diagnosis.

Use .spec.minReadySeconds when a replacement must remain ready without crashing before Kubernetes counts it as available. That stabilizing interval is distinct from a task-quality test. A model can load successfully yet produce invalid tool arguments, so keep the release’s regression checks as a separate condition for promotion.

Finish accepted work before removing its worker

A ready replacement does not transfer an existing token stream from the terminating Pod. Kubernetes graceful termination runs a configured preStop hook before sending the termination signal, within the Pod’s terminationGracePeriodSeconds. Configure the serving process and routing layer to stop admitting work and finish accepted requests during that interval. Test the shutdown behavior with real streamed responses, not only short health requests.

A replacement is ready and counted as available before a terminating Pod receives its preStop hook and finishes accepted requests.

A replacement is ready and counted as available before a terminating Pod receives its preStop hook and finishes accepted requestsKubernetes lets a replacement start, probes GET /v1/health/ready, and gets 200 once the model is loaded and ready. The replacement must remain ready without crashing for minReadySeconds before it counts as available. Only then does Kubernetes run the terminating Pod's preStop hook and send the termination signal. Within terminationGracePeriodSeconds, that Pod finishes its accepted requests.Terminating PodReplacementKubernetesminReadySeconds:remain ready without crashingFinish accepted requestswithin grace periodReplacement can startGET /v1/health/ready200: model is loaded and readypreStop hookTermination signal

The Pod-level grace period defaults to 30 seconds. If your accepted request can legitimately run longer, the default can end it before completion. Include hook time and request completion in the configured allowance. Terminating endpoints always report ready: false, so load balancers stop sending them regular traffic; a draining-aware load balancer reads the endpoint’s actual readiness from the EndpointSlice serving condition.

For a stalled rollout, .spec.progressDeadlineSeconds reports ProgressDeadlineExceeded; it does not automatically restore the previous revision. The Deployment controller keeps retrying. Let the release controller or operator respond to that condition, and use kubectl rollout undo deployment/DEPLOYMENT_NAME when restoring the previous Deployment revision is appropriate. DEPLOYMENT_NAME identifies your Deployment. Preserve the broader rollback target from 8.4.3 when configuration or workflow changes extend beyond that resource.

Qualify the alternate inference path

In a Python LangChain agent, ModelFallbackMiddleware passed through create_agent(..., middleware=[...]) supplies an ordered set of alternative models when the primary model fails. Its first_model and additional positional models accept model identifiers or BaseChatModel instances. NVIDIA documents LangChain integration with NeMo Agent Toolkit through nvidia-nat[langchain] and lists NVIDIA NIM among LangChain’s LLM providers. Use NIM-served models as primary or fallback through LangChain’s model interface; ModelFallbackMiddleware is configured in the Python LangChain agent, not as a toolkit YAML component.

An alternative must survive the failure you are covering. A second model behind the failed dependency is not independent recovery. Document its deployment location, resource availability, data-handling approval, and supported task classes in the service’s fallback policy. Test it with the same structured responses, tools, and output checks as the primary; a model that can answer prose may still be unsuitable for a workflow that must issue tool calls.

Keep recovery inside the remaining request deadline and retry budget from 2.4.2. Use the circuit-breaker policy from 2.4.3 to avoid repeatedly admitting traffic to a failing dependency. Fallback does not repair an unavailable retrieval source, and changing the model cannot establish whether an earlier external write succeeded. Preserve the action-recovery rules in 2.4.4. Make degradation visible; see 8.5.2.

Key distinctions and trade-offs

ChoiceDeciding conditionMechanismCost or boundary
Rolling replacementDeployment-mode revision can overlap with replacementRollingUpdate, maxUnavailable: 0, positive maxSurgeRequires simultaneous capacity and tested draining
Recreate replacementService interruption is acceptable.spec.strategy.type: RecreateExisting Pods are killed before replacements are created
Qualified model fallbackAlternate path survives the dependency failure and passes task checksLangChain ModelFallbackMiddlewareReserved capacity, repeated inference cost, and possible reduced capability
Explicit degraded serviceNo qualified alternate can complete the affected taskService fallback policy and terminal outcomeLower coverage, but a clear limit rather than fabricated completion

Architecture / decision scenario

A manufacturing maintenance assistant serves read-only troubleshooting queries. The team runs the NIM Helm chart in Deployment mode with statefulSet.enabled: false. Three NIM replicas each sustain 8 requests per second within the team’s measured latency target; peak demand is 20. Each replica consumes one identical GPU allocation, and a fourth allocation is reserved for updates. These are scenario measurements, not NIM performance guarantees.

The platform owner proposes maxUnavailable: 1 to save surge capacity. Two replicas supply only 16 requests per second, below peak demand. The release owner instead chooses maxUnavailable: 0, maxSurge: 1, readiness against /v1/health/ready, and a measured draining allowance. For 45-second accepted streams and a 5-second shutdown hook, the team tests a 60-second grace period rather than accepting the 30-second default.

A routing outage then makes the primary NIM endpoint unreachable. A separately deployed fallback handles only 12 requests per second and passed troubleshooting tests but not diagnostic-image analysis. Routing all 20 requests per second to it creates another overload. The application owner permits text-only requests within the measured capacity and reports image diagnosis as unavailable. A rollout preserves capacity for planned replacement; qualified, bounded degradation handles the different failure. Neither decision authorizes unsupported answers.

Common exam traps

  • Expecting maxSurge to apply to the NIM chart’s default StatefulSet.
  • Setting maxUnavailable: 0 without providing schedulable surge resources.
  • Assuming a progress deadline performs automatic rollback.
  • Expecting an in-flight stream to move to the replacement Pod.
  • Sending every task to a weaker fallback regardless of capacity or capability.

What to remember

Preserve available capacity, wait for inference readiness, and drain accepted work. Treat fallback as a separately qualified service path with its own failure isolation and capacity limits. When that path cannot complete the task, report a bounded degraded outcome instead of turning transport availability into a claim of task success.

Knowledge check

References