Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

πŸš€ Deploy a Netflix Clone on a local multi-node Kubernetes cluster using kind, Docker, and kubectl.

Notifications You must be signed in to change notification settings

AkshaySiv/k8s-kind-netflix

Repository files navigation

Netflix Clone on kind Kubernetes Cluster

This project demonstrates how to deploy a simple Netflix Clone application on a local Kubernetes cluster using kind.

alt text

Prerequisites

Ensure the following tools are installed on your local machine:

Project Structure

k8s-kind-netflix/
β”œβ”€β”€ src /                     # Netflix clone app source code
│── Dockerfile 
β”œβ”€β”€ k8s/
β”‚   β”œβ”€β”€ deployment.yaml
β”‚   └── service.yaml
└── README.md

Steps to Deploy

1. Create a kind Cluster

Create multi-node-kind-cluster.yaml file

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

Run below command to create a multinode kind cluster in your local

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

2. Build the Docker Image and push to your docker registry

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

alt text

Kubernetes Manifests

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

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

3. Deploy to kind

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

4. Access the Application

Expose the service locally (using port-forward):

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

Visit your app at: http://localhost:8080

Cleanup

To delete the cluster:

kind delete cluster --name multi-node-kind-cluster

Diagram

About

πŸš€ Deploy a Netflix Clone on a local multi-node Kubernetes cluster using kind, Docker, and kubectl.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published