Platform Engineering18 November 20269 min read

From AI Prototype to Production — Part 7 of 10

Deploy and scale AI without confusing the layers

A container image, a Kubernetes cluster and an application platform solve different problems, and an AI service adds a layer most deployment plans forget: prompts, model routes and retrieval settings. Part 7 of From AI Prototype to Production gives a deployment decision matrix, the health checks, autoscaling and rollback rules that change for AI, and the test for when Kubernetes earns its complexity.

#Kubernetes#Containers#Platform Engineering#AI Engineering#Cloud Architecture
A workbench holding a few loose glass blocks, connected by a cyan line to a large, orderly frame of lit modules with a small yellow status light, in a dark workshop over a faint map of southern Africa.

The platform team at Swartberg Health Administrators, a fictional South African medical scheme administrator, arrived at the production planning meeting with a Kubernetes design for the member-query assistant. It had three node pools, a service mesh, a GitOps controller and a cluster autoscaler. The application team looked at what the assistant actually was: a stateless API that calls hosted models through the AI gateway, a queue of ingestion workers that keep the retrieval index fresh, a managed vector store and a managed database for conversation state. Nothing in it needed a GPU. Nothing in it needed custom scheduling.

The disagreement was real, and both sides had a point. The platform team wanted one consistent way to run every service for the next five years. The application team wanted to ship in six weeks with a team of four. The meeting went better once someone drew the layers on the whiteboard, because the two teams were using "Kubernetes", "containers" and "the platform" to mean different things.

CloudNala's Architecture Must Earn Its Complexity series makes the general case that complexity needs evidence, and the distributed-systems tax prices it. Kubernetes is the engine, not the platform lists what has to surround a cluster before it is usable. This part applies those ideas to AI services specifically: which components they have, where each should run, and what changes in health checks, scaling and rollback.

Five layers that get merged in conversation

Five deployment layers that are easy to confuseLAYERWHAT IT DECIDESAI serviceHarness, prompts, retrieval settings, model routesand evaluation sets: versioned as one releaseApplicationplatformDeploys, scales, routes traffic, keeps revisions andinjects secrets: bought as a service, or builtOrchestratorKubernetes schedules containers across machines.Optional: many platforms hide or replace itContainer imageA Docker build packages code, runtime anddependencies into one artefact you can signInfrastructureCloud region or data centre: CPU, GPU, network,storage and where the data physically sits
Read from the bottom up. A container image is a packaging format, not a platform. Kubernetes is one way to run containers, not the only one, and an application platform can provide deployment, scaling and revisions without your team operating a cluster. The top layer is the one most deployment plans forget: prompts, model routes and retrieval settings change behaviour as much as code does, so they ship and roll back together.

The container image is a packaging format. A Docker build puts code, runtime and dependencies into one artefact that runs the same way on a laptop, in a pipeline and in production. It is also the unit you scan, sign and record, as Part 6 explains.

The orchestrator schedules containers across machines and restarts them when they fail. Kubernetes is the common one. It is one way to run containers, not a requirement for using them.

The application platform is what developers actually deploy to: something that takes an image, runs it with secrets and configuration, routes traffic to it, scales it and keeps previous revisions. Cloud providers sell this as a managed service. Organisations that run Kubernetes have to build it themselves around the cluster.

The infrastructure is the region or data centre, with its CPUs, GPUs, network and storage, and the physical location of the data.

The AI service layer sits on top and is the one deployment plans most often leave out. Prompts, model routes, retrieval settings, tool definitions and evaluation sets change behaviour as much as code does. If they are not versioned and released together, no orchestrator can roll them back for you.

Separate the stateless from the stateful

Most AI services are a mix of components with very different deployment needs. Sort them before you choose a platform.

ComponentStateWhere it should usually runNote
API and agent harnessStateless per requestManaged container or app platformTask state goes to a durable store, never pod memory
Ingestion and embedding workersStateless, queue-drivenSame platform, scaled on queue depthIdempotent, so a replay does not duplicate chunks
Queue or event streamStatefulManaged serviceDead-letter queue with a named owner
Vector store or search indexStatefulManaged service where availableBack up, version and test restores like a database
Response cacheEphemeralManaged cacheMust respect permissions; see Part 5
Task state and checkpointsDurableManaged databaseSeparate from the system of record
Self-hosted model inferenceLarge images, GPU, slow startManaged inference, serverless GPU or dedicated GPU nodesOnly if you must host weights
SecretsSensitiveManaged secrets storeInjected at runtime, rotated

Swartberg's assistant had only the first six. Every stateful piece was already available as a managed service in a South African cloud region. That settled most of the argument: the work left for an orchestrator was running two stateless container types.

The deployment decision matrix

Managed AI serviceManaged container or app platformManaged KubernetesOn-premises containers or private cloud
What you operateConfiguration onlyImages, configuration, scaling rulesCluster add-ons, policies, upgrades, the platform around itEverything down to hardware
Team neededApplication teamApplication team with platform guardrailsA platform team with on-call coverPlatform and infrastructure teams
ScalingProvider-managedBuilt in, often to zeroFlexible, you configure itBounded by owned capacity
GPU self-hostingNot applicableWhere the region offers itYes, with node pools you manageYes, with hardware you buy
Fits whenThe service exists and meets requirementsStateless services calling hosted modelsMany services, a platform team, needs managed platforms cannot meetA hard rule keeps data or inference on site
Main riskFeature and region limitsPlatform limits on networking or runtimeOperating cost and skill concentrationCapacity, power and hardware lifecycle
Choosing where an AI service runsASK IN ORDERIF YESDoes a hard rule keep data orinference on your premises?On-premises containers or privatecloud, with a named operations owneryesnoIs every component statelessor a managed service?Managed container or appplatform: the defaultyesnoMust you host modelweights on GPUs?Managed inference or serverless GPU;check region and residency firstyesnoMany services, a platform team anda need managed platforms cannot meet?Managed Kubernetes, with theplatform built around ityesnoSimplify the design untilthe second answer is yes
Ask the questions in order. The first is a hard gate, because a legal or contractual rule overrides convenience. Most AI services that call hosted models through a gateway stop at the second question. Kubernetes appears last on purpose: it earns its place when several services, a team able to run it and a requirement the managed options cannot meet all hold at once. If none applies, simplify the design until the second answer is yes.

Swartberg's answer was the second column for the assistant and its workers, with managed services for every stateful component. The board wrote down three triggers that would reopen the Kubernetes question: a need to self-host models across several services, more than about ten services needing shared networking policy, or a platform limit that blocks a production requirement. These triggers are illustrative, a decision record rather than a benchmark.

Health checks, autoscaling and rollback change for AI

The mechanics are familiar. The defaults are not always right for AI services.

Health checks. Kubernetes distinguishes three probes: liveness decides when to restart a container, readiness decides when it may receive traffic, and startup confirms the application has started. The documentation warns that incorrect liveness probes can lead to cascading failures, with containers restarted under high load. For an AI service, keep liveness local: is the process responsive? Do not make it depend on the model provider. If liveness calls the provider, a provider slowdown restarts every pod at once. Use readiness for dependencies the instance cannot serve without, such as its configuration and secrets, and a startup probe for self-hosted models that take minutes to load. Managed platforms offer equivalent checks under different names.

Autoscaling. CPU is a poor signal for a service that spends most of its time waiting for a model. Scale request-serving instances on concurrency or latency, and workers on queue depth. KEDA, a Cloud Native Computing Foundation graduated project, scales Kubernetes workloads on events waiting to be processed and can scale to zero. Then add the limit most designs miss: the provider's token quota. Scaling ingestion workers from 5 to 50 does not help if the embedding endpoint allows a fixed rate per minute. It produces throttling errors and retries. Set the maximum instance count from the downstream quota, not from the platform's limit.

Rollback. The Kubernetes Deployment documentation states that a revision is created only when the Pod template changes, and that rolling back restores only the Pod template. Replica counts, and anything held outside the template, stay as they are. For an AI service, that means a prompt stored in a configuration service, a model route in the gateway or a new index version is not rolled back by rolling back the container. Swartberg treats the release as a bundle: image digest, prompt version, route table version, index version and evaluation result, recorded together and reversible together. Part 8 covers canary releases for that bundle.

Indexes and state. Rolling back code is quick. Rolling back a re-embedded index is not, unless you kept the previous index running in parallel. Plan index changes as migrations with a cut-over and a way back, as RAG is a data product describes.

Azure, AWS, Google Cloud and on-premises as patterns

The same patterns appear with each provider under different names. These are dated examples, checked on 18 November 2026, not recommendations.

PatternAzureAWSGoogle CloudOn-premises
Managed container platformContainer AppsElastic Container Service (ECS) with FargateCloud RunA packaged platform on your own cluster
Managed KubernetesAzure Kubernetes ServiceElastic Kubernetes ServiceGoogle Kubernetes EngineSelf-managed or vendor-supported distribution
Self-hosted GPU inferenceServerless GPUs in Container Apps, or GPU node poolsECS on GPU-capable EC2 instances, or GPU node groupsGPUs on Cloud Run, or GPU node poolsGPU servers you buy, power and cool

You do not need all four. Multicloud is a consequence of requirements, not a goal, as hybrid and multicloud without architecture theatre argues. Choose the provider per workload with choose the workload before the cloud, then apply the matrix within it.

The South African version

Region availability is where local designs most often change. All three hyperscalers named above operate cloud regions in South Africa, but not every service is offered in every region. When we checked on 18 November 2026, the region list for serverless GPUs in Azure Container Apps and the GPU region list for Cloud Run services did not include a South African region. A team that must keep health information and inference in the country may therefore need dedicated GPU capacity, a different service or an on-premises option for self-hosted models, while hosted model APIs reached through the gateway raise the cross-border question covered in Part 5. Check the current region lists for the exact service before you design around it.

Two other local factors matter. On-premises GPU capacity depends on reliable power and cooling, which adds backup power to the business case. And Kubernetes skills are concentrated in a small number of people in many South African organisations, so a cluster that only one engineer understands is an operational risk, not a platform. This is general information, not legal advice, on the residency question.

Deployment readiness checklist

  1. Draw the five layers for your service and name who owns each.
  2. Sort every component into stateless, stateful and ephemeral; put stateful pieces in managed services where they meet requirements.
  3. Apply the decision path in order, starting with any hard residency rule.
  4. Build images reproducibly, sign them and deploy by digest.
  5. Keep liveness checks local; use readiness for required dependencies and a startup probe for slow-loading models.
  6. Scale on concurrency, latency or queue depth, capped by the downstream token quota.
  7. Release and roll back the AI bundle together: image, prompt, routes, index and evaluation result.
  8. Keep the previous index available until a new one has passed evaluation.
  9. Check region availability for every service you depend on.
  10. Write down the triggers that would justify Kubernetes, and revisit them on a date.

Scorecard contribution

This part adds evidence to four rows of the Production Readiness Scorecard. States are Swartberg's, illustrative.

DomainEvidence from this partSwartberg state
DeploymentReproducible signed images, health checks, quota-capped scaling, bundle rollbacktested
ResilienceProvider-independent liveness, parallel index for rollbackhypothesis
OperationsOwner per layer, platform decision record with review triggerstested
EconomicsScale-to-zero workers, instance limits set from provider quotahypothesis

Previous: Part 6, Secure the whole AI supply chain. Next: Part 8, AgentOps in practice. All parts are on the series page.

How CloudNala can help

CloudNala helps teams choose and build the deployment platform for AI services on evidence. We sort your components by state, apply the decision path against your residency rules and the region services available to you, set health checks, scaling limits and bundle rollback for the AI layer, and write the decision record with the triggers that should reopen it. You leave with a deployment design your team can run with the people it has, and a clear answer on whether Kubernetes has earned its place yet.


Work with CloudNala

CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.

Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.

Book an AI Deployment Architecture Review or write to us at consult@cloudnala.co.za

Found this useful?

Share