---
title: "Virtual machines, containers, or Kubernetes: how much infrastructure do we need?"
description: "Virtual machines, containers, and Kubernetes explained with a practical example, including criteria for isolation, operation, and scaling."
canonical: https://i8.ro/en/blog/virtual-machines-containers-or-kubernetes-how-much-infrastructure-do-we-need
---

# Virtual machines, containers, or Kubernetes: how much infrastructure do we need?

> Virtual machines, containers, and Kubernetes explained with a practical example, including criteria for isolation, operation, and scaling.

Source: https://i8.ro/en/blog/virtual-machines-containers-or-kubernetes-how-much-infrastructure-do-we-need

**Series II: From infrastructure to agentic projects in production. Episode 02 of 20.**

In the previous episode, we decided where the pieces of a fictional B2B portal for requests and documents might run. The next question is how we package and manage them. A virtual machine, a container, and Kubernetes are not simply different sizes of the same product. They solve different problems and can work together. For an SMB, the main decision is what level of separation and automation the team can support, at the availability required by the business.

## What each option isolates

A **virtual machine** or VM is a computer defined by software, with its own operating system. A **hypervisor** splits the resources of a physical server between several VMs. For example, a company can separate the application from the database and manage or restore each environment according to a plan. If all VMs depend on the same physical server, shutting down that server can affect them all. Virtualization alone does not guarantee high availability.

A **container** is an isolated process along with the files and libraries the application needs. Multiple containers on the same system share the operating system kernel, unlike VMs, which each run their own OS. A **container image** is the package from which the process starts. This helps reproduce the environment from development to production, but doesn't automatically include persistent data, backups, or security updates. The isolation of a container also depends on privileges, volumes, networking, and host configuration; don't assume it's always equivalent to VM-level separation.

You don't have to choose between VMs and containers. A VM can host multiple containers, maintaining a clear boundary between the application and other company systems. **Docker Compose** can describe the services, networks, and volumes of a multi-container application and has official instructions for production use. However, you still need a separate plan for updates, monitoring, backups, and host failures.

## What Kubernetes adds

**Orchestration** means that a platform tracks the desired state of components and tries to run them where resources are available. Kubernetes distributes containerized workloads across **nodes**, which are the machines in a cluster. A **Pod** is the runtime unit that groups one or more containers. A Deployment can maintain the required number of Pods for a stateless component and coordinate rolling updates.

These features become valuable when the application has replicas—instances of the same component—across multiple nodes, frequent changes, and real requirements for scaling or recovery. Even so, Kubernetes doesn't build the application, doesn't provide a database by default, and by itself doesn't solve storage, observability, or security. A production cluster requires decisions about nodes, networking, certificates, access control, storage, updates, and control plane availability—that is, the services that manage the cluster. A managed service can offload some tasks to the provider, but the team remains responsible for application and data configuration.

Google's research on Borg, Omega, and Kubernetes describes experience managing containers at scale. It's context for the orchestration challenge, not proof that every small company needs that level of complexity. Don't size your project according to the architecture of a global platform.

## The B2B portal: a starter scenario

Let’s assume, explicitly as a **hypothetical scenario**, that the portal’s interface and API—the entry point for exchanging requests—run in a cloud environment, while the documents and database initially stay on the company’s infrastructure. The latency and connectivity conditions from episode 01 should be measured before committing to such a split. A test version might use a VM for the application part, with separate containers for the interface, API, and a background process that processes requests. The database and documents are kept in a separate environment, managed according to company policies. Access between environments is controlled—the database is not exposed directly to the public.

The background process can later include an **AI agent integrated into the portal** to classify a request or suggest a summary for an operator. The AI agents the team uses to develop and test code are something else: their access and work environments are set up separately. A container for the agent inside the application does not automatically grant it the right to read all documents or approve a request.

In this variant, Compose can describe the application’s services. For the database, we choose a solution with persistence and tested backups, either on a VM or in a managed service if data placement allows. We never keep the only copy of documents in a container’s temporary layer. A single application server remains a single point of failure: in the project sheet we note the accepted recovery time, who intervenes, and what happens if the VM or the connection between environments fails. This is a proposal to be validated, not a certified architecture for any portal.

For each release, we keep the container image version, applied configuration, and rollback steps. An automatic restart can bring back a process, but doesn’t fix a bad data change. Even rolling back to a previous image doesn’t automatically reverse a database schema change. That’s why we test upgrades and restores in a separate environment, using suitable test data, before allowing real requests. We measure downtime and inform operators what functions are unavailable.

## When is an extra step worth it?

Before jumping to Kubernetes, check if the problem is really multi-node orchestration. It might be enough to fix a manual delivery process, separate the database, add monitoring, or test restoration. If requests increase, measure load, operation times, and incident frequency. A clear need for application replication on distinct nodes, seamless upgrades, and a team able to operate the platform may justify considering Kubernetes or a managed service. Even then, availability depends on the real configuration and failure testing.

| Component | Proposed pilot setup | Verification question |
| --- | --- | --- |
| Interface and API | Containers within an application VM | Can they be updated and restarted without losing requests? |
| Background process and portal agent | Separate container with limited permissions | What happens to a request retried after an error? |
| Database and documents | Separate environment with persistent storage | Was restore and cross-environment access tested? |
| Host and network | VM and connection explicitly managed | Who acts when the host or connection is shut down? |

The output is the portal run map: for each component, record the host, packaging form, persistent data, operational owner, failure scenario, and supporting test evidence. Add a precise condition for changing the solution, not a vague “scalability” promise. In the next episode we will separate the networks and decide what traffic is permitted between these components.

## Sources

- [Red Hat, *What is KVM?* (April 16, 2026)](https://www.redhat.com/en/topics/virtualization/what-is-KVM), for hypervisor and virtual machines.
- [Docker Docs, *What is a container?*](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-a-container/), for the difference between VM and container.
- [Docker Docs, *Use Compose in production*](https://docs.docker.com/compose/how-tos/production/), for using Compose in production.
- [Kubernetes, *Overview*](https://kubernetes.io/docs/concepts/overview/) and [*Production environment*](https://kubernetes.io/docs/setup/production-environment/), for operational functions and responsibilities.
- [Burns and collaborators, *Borg, Omega, and Kubernetes*, ACM Queue (2016)](https://research.google/pubs/borg-omega-and-kubernetes/), academic context on large-scale orchestration.
