Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Your company is deciding whether to keep running Java services on self-managed Kubernetes clusters or move to a managed serverless container platform. As the senior technical leader, how do you evaluate this over several years?

I would compare the total cost over three to five years, including the platform team, cluster upgrades and idle capacity, against per-use pricing at our real traffic, and check how well Java fits a serverless platform: JVM cold starts against scale-to-zero, memory-based pricing, long-lived connections and background work. I would weigh lock-in and exit cost, and check skills, compliance, networking and observability. Then I would pilot a representative set of services and decide per class of workload, not for the whole company at once.

Why this question is asked

Platform decisions like this one shape a company's cost, speed and hiring for years, and they are hard to reverse. Self-managed Kubernetes gives control at the price of a team that runs it; a managed serverless container platform (services such as Google Cloud Run, AWS Fargate with App Runner or ECS, or Azure Container Apps) removes most of that work but charges for usage and constrains how services run. Interviewers ask this to see whether a senior leader can structure a multi-year decision with evidence rather than enthusiasm. In this answer, we will look at the cost model, the specific fit of JVM workloads, lock-in, the non-functional requirements, and how a pilot turns all of this into a decision per workload class.

1What We Are Really Comparing

On self-managed Kubernetes, we pay for nodes whether pods use them or not, and we pay people: a platform team that upgrades clusters every few months, patches nodes, runs ingress, autoscalers, policy engines and monitoring, and is on call for all of it. In return we control everything, can run any workload shape and can pack nodes tightly.

On a serverless container platform, we hand over a container image and a few settings. The provider runs and scales the instances, often down to zero, and bills per vCPU-second and GiB-second of instance time, sometimes only while requests are being handled. We give up control over the node, the network path and many runtime details.

2Total Cost Over Several Years

A fair comparison counts everything on both sides over three to five years. For Kubernetes: nodes, including the idle share (at 30 percent utilisation, 70 percent of node spend is idle), the platform team's salaries, support contracts and tools, and the effort of upgrades. For serverless: the per-use price at our actual traffic, including the always-on minimum instances we would keep to avoid cold starts, plus any extra networking and logging charges.

The answer depends on the traffic shape. Spiky or low-traffic services win big on serverless, because they stop paying for idle capacity. Services that run hot 24 hours a day are often cheaper on well-packed nodes, because per-second pricing carries a premium. That is why the result is rarely all one way.

Cost model inputs (example, per year)
ItemSelf-managed KubernetesServerless containers
Compute$1.2M nodes, 30% used$0.7M usage at real traffic
Minimum instancesn/a$0.15M to avoid cold starts
Platform team6 engineers, about $1.1M2 engineers, about $0.4M
Upgrades and tooling$0.2M$0.05M
Steady high-load servicescheaper when well packedpremium per vCPU-second
Numbers are illustrative; the point is to count people and idle capacity, not only compute.

3How Well Java Fits a Serverless Platform

Java brings specific questions. Cold start: a Spring Boot service can take 5 to 20 seconds to start and longer to warm, so scale-to-zero means the first users after a quiet period wait. We either keep minimum instances, which costs money, or invest in faster start with class data sharing, the JDK AOT cache, CRaC where the platform supports it, or native images.

Memory-based pricing: JVM services often need 1 to 2 GiB per instance, and many platforms tie CPU to memory, so a memory-hungry service pays for CPU it does not use. Long-lived connections and background work: some platforms throttle CPU outside request handling unless configured otherwise, limit request duration, or recycle instances freely. Kafka consumers, schedulers, WebSocket servers and in-memory caches may behave badly there. We check each platform's rules for these, because they decide which services can move at all.

4Lock-In and the Cost of Leaving

Lock-in is not all or nothing. The container image, environment-based configuration, standard health endpoints and OpenTelemetry instrumentation are portable. Platform-specific deployment descriptors, IAM bindings, event triggers and proprietary service discovery are not. We estimate what an exit would cost: how many services, how many weeks to rewrite deployment and networking, and whether contracts lock us in. Keeping the application side portable, for example by deploying through our own pipeline and avoiding provider-specific SDKs in code, keeps that cost low.

5Skills, Compliance, Networking and Observability

Some requirements can rule a platform out. Compliance may require data residency, dedicated tenancy or specific audit logs. Networking may need private connectivity to on-premises systems, fixed egress IPs or a service mesh with mutual TLS. Observability may depend on a Java agent, a sidecar or eBPF tooling that a managed platform does not allow. And skills cut both ways: a smaller platform team is cheaper, but losing Kubernetes expertise makes it harder to return. We list each requirement and mark whether each platform meets it, partly meets it with work, or cannot.

6Piloting and Deciding per Workload Class

Instead of a single decision, we group services into classes: spiky synchronous APIs, steady high-throughput APIs, event consumers, scheduled jobs and stateful or connection-heavy services. We pick two or three representative services from the most promising classes and run them on the serverless platform for a month or two, with real traffic, measuring cost, p99 latency including cold starts, deployment effort and incident load. The result is usually a mixed estate: spiky APIs and jobs move, steady heavy services and consumers stay, and the Kubernetes footprint shrinks, which reduces but does not remove the platform team. We set a review point after a year to check the real numbers against the model.

Step throughDeciding per workload class
  1. Group services into classesspiky API, steady API, consumer, job, stateful
  2. Hard requirement unmet?
    YesClass stays on KubernetesNoPilot 2 or 3 services
  3. Measure in pilotcost, p99 with cold starts, effort
  4. Better on cost and SLO?
    YesMigrate the class in wavesNoKeep on Kubernetes
  5. Review after one yearreal numbers against the model

5 steps in order. Play them, or step through them one at a time.

7Follow-up questions

Is serverless always cheaper for low-traffic services?

Usually, because they stop paying for idle capacity. But a Java service that needs warm minimum instances to meet its latency target pays for those instances all day, which can erase the saving. The pilot must include the minimum instances the SLO requires.

What happens to the platform team?

It shrinks or changes focus rather than disappearing. Someone still owns the golden path, the deployment pipeline, policies, networking and cost reporting, and runs whatever stays on Kubernetes. Planning that change openly matters for keeping the people whose skills we still need.

How do you avoid a half-migrated mess?

By deciding per class with clear criteria and keeping one deployment pipeline and one observability standard across both platforms, so teams do not care much where a service runs. A mixed estate is fine if it is deliberate.

8Conclusion

In this answer, we compared self-managed Kubernetes with a serverless container platform the way a senior leader would over several years. We counted total cost including people and idle capacity, checked the fit for JVM workloads (cold starts, memory pricing, background work), estimated lock-in and exit cost, listed compliance, networking, observability and skills requirements, and used pilots to decide per workload class rather than for everything at once.

What to say in the interviewAbout 80 seconds aloud

Open with

I would avoid making this a single all-or-nothing call. First I would build a multi-year cost model that is honest on both sides: for Kubernetes, the nodes including the idle share, the platform team, upgrades and tooling; for serverless, per-use pricing at our real traffic, including the minimum instances we would need to avoid Java cold starts.

Then, if they want more

Then I would check fit for Java specifically. Spring Boot services start slowly, so scale-to-zero means cold starts unless we pay for warm instances or invest in faster startup like CDS, the JDK AOT cache or native images. Pricing is often tied to memory, and JVMs need memory.

And some platforms restrict background CPU, request duration or long-lived connections, which matters for Kafka consumers and schedulers. Next, lock-in: containers, standard probes and OpenTelemetry are portable, platform-specific triggers and IAM are not, so I would estimate the exit cost. I would also check compliance, private networking, observability agents and the skills we would lose.

Finally I would group services into classes, pilot two or three representative services per promising class for a couple of months, measure cost, p99 including cold starts and operational effort, and decide per class. The likely outcome is a mixed estate with a smaller Kubernetes footprint, reviewed after a year.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Kubernetes documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your company is deciding whether to keep running Java services on self-managed...": https://scrivio-interview-library.netlify.app/spring-boot/containers-and-kubernetes/d40e191daa/