How Laravel Cloud Packs Kubernetes Nodes Efficiently | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://msaied.com) - [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [About](https://msaied.com#about)

           [  Contact](https://msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://msaied.com)
- [ProjectsCase studies](https://msaied.com/projects)
- [ArticlesEngineering notes](https://msaied.com/articles)
- [CertificatesCredentials](https://msaied.com/certificates)
- [AboutHow I work](https://msaied.com#about)
- [ContactGet in touch](https://msaied.com#contact)

  [Start a conversation](https://msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://msaied.com)
2. /
3. [Articles](https://msaied.com/articles)
4. /
5. [Laravel](https://msaied.com/articles?category=laravel)
6. /
7. How Laravel Cloud Packs Kubernetes Nodes Efficiently

   [Laravel](https://msaied.com/articles?category=laravel) 

 How Laravel Cloud Packs Kubernetes Nodes Efficiently
=====================================================

 Laravel Cloud runs on AWS EKS and pays for nodes by the hour. This post explains how the team tunes the Kubernetes scheduler, moves single-replica apps without downtime, and uses pod disruption budgets to keep costs low.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://msaied.com#person) Published 1 Dec 2026 · Updated 2 Dec 2026 · 4 min read

ShareCopy linkCopied

 ![How Laravel Cloud Packs Kubernetes Nodes Efficiently](https://cdn.msaied.com/841/c1d2916389c95533967f0a593b3c14e0.png) 

  On this page +1. [Why Node Packing Matters on Laravel Cloud](#why-node-packing-matters-on-laravel-cloud)
2. [Tuning the Kubernetes Scheduler](#tuning-the-kubernetes-scheduler)
3. [Moving Single-Replica Apps Without Downtime](#moving-single-replica-apps-without-downtime)
4. [Controlling the Rate When Many Pods Move at Once](#controlling-the-rate-when-many-pods-move-at-once)
5. [Setting Pod Disruption Budgets Correctly](#setting-pod-disruption-budgets-correctly)
6. [What Kubernetes May Handle Natively in the Future](#what-kubernetes-may-handle-natively-in-the-future)
7. [Key Takeaways](#key-takeaways)

 Why Node Packing Matters on Laravel Cloud
-----------------------------------------

Laravel Cloud runs on Amazon EKS and pays for EC2 nodes by the hour. Every idle node costs money, so the engineering team is incentivized to pack pods as tightly as possible and remove nodes that are no longer needed.

By default, the Kubernetes scheduler does the opposite — it spreads pods across nodes to balance resource usage. Laravel Cloud needs the reverse: dense nodes that are easy to drain and delete.

Tuning the Kubernetes Scheduler
-------------------------------

The scheduler's default spreading behavior can be overridden by setting a custom `scoringStrategy`. Laravel Cloud uses `type: MostAllocated`, which favors nodes where resources are already heavily allocated, provided the incoming pod still fits.

```yaml
# kube-scheduler config (simplified)
profiles:
  - pluginConfig:
      - name: NodeResourcesFit
        args:
          scoringStrategy:
            type: MostAllocated

```

This setting became available in EKS in August 2026. Before that, the team built a custom operator to replicate the same behavior.

Moving Single-Replica Apps Without Downtime
-------------------------------------------

Packing new pods is straightforward. The harder problem is moving pods that are already running — especially single-replica apps, which have no spare capacity to absorb a restart.

If a nearly-empty node is simply deleted, Kubernetes terminates the pod and then schedules a replacement. During the image pull and startup of the new pod, the application is completely offline.

The solution is to treat the move like a rolling update:

1. Trigger a rolling update by adding a benign annotation to the pod template.
2. Wait for the replacement pod to become **ready** on another node.
3. Only then terminate the original pod.

This keeps the old pod serving traffic while the new one warms up, resulting in zero downtime even for single-replica deployments.

Controlling the Rate When Many Pods Move at Once
------------------------------------------------

When consolidating two nodes where one is nearly full, moving every pod simultaneously creates two problems:

- Multiple image pulls compete for bandwidth, slowing replacements.
- Several replicas of the same app can go offline together, cutting serving capacity.

For apps with more than one replica, Laravel Cloud uses **pod disruption budgets (PDBs)** to limit evictions to one replica per app at a time. Draining a node takes longer, but each app retains most of its capacity throughout the process.

Setting Pod Disruption Budgets Correctly
----------------------------------------

No single PDB configuration works for every app size:

- `minAvailable: 1` blocks single-replica apps from ever being disrupted.
- `maxUnavailable: 1` still causes a brief outage for single-replica apps without a rolling-update trigger.
- `minAvailable: 50%` protects single-replica apps but allows half the capacity of larger apps to go offline.

The team solved this with a custom operator that applies different rules based on replica count:

```yaml
# Single-replica apps
minAvailable: 1   # blocks Karpenter; rolling update is triggered first

# Multi-replica apps
maxUnavailable: 1  # allows one pod to move at a time

```

The operator sets `minAvailable: 1` on single-replica apps to give the rolling-update controller time to act, then falls back to `maxUnavailable: 1` for everything else.

What Kubernetes May Handle Natively in the Future
-------------------------------------------------

The upstream **EvictionRequest API** (targeting Kubernetes 1.38 alpha) would let controllers intercept evictions before they happen. A companion proposal to support replacement-first evictions in the Deployment controller is tentatively slated for Kubernetes 1.39. If both land, the custom operator machinery may no longer be needed.

Key Takeaways
-------------

- Use `MostAllocated` scoring to pack pods onto fewer nodes from the start.
- Trigger rolling updates before evicting single-replica pods to avoid downtime.
- Use pod disruption budgets to rate-limit moves and protect app capacity.
- Custom operators are worth the investment when YAML alone cannot solve the problem.
- Consolidation can be slow — disrupting customers is never acceptable, but taking extra time is fine.

> **Note:** Single-replica apps are protected during routine maintenance, but unplanned node failures, application bugs, or network issues can still cause outages. For business-critical workloads, run at least two replicas.

---

*Source: [How Laravel Cloud packs Kubernetes nodes efficiently](https://laravel.com/blog/how-cloud-packs-kubernetes-nodes)*

- [Laravel Cloud](https://msaied.com/articles?search=Laravel%20Cloud)
- [Kubernetes](https://msaied.com/articles?search=Kubernetes)
- [EKS](https://msaied.com/articles?search=EKS)
- [Pod Disruption Budgets](https://msaied.com/articles?search=Pod%20Disruption%20Budgets)
- [Node Packing](https://msaied.com/articles?search=Node%20Packing)
- [DevOps](https://msaied.com/articles?search=DevOps)

 Frequently asked questions 
---------------------------

  How does Laravel Cloud move single-replica apps without causing downtime?Instead of deleting the pod and waiting for a replacement, Laravel Cloud triggers a rolling update by adding an annotation to the pod template. The old pod continues serving traffic while the new pod pulls its image and starts on another node. Only after the replacement is ready does the original pod terminate.

   Why doesn't a single pod disruption budget configuration work for all apps on Laravel Cloud?Single-replica apps and multi-replica apps have conflicting requirements. `minAvailable: 1` prevents any disruption to a single-replica app, while `maxUnavailable: 1` still causes a brief outage without a rolling-update trigger. Laravel Cloud uses a custom operator to apply `minAvailable: 1` for single-replica apps and `maxUnavailable: 1` for everything else.

   When might Laravel Cloud no longer need its custom node-packing operator?The upstream Kubernetes EvictionRequest API (targeting alpha in 1.38) and a proposed replacement-first eviction feature in the Deployment controller (tentatively 1.39) could handle this natively. If both proposals land, the custom operator machinery would become unnecessary.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://msaied.com#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://msaied.com#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleHow Laravel News Cut Its Laravel Cloud Bill Nearly in Half](https://msaied.com/articles/how-laravel-news-cut-its-laravel-cloud-bill-nearly-in-half)  

   On this page
-------------

1. [Why Node Packing Matters on Laravel Cloud](#why-node-packing-matters-on-laravel-cloud)
2. [Tuning the Kubernetes Scheduler](#tuning-the-kubernetes-scheduler)
3. [Moving Single-Replica Apps Without Downtime](#moving-single-replica-apps-without-downtime)
4. [Controlling the Rate When Many Pods Move at Once](#controlling-the-rate-when-many-pods-move-at-once)
5. [Setting Pod Disruption Budgets Correctly](#setting-pod-disruption-budgets-correctly)
6. [What Kubernetes May Handle Natively in the Future](#what-kubernetes-may-handle-natively-in-the-future)
7. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://msaied.com#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/840/0ea4b7fd609b1d36553ed8f714446b8d.png) Laravel · 3 min read### How Laravel News Cut Its Laravel Cloud Bill Nearly in Half

30 Nov 2026 ](https://msaied.com/articles/how-laravel-news-cut-its-laravel-cloud-bill-nearly-in-half) [ ![](https://cdn.msaied.com/839/00788b998da006f2c5774a37cd2ca409.png) Laravel · 4 min read### Laravel AutoBuilder: Build Visual Automation Workflows in Your Laravel App

27 Nov 2026 ](https://msaied.com/articles/laravel-autobuilder-build-visual-automation-workflows-in-your-laravel-app) [ ![](https://cdn.msaied.com/837/a736608b65db9fe102769f6c2479bef1.png) Laravel · 4 min read### Pun: Format, Lint, and Analyze PHP With One Rust Binary

26 Nov 2026 ](https://msaied.com/articles/pun-format-lint-and-analyze-php-with-one-rust-binary) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://msaied.com#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://msaied.com)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://msaied.com/sitemap.xml)
