Skip to content

vipradwivedi/helm-demo

Repository files navigation

NodeJS TinyURL Service

About app

  1. Used Node.js, Express.js, and MongoDB.
  2. Takes input url and converts into tinyurl.
  3. Check screenshots in public/images directory.
  4. Uses mongo db for persistence.
  5. Setup config/config.js for DB connection params.
  6. Use npm install to install nodejs dependencies.
  7. npm start to start local dev server and hit http://localhost:3000

What we want to do

  1. An attempt to dockerise a simple node js app which connects to mongo db.
  2. Setup deployment configurations using helm charts for kubernetes environment.
  3. Use all best practices possible to create build, release and deploy pipeline.
  4. Persistence layer deployment(mongo) is NOT in the scope of this work.

Things to be considered

  1. Security

    1. Docker Image Security.
      1. [TODO] non root user setup.
      2. [TODO] minimum user permission for process execution.
      3. [TODO] proper permissions for files/directories inside docker.
    2. Kubernetes security
      1. [TODO] dedicated namespace for app
      2. [TODO] use service account and rbac.
      3. [TODO] setup network policies.
      4. [TODO] setup security context for pods and containers.
      5. [TODO] Define resource quotas for containers.
      6. [TODO] secret handling
  2. Scalability

    1. [DONE] setup service object to access deployment.
    2. [DONE] setup nginx-ingress to access above service.
    3. [DONE] define hpa, min and max pod limits
    4. [DONE] configure liveness and readiness probes
  3. Future

    1. [TODO] static test cases and security analysis of app/docker image.
    2. [TODO] sidecar for logging
    3. [TODO] sidecar for application metrics