Asynx
Back to Blog
DevOps Guide

Deploying a Turborepo into Kubernetes

Thinking of Heroku or Render? This isn't that blog. This guide is for developers and DevOps engineers looking to deploy their Turborepo into custom Kubernetes environments like k8s or k3s.

V
Vijayaraghavan
12/16/2025
4 mins read
turborep

So, you've built a TurboRepo with Next.js for the frontend and NestJS for the backend, and now you're wondering:


Integration Point

Shared Goal / Description 

Quick Action

Responsive Design

Ensures a seamless user experience across all devices, a critical baseline for modern sites.

Start mobile-first and test at multiple breakpoints (320–1440 px).

Component-Based UI

Reusable components boost consistency and development speed.

Maintain shared component library

Design Systems & Tokens

Centralizes colors, spacing, and typography, preventing style drift.

Sync design tokens between Figma/Sketch and CSS variables or Tailwind config.

Accessibility

Broadens audience reach and ensures compliance.

Fix critical issues at each sprint.

Performance Optimization

Directly impacts SEO, conversions & user satisfaction.

Optimize images, lazy load & non-critical asse

"How the heck do I get this thing running on Kubernetes?"

Don’t worry you’re not alone.


unknown node


Deploying microservices (or even monorepos) into Kubernetes can feel intimidating when you're just starting. Between YAML files, Docker images, namespaces, pods, services… it's easy to get lost.


In this blog, we're going to walk through exactly how to deploy your TurboRepo to Kubernetes, step by step without the fluff, without the overwhelm.


We'll cover everything you need - creating Docker images, defining Kubernetes deployments, setting up services, and applying them all to your cluster. If you're serious about taking control of your infrastructure or passionate about custom server deployment, this guide is for you.


🛠️Prerequisites

✔️A running Kubernetes cluster (k8s) or a lightweight alternative like k3s

✔️Docker images built and pushed for frontend and backend:

  • apps/web (Next.js frontend)
  • apps/api (NestJS backend)

If not already build, refer to: How to deploy a Turborepo (Next.js + NestJS) on Any Server using Docker


📂TurboRepo Structure

typescript
1apps/
2web/ ← Next.js 15.2.1 (Frontend)
3api/ ← NestJS 11.1.2 (Backend)
4packages/ ← Shared libraries


Step 1: Create a Namespace for your app

Think of a namespace like a folder where your application and it's related stuffs lives. Let create one.

File: namespace.yaml

typescript
1apiVersion: v1
2kind: Namespace
3metadata:
4name: asynx-turborepo-tutorial
5labels:
6name: asynx-turborepo-tutorial


Step 2: Create Deployment for web (frontend)

File: web-deployment.yaml

typescript
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4name: web-deployment
5namespace: asynx-turborepo-tutorial
6spec:
7replicas: 2
8selector:
9matchLabels:
10app: web
11template:
12metadata:
13labels:
14app: web
15spec:
16containers:
17- name: web
18image: 192.168.0.103:5000/asynx-web-stage:latest #Replace your image URL here
19ports:
20- containerPort: 3000
21resources:
22requests:
23memory: "512Mi" #Adjust Minimum guaranteed memory for your web deployment
24cpu: "500m" #Adjust Minimum guaranteed CPU for your web deployment
25limits:
26memory: "1Gi" #Adjust maximum memory that can be availed for your web deployment
27cpu: "1000m" #Adjust maximum CPU that can be availed for your web deployment

Tested and working - feel free to copy paste, but always strive to understand the concept.


Step 3: Create deployment for api (Backend)

File: api-deployment.yaml

typescript
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4name: api-deployment
5namespace: asynx-turborepo-tutorial
6spec:
7replicas: 2
8selector:
9matchLabels:
10app: api
11template:
12metadata:
13labels:
14app: api
15spec:
16containers:
17- name: api
18image: 192.168.0.103:5000/asynx-api-stage:latest #Replace your image URL here
19ports:
20- containerPort: 3001
21resources:
22requests:
23memory: "512Mi" #Adjust Minimum guaranteed memory for your api deployment
24cpu: "500m" #Adjust Minimum guaranteed CPU for your api deployment
25limits:
26memory: "1Gi" #Adjust maximum memory that can be availed for your api deployment
27cpu: "1000m" #Adjust maximum CPU that can be availed for your api deployment

Tested and working - feel free to copy paste, but always strive to understand the concept.


Step 4: Create Services to Expose Deployment

Kubernetes deployments are like houses without doors. Let's give them entrances.

Web service (web-service.yaml)

typescript
1apiVersion: v1
2kind: Service
3metadata:
4name: web-service
5namespace: asynx-turborepo-tutorial
6spec:
7selector:
8app: web
9ports:
10- port: 3000
11targetPort: 3000
12nodePort: 30019
13type: NodePort


API service (api-service.yaml)

typescript
1apiVersion: v1
2kind: Service
3metadata:
4name: api-service
5namespace: asynx-turborepo-tutorial
6spec:
7selector:
8app: api
9ports:
10- port: 3001
11targetPort: 3001
12nodePort: 30020
13type: NodePort

💡 Tip: You can change nodePort values if you want different external ports, just make sure they’re within the 30000-32767 range.


Step 5: Apply Everything

typescript
1kubectl apply -f namespace.yaml
2kubectl apply -f web-deployment.yaml
3kubectl apply -f api-deployment.yaml
4kubectl apply -f web-service.yaml
5kubectl apply -f api-service.yaml


Step 6: Visit your App

If everything went well, go to:

  1. Frontend (Next.js): http://<your-server-ip>:30019
  2. Backend (NestJS): http://<your-server-ip>:30020

And just like that your TurboRepo monorepo is running in a kubernetes cluster.


✨Bonus Ideas

if you're feeling confident, here's what you could do next:

  • Set up an Ingress controller for cleaner URLs like web.myapp.local and api.myapp.local
  • Add ConfigMaps and Secrets for environment variables
  • Hook it up with CI/CD (GitHub Actions + kubectl FTW)


Finally

Let's be real, Kubernetes is not easy. It's powerful and complex, but it comes with a learning curve that feel like a mountain at first. You'll spend hours debugging YAML, wondering why the deployment is not starting pods. figuring why the app is not reachable. That's normal.


So if you’re reading this and thinking “this is too much” don’t give up. Take breaks. Come back. Tinker. Try again.


This guide is intentionally basic and beginner-friendly, designed to get your TurboRepo running on Kubernetes with just the essentials

how to deploy nextjs nestjs on kubernetes
turborepo deployment kubernetes
next.js 15 kubernetes deployment
nestjs kubernetes example
deploy turborepo with docker and kubernetes
k3s deploy fullstack app
create deployment and service kubernetes
Share this article:
Vijayaraghavan

Author

Vijayaraghavan

Founder & Director - Asynx Pvt. Ltd