Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Define the deployment standards for Spring Boot services on Kubernetes across your organisation.

I would define the standard as a shared Helm chart or set of templates whose defaults already contain probes, graceful shutdown, resources and a restrictive security context, plus a standard set of JVM flags such as MaxRAMPercentage and an explicit GC choice. Availability comes from PodDisruptionBudgets and topology spread across zones, the image policy allows only approved base images, signed images and no root, and every rollout uses one strategy with automatic rollback based on health checks and metrics. Teams change values, not structure, and policies in the cluster enforce the parts that must not be skipped.

Why this question is asked

When each team writes its own Kubernetes manifests, the same mistakes repeat across the organisation: liveness probes that check the database, no preStop delay, a fixed -Xmx that gets pods OOMKilled, all replicas in one zone, containers running as root. A standard fixes these once. Interviewers ask this design question to see whether we know which settings matter and how to make a standard that teams adopt rather than avoid. In this answer, we will design the shared chart, the JVM defaults, availability settings, the image policy and the rollout strategy, and then see how to keep the standard alive.

1A Shared Chart With Safe Defaults

The core of the standard is a shared Helm chart, or an equivalent set of Kustomize bases, owned by the platform team and versioned like a library. A service's deployment becomes a short values file: image, replicas, resources and a few service-specific settings. Everything else comes from the chart with defaults that are right for a Spring Boot service, so doing the right thing takes no effort.

Java
# values.yaml of one service; everything not listed comes from the chart
image: registry.acme.com/orders:1.4.2
replicas: 3
resources: { cpu: "1", memory: 1536Mi }
# chart defaults the team gets for free:
# startup/liveness/readiness probes on /actuator/health/{liveness,readiness}
# preStop sleep 10s, terminationGracePeriodSeconds 45
# securityContext: runAsNonRoot, readOnlyRootFilesystem, drop ALL capabilities,
# allowPrivilegeEscalation false
# memory request = limit, JAVA_TOOL_OPTIONS with the standard JVM flags

The probes point at Boot's dedicated liveness and readiness groups, never at the full health endpoint, so a database outage never restarts pods. The shutdown defaults give Boot's graceful shutdown time to finish in-flight requests after the load balancer stops sending traffic. The security context denies root and write access to the root file system; services that need to write get an explicit emptyDir for /tmp. Teams can override values with a reason, but the chart's structure is the same everywhere, so a platform engineer can read any service's deployment in a minute.

2Standard JVM Flags

The JVM's defaults are made for general machines, not containers, so the standard sets a few flags for every service through JAVA_TOOL_OPTIONS in the chart. -XX:MaxRAMPercentage=75 sizes the heap from the container limit and leaves a quarter for metaspace, threads and other native memory. -XX:+ExitOnOutOfMemoryError makes a heap exhaustion end the process so Kubernetes restarts it, instead of leaving a half-broken pod serving errors.

We also choose the garbage collector explicitly. The JVM picks Serial instead of G1 when it sees fewer than 2 CPUs or less than about 1792 MB, which is common for small pods, and that choice changes pause behaviour silently. So the standard says G1 by default, -XX:+UseG1GC, and allows generational ZGC for latency-sensitive services with larger heaps. Standard flags also make performance comparable across services and let the platform change them centrally when a new JDK improves the defaults.

3Availability: Disruption Budgets and Topology Spread

Pods are not only lost to failures but also to planned work: node upgrades and cluster autoscaling drain nodes all the time. A PodDisruptionBudget tells Kubernetes how many pods of a service may be unavailable at once during such voluntary disruptions; with 3 replicas and maxUnavailable: 1, a drain waits rather than taking two pods down together. The chart creates one for every service with more than one replica.

Topology spread constraints place replicas across zones and nodes, so a zone outage or a single node failure takes only a fraction of the service. Without them, the scheduler may well put all three replicas on the same node. The chart sets a spread across topology.kubernetes.io/zone with maxSkew: 1 by default. Together with at least 2 replicas for every production service, these settings remove the most common causes of avoidable downtime.

Step throughLayers of the deployment standard
  1. Rolloutrolling or canary, metric checks, automatic rollback
  2. AvailabilityPodDisruptionBudget, zone spread, 2+ replicas
  3. Pod specprobes, preStop, grace period, resources, security context
  4. JVMMaxRAMPercentage, ExitOnOutOfMemoryError, explicit GC
  5. Imageapproved base, signed, non-root, scanned

5 layers, from the top down. Step through them one at a time.

4Image Policy

Every image must be built on an approved base image or builder owned by the platform team, must be signed by the CI pipeline, for example with Sigstore cosign, and must run as a non-root user. These rules are enforced in the cluster by an admission controller such as Kyverno or OPA Gatekeeper, which rejects pods whose image is unsigned, comes from an unknown registry, has critical vulnerabilities with a fix available, or requests root.

Enforcing at admission matters because templates can be bypassed; a policy in the cluster cannot. We introduce each policy in audit mode first, which reports violations without blocking, give teams a deadline to fix them, and only then switch to enforce, with a documented exception process for the rare service that needs something special.

5Rollout Strategy and Automatic Rollback

The standard defines one way to roll out a new version. For most services, a rolling update with maxUnavailable: 0 and maxSurge: 25 percent, so capacity never drops, gated by readiness probes. For critical services, a canary with a tool such as Argo Rollouts or Flagger: 10 percent of traffic first, then checks of error rate and p99 latency against the previous version for 10 minutes, then the rest. If the checks fail, or new pods do not become ready within a deadline, the rollout stops and rolls back automatically.

Step throughCanary rollout with automatic rollback
  1. Deploy new version to 10% of pods
  2. Pods ready within 5 minutes?
    YesShift 10% of trafficNoRoll back
  3. Error rate and p99 within limits for 10 min?
    YesPromote to 50%, then 100%NoRoll back
  4. Record resultdeploy log, alert owner on rollback

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

6Keeping the Standard Alive

A standard written once decays. We keep it alive by treating the chart as a product: semantic versions, release notes, automated pull requests to services when a new version ships, and a dashboard showing which services are on which chart version and which policies they pass. We review it every quarter with a few service teams, because the teams who run it find the gaps first, and we add a rule to it after every incident whose cause was a missing default.

7Follow-up questions

Should teams be allowed to write their own manifests?

They can for genuinely special workloads, but they then own the risk and must still pass the cluster's admission policies. In practice, if the chart's defaults are good and overriding a value is easy, almost nobody wants to. The goal is that the standard path is also the easiest path.

Why set memory requests equal to limits?

It gives the pod a guaranteed amount of memory, so the scheduler places it only where that memory exists and the kernel does not reclaim it under pressure from other pods. JVM heap sizing is based on the limit, so a request far below it would let nodes be overcommitted and pods be killed when neighbours grow.

How do we roll out a change to the chart across all services?

We release a new chart version and let a bot open pull requests to each service, which then go through the normal pipeline with the service's own tests and rollout checks. Critical fixes get a deadline; others are merged as teams release. The adoption dashboard shows who is left behind.

8Conclusion

In this answer, we designed Kubernetes deployment standards around a shared Helm chart whose defaults include probes on Boot's liveness and readiness groups, graceful shutdown, resources and a restrictive security context; standard JVM flags such as MaxRAMPercentage, ExitOnOutOfMemoryError and an explicit GC choice; PodDisruptionBudgets and zone topology spread for availability; an image policy of approved bases, signed images and no root enforced at admission; and one rollout strategy with automatic rollback based on health and metrics.

What to say in the interviewAbout 80 seconds aloud

Open with

I would make the standard something teams consume, not a document they read. The core is a shared Helm chart owned by the platform team, so a service's deployment is a short values file.

Then, if they want more

Its defaults contain the things teams usually get wrong: startup, liveness and readiness probes on Boot's dedicated health groups, so a database outage never restarts pods; a preStop sleep and a grace period longer than Boot's graceful shutdown; memory requests equal to limits; and a security context with non-root, a read-only root file system and no extra capabilities.

The JVM flags are standard too, set through JAVA_TOOL_OPTIONS: MaxRAMPercentage around 75, ExitOnOutOfMemoryError, and an explicit G1, because small pods otherwise get the Serial collector silently. For availability, the chart adds a PodDisruptionBudget and topology spread across zones, with at least two replicas in production.

The image policy allows only approved base images, signed by CI, running as non-root, and an admission controller like Kyverno enforces it, introduced in audit mode first. Rollouts use one strategy: rolling updates with no lost capacity, or canaries for critical services, with automatic rollback when error rate or latency checks fail.

Then I would treat the chart as a product with versions, automated upgrade pull requests and an adoption dashboard.

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
Spring Boot reference
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 "Define the deployment standards for Spring Boot services on Kubernetes across your...": https://scrivio-interview-library.netlify.app/spring-boot/packaging-and-deployment/4d9c268dd8/