Skip to content

A simple containerized (Docker) and orchestrated (Kubernetes) web application

Notifications You must be signed in to change notification settings

mmertdogann/k8s-node

Repository files navigation

k8s-node

A simple containerized (Docker) and orchestrated (Kubernetes) web application

Technologies

The project has been created using these technologies:

  • Node.js as JavaScript runtime
  • Express as web application framework
  • Docker as containerization platform
  • Kubernetes as container-orchestration system
  • kubectl as command-line tool to interact kubernetes

Setup & Installtion

Install:

  1. Node.js from here
  2. Docker from here then enable kubernetes
  3. kubectl from here
git clone <repo-url>

For acquiring the Docker image either pull the image or build a new image using Dockerfile via type this command:

docker build -t <image-name> .

⚠️ If you will use the newly created Docker image, you need to change the image property of the deployment manifest with the new <image-name>.

Running The App

In order to run the application, you need to create deployment, service, config and secret from yaml files using these commands:

kubectl apply -f nodeapp.config.yaml
kubectl apply -f nodeapp.secret.yaml
kubectl apply -f nodeapp.deployment.yaml
kubectl apply -f nodeapp.service.yaml

Getting basic info about kubernetes components:

kubectl get node
kubectl get pod
kubectl get service
kubectl get all

Viewing The App

Open a browser and then go to localhost. There will be a beautiful Hello World! text ready for you to see.

To observe console outputs, you need to use this command:

kubectl logs <pod-name>

About

A simple containerized (Docker) and orchestrated (Kubernetes) web application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published