๐ŸŽฌ Deploy a Netflix Clone on Kubernetes with Kind in Minutes

AKSHAY SIVAKSHAY SIV
3 min read

Want to deploy a Netflix-like app using Kubernetes โ€” right on your local machine? In this blog, you will learn how to set up and deploy a containerized Netflix clone using kind (Kubernetes IN Docker), kubectl, and Docker.

A perfect beginner-friendly DevOps project! ๐Ÿ’ก


๐Ÿ”ง Prerequisites

Ensure the following tools are installed on your local machine:


๐Ÿ“ฅ Clone the Project

git clone https://github.com/AkshaySiv/k8s-kind-netflix
cd k8s-kind-netflix

๐Ÿ“ Project Structure

k8s-kind-netflix/
โ”œโ”€โ”€ src/                    # Netflix clone app source code
โ”‚โ”€โ”€ Dockerfile             # Dockerfile to build app image
โ”œโ”€โ”€ k8s/
โ”‚   โ”œโ”€โ”€ deployment.yaml    # Kubernetes Deployment
โ”‚   โ””โ”€โ”€ service.yaml       # Kubernetes Service
โ””โ”€โ”€ README.md

๐Ÿš€ Steps to Deploy

๐Ÿ”น Step 1: Create a Kind Cluster

Create a file named multi-node-kind-cluster.yaml:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker

Then run:

kind create cluster --config multi-node-kind-cluster.yaml --name netflix

๐Ÿ”น Step 2: Build and Push Docker Image

Replace akshaysiv with your own Docker Hub username if needed:

docker build --build-arg TMDB_V3_API_KEY=<your-api-key> -t akshaysiv/k8s-kind-netflix:latest .
docker push akshaysiv/k8s-kind-netflix

How to get the API Key:

  • Open a web browser and navigate to TMDB (The Movie Database) website.

  • Click on "Login" and create an account.

  • Once logged in, go to your profile and select "Settings."

  • Click on "API" from the left-side panel.

  • Create a new API key by clicking "Create" and accepting the terms and conditions.

  • Provide the required basic details and click "Submit."

  • You will receive your TMDB API key.

Ensure your image is pushed to dockerhub

๐Ÿ“ฆ Kubernetes Manifests

k8s/deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: netflix-clone
spec:
  replicas: 1
  selector:
    matchLabels:
      app: netflix-clone
  template:
    metadata:
      labels:
        app: netflix-clone
    spec:
      containers:
      - name: netflix-clone
        image: akshaysiv/k8s-kind-netflix:latest
        ports:
        - containerPort: 80

k8s/service.yaml

apiVersion: v1
kind: Service
metadata:
  name: netflix-clone-service
spec:
  selector:
    app: netflix-clone
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP

๐Ÿ”น Step 3: Deploy to Kind

kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml

๐Ÿ”น Step 4: Access the Application

Expose the service locally using port-forward:

kubectl port-forward svc/netflix-clone-service 8080:80

Now visit your app at:

๐Ÿ‘‰ http://localhost:8080


๐Ÿงน Cleanup

To delete the cluster:

kind delete cluster --name netflix

๐Ÿ’ก Final Thoughts

This walkthrough gives you a quick hands-on with:

  • Creating a multi-node Kubernetes cluster with Kind

  • Building and deploying Dockerized applications

  • Managing deployments and services in Kubernetes

Want to take this further? Add a database, logging, or CI/CD pipeline for even more learning!

Check out the GitHub repo and feel free to fork and customize: ๐Ÿ‘‰ AkshaySiv/k8s-kind-netflix


๐Ÿ™Œ Connect with Me

0
Subscribe to my newsletter

Read articles from AKSHAY SIV directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

AKSHAY SIV
AKSHAY SIV

๐Ÿš€ DevOps Engineer | Cloud Enthusiast | Automation Specialist ๐Ÿ“Œ Sharing insights on DevOps best practices, infrastructure as code, and system reliability.