Git Product home page Git Product logo

cnaand-techtrends's Introduction

Cloud Native Application Architecture Nanodegree

TechTrends Project

Sharing platform project for Cloud Native Fundamentals module.

Tech Stack

Web App

Containerization & Virtualization

CI/CD & GitOps

Deployment & Management of Containers

Running TechTrends Project

Building TechTrends Image

From the repository's root folder, build the app image:

$docker build -t YOUR_NAME/techtrends .

The build process will install all dependencies and start the SQLite DB, then expose port 3111 for this image.

You might want to test the application before building its image by reading the instructions here.

Running the Image

Run a container and test it locally:

docker run -d --name techtrends -p HOST_PORT:3111 YOUR_NAME/techtrends

Preparing K8S Environment

With vagrant correctly setup, a simple vagrant up and vagrant ssh will suffice to start the environment.

As superuser, install K3S, a lightweight K8S distribution: curl -sfL https://get.k3s.io | sh -

This installation process may take a while.

Check the availability with kubectl get node.

Applying K8S Manifests Only

Apply the kubernetes/namespace.yaml, kubernetes/deploy.yaml and kubernetes/service.yaml for local/sandbox namespace.

$ kubectl apply -f namespace.yaml
$ kubectl apply -f deploy.yaml
$ kubectl apply -f service.yaml

Check the resources created for the sandbox namespace:

$ kubectl get all -n sandbox

NAME                              READY   STATUS    RESTARTS   AGE
pod/techtrends-577bd4f766-nmchn   1/1     Running   1          44h

NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/techtrends   ClusterIP   10.43.170.37   <none>        4111/TCP   44h

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/techtrends   1/1     1            1           44h

NAME                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/techtrends-577bd4f766   1         1         1       44h

Test the service from cluster ip:

$ curl -s -i 10.43.170.37:4111 | head -n 1 -

Expose as a node port to test from your local browser:

$ kubectl apply -f nodeport.yaml

Check the webapp running from VM private ip and node port exposed, i.e, 192.168.50.4:30001

Webapp Running

cnaand-techtrends's People

Contributors

dblsilverio 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.