Git Product home page Git Product logo

kubernetes-nodejs-app's Introduction

Kubernetes Node.js App

A simple Hello World Node.js app deployed with Kubernetes.

Getting started

Prerequisites

  1. minikube
  2. kubectl

Setup

  1. Start minikube
minikube start
  1. Point shell to minikube's Docker daemon
eval $(minikube docker-env)
  1. Build Docker image
docker build -t node-app .

Start deployment

  1. Create deployment
kubectl apply -f deployments/deployment.yaml
  1. Verify that two replica pods have been created
kubectl get pod

# should return something similar to:
#
# NAME                                   READY   STATUS    RESTARTS   AGE
# node-app-deployment-799f65478b-9drrm   1/1     Running   0          7s
# node-app-deployment-799f65478b-j4vwb   1/1     Running   0          7s

Start service

  1. Create service
kubectl apply -f deployments/service.yaml
  1. Verify that service has been created
kubectl get service

# should return something similar to:
#
# NAME               TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
# kubernetes         ClusterIP      <ip>           <none>        443/TCP          65m
# node-app-service   LoadBalancer   <ip>           <pending>     3000:31000/TCP   33m
  1. Test service
minikube service node-app-service --url

# using a seperate terminal instance
curl http://<external_service_ip>:31000 # returns "Hello world!"

kubernetes-nodejs-app's People

Contributors

jack-white9 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.