Book a free call

How to Implement Kubernetes Without Breaking Your App

Implement Kubernetes by starting with a managed cluster and moving one service first. Here is the six-step plan and the first cluster layout.

Hertiv engineering teamReviewed by a senior engineer
6 min read
How to Implement Kubernetes Without Breaking Your App
On this page

Short answer

Kubernetes is a platform that schedules, scales and heals containerised applications across a group of servers. Implementing it means setting up a cluster, packaging your services as containers, and letting the platform decide where each one runs and when to restart it.

What does implementing Kubernetes mean?

Kubernetes is a platform that schedules, scales and heals containerised applications across a group of servers. Implementing it means setting up a cluster, packaging your services as containers, and letting the platform decide where each one runs and when to restart it.

Before Kubernetes, teams ran each service on a specific server and managed scaling and restarts by hand. With Kubernetes, you describe the desired state, how many copies of each service should run and what resources they need, and the platform works to keep reality matching that description, even when a server fails.

Capability What it does
Scheduling Places each container on a server with room
Scaling Adds or removes copies as load changes
Self-healing Restarts failed containers automatically
Service discovery Lets services find each other by name
Rolling updates Replaces old versions without downtime
Storage Attaches disks to the containers that need them

Implementing Kubernetes is mostly an operations project, not a rewrite. The application code changes little; the deployment, networking and monitoring around it change a lot. Learn the basics first in what Kubernetes is.

When does Kubernetes fit, and when does it not?

Kubernetes fits when you run several services that need to scale, recover and deploy independently. It does not fit every project, and teams that adopt it for a single small application usually pay more in operations than they save in flexibility.

It fits well when you have three or more services, traffic that rises and falls, more than one team deploying, or a need to run the same setup in several environments. It fits badly for a single small app, a short-lived project, a team with no one to operate the cluster, or a workload that is mostly one large database with little to scale.

A useful test is the deployment question: if your team deploys several times a week and deploys are already painful, Kubernetes helps. If you deploy once a month and it works, the platform adds machinery you do not need yet. Compare it with the alternative in Kubernetes vs Docker before committing.

How to implement Kubernetes in 6 steps

You implement Kubernetes by choosing how the cluster is run, containerising the services, writing the deployment files, and moving one service at a time until the platform proves itself.

  1. Pick managed or self-hosted. A managed cluster from a cloud provider runs the control plane for you; self-hosting gives control but adds operations work. Most teams start managed.
  2. Design the cluster. Decide the number of nodes, the node size, and how environments are separated, usually with namespaces for development, staging and production.
  3. Containerise the services. Package each service as a container image with a clear entry point, health endpoint and configuration through environment variables.
  4. Write the manifests. Create a deployment, a service and an ingress for each app, with resource requests and limits so the scheduler can place them sensibly.
  5. Add observability. Set up logs, metrics and alerts before the first real traffic, so a failing pod is visible instead of silent.
  6. Migrate one service first. Move the least risky service, run it in parallel with the old setup, compare behaviour, then move the rest one at a time.

Resist the urge to move everything in one weekend. A staged migration gives the team time to learn the platform while the old setup still works as a fallback.

What does a first cluster look like?

A first cluster is small on purpose: two or three worker nodes, one namespace per environment, and one deployment per service, each with a service in front of it and an ingress routing outside traffic in.

Component What it is First-cluster choice
Nodes Servers that run containers Two or three workers
Namespace Separation inside a cluster One per environment
Deployment Desired copies of a service Two replicas each
Service Stable address for a deployment One per service
Ingress Outside traffic routing One shared ingress
ConfigMap and Secret Settings and credentials One per service

Two replicas per service is the right default for a first cluster: it proves that the platform can run more than one copy and survive one pod failing, without the cost of a large setup. Keep the database outside the cluster at first, or run it with a managed service, since stateful workloads are the hardest part to get right.

Example (hypothetical): moving a 3-service app

Example (hypothetical): a team moves a shop app with three services, web, checkout and email, onto a small cluster. Each service runs two replicas, so the cluster runs 6 pods in total.

Each pod requests 0.5 CPU and 512 MB of memory. The total request is 6 times 0.5 CPU, which is 3 CPU, and 6 times 512 MB, which is 3,072 MB, about 3 GB of memory.

The team provisions two nodes with 2 CPU and 4 GB each, giving 4 CPU and 8 GB in total, which leaves 1 CPU and about 5 GB of headroom for the platform itself and for a short traffic spike.

Deploys that used to take 30 minutes of manual steps now take about 5 minutes with a rolling update, because the platform replaces pods one at a time and checks each new pod before moving on. The arithmetic is the point: requests, limits and node size are numbers you can plan from, not guesses.

What does it cost to run?

The cost of running Kubernetes has three parts: the control plane, the nodes, and the storage and network around them. A managed control plane is usually a flat monthly fee, while nodes are billed by size and hours, so the bill follows the size of the cluster.

The biggest cost driver is over-provisioning. Teams that set resource requests far above what services actually use pay for idle capacity on every node, and teams that run three separate clusters for three environments pay three times. A single cluster with namespaces is usually cheaper to start.

Keep costs under control by setting requests from measured usage, not guesses, by using autoscaling to shrink at quiet times, and by reviewing the bill monthly. Vendor prices change, so check the vendor's pricing page for current rates; the guide on Kubernetes cost explains the parts in more detail.

For a team that wants help with the setup, DevOps services cover cluster design and operations.

What are the common mistakes?

The most common Kubernetes mistakes are moving everything at once, setting resource requests by guesswork, and treating the cluster as set-and-forget after launch.

  • Big-bang migration. Moving every service in one weekend leaves no fallback when something breaks. Move one service, learn, then move the next.
  • Guessed resource requests. Requests that are too high waste money; limits that are too low kill pods under load. Measure real usage first.
  • No health checks. Without readiness and liveness checks, the platform cannot tell a broken pod from a healthy one, and traffic goes to both.
  • Secrets in manifests. Credentials committed to a repository are a breach waiting to happen. Use the platform's secret store.
  • No monitoring. A cluster that nobody watches fails silently. Alerts on pod restarts, pending pods and node pressure are the minimum.
  • Running the database inside the cluster too early. Stateful workloads need careful storage and backup design. Start with a managed database.

Key takeaways

  • Kubernetes schedules, scales and heals containers so you stop managing servers by hand
  • Start managed, move one service first, and keep the old setup as a fallback
  • Two replicas, one namespace per environment and measured resource requests are a good first cluster
  • Set requests from measured usage and review the bill monthly
  • Health checks and monitoring are not optional; without them failures stay silent

Frequently asked questions

Do I need to rewrite my app for Kubernetes?

Usually not. If your app already runs in a container with a health endpoint and configuration through environment variables, it can run on Kubernetes with little change. The bigger work is deployment, networking and monitoring around it.

Should I use a managed cluster or host my own?

Most teams should start with a managed cluster, where the cloud provider runs the control plane. Self-hosting gives more control but adds patching, upgrades and failure handling that a small team may not have time for.

How many nodes does a first cluster need?

Two or three worker nodes are enough for a first cluster. That gives room for two replicas of each service and survives one node failing, without the cost of a large setup. Add nodes when measured usage says so.

What is the hardest part of Kubernetes?

Operations, not the application code. Networking, storage, upgrades and monitoring cause most of the trouble. Teams that plan for operations from the start have a much smoother first year with the platform.

Can Kubernetes run a database?

Yes, but stateful workloads need careful storage, backup and recovery design. Most teams start with a managed database outside the cluster and move stateful workloads in only when they have the operations experience.

How long does it take to implement Kubernetes?

A small team can have a first service running on a managed cluster in a few weeks. Moving a full set of services, with monitoring, backups and team training, usually takes a few months.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: software products in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a Kubernetes move for your team? Talk to Hertiv.

A senior engineer replies within one business day. Or see our DevOps service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call