Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 1.72 KB

README.md

File metadata and controls

64 lines (44 loc) · 1.72 KB

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>