Skip to content

SafeEHA/deno-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno Application Deployment Guide

This guide provides instructions on how to build, dockerize, and deploy a simple Deno application to a Kubernetes cluster using Kind.

Prerequisites

  • Docker
  • Kubernetes CLI (kubectl)
  • Kind (Kubernetes in Docker)
  • Access to a Docker Hub account

Building the Deno Application

  1. Write your Deno application. Ensure your main file is named app.ts.

  2. Create a Dockerfile in the root of your project. Refer to the provided Dockerfile instructions in previous communications.

Creating the Docker Image

  1. Build the Docker image:

    docker build -t yourusername/deno-app:latest .

    Replace yourusername with your Docker Hub username.

  2. Run the Docker container locally (optional):

    docker run -it --init -p 8000:8000 yourusername/deno-app:latest

    Access the application at http://localhost:8000.

Pushing to Docker Hub

  1. Login to Docker Hub:

    docker login

    Enter your Docker Hub credentials.

  2. Push the image to Docker Hub:

    docker push yourusername/deno-app:latest

Deploying to Kubernetes using Kind

  1. Create a Kind cluster:

    kind create cluster
  2. Load the Docker image into Kind:

    kind load docker-image yourusername/deno-app:latest
  3. Apply the Kubernetes manifests:

    • Deployment:

      kubectl apply -f deno-deployment.yaml
    • Service:

      kubectl apply -f deno-service.yaml
    • Ingress:

      kubectl apply -f deno-ingress.yaml

Accessing the Application

  • For Kind, check the Ingress IP or use port-forwarding:
kubectl port-forward service/deno-service 8080:8000

Cleanup

To delete the deployed resources:

kubectl delete -f deno-deployment.yaml
kubectl delete -f deno-service.yaml
kubectl delete -f deno-ingress.yaml

To delete the Kind cluster:

kind delete cluster

About

Deno rest api using Kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published