This project demonstrates how to deploy a simple Netflix Clone application on a local Kubernetes cluster using kind.
Ensure the following tools are installed on your local machine:
- Docker
- kind
- kubectl
- Clone source code
k8s-kind-netflix/
βββ src / # Netflix clone app source code
βββ Dockerfile
βββ k8s/
β βββ deployment.yaml
β βββ service.yaml
βββ README.md
Create multi-node-kind-cluster.yaml file
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: workerRun below command to create a multinode kind cluster in your local
kind create cluster --name multi-node-kind-cluster.yamldocker build --build-arg TMDB_V3_API_KEY=<your-api-key> -t akshaysiv/k8s-kind-netflix:latest .
docker push akshaysiv/k8s-kind-netflixapiVersion: 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: 80apiVersion: v1
kind: Service
metadata:
name: netflix-clone-service
spec:
selector:
app: netflix-clone
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIPkubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yamlExpose the service locally (using port-forward):
kubectl port-forward svc/netflix-clone-service 8080:80Visit your app at: http://localhost:8080
To delete the cluster:
kind delete cluster --name multi-node-kind-cluster