Minishift as a Development Environment for Node.js

Conor O'Neill

Dara Hayes

OpenShift Commons Briefing

About us

  • nearForm founded in 2011 in Tramore Ireland
  • 100+ people building fullstack solutions for global organisations
  • React + Node.js + HAPI + AWS + Terraform + Ansible + Containers
  • Deeply involved in Open Source communities
  • Legendary events such as NodeConf EU
  • Major contributor to Node Core

Containers at nearForm

  • Building with Docker for ~3 years
  • A number of K8's experts at nearForm
  • Running Kubernetes in AWS for several customers

Why Minishift?

  • Customers very interested in OpenShift
  • Skill up developers with OpenShift/K8's
  • Dev environment very similar to production

What Makes a Good Dev Environment?

  • Time to First Code
  • Production Parity
  • Instant Feedback Loops

The Goal - Instant Feedback in OpenShift

It took some work...

Volume Mounts

Result: Avoid rebuilding a container when code changes

Instant Reload

package.json

minishift-demo.yml

Result: application restarts within existing container

Permissions - OpenShift SCCs

By default, Containers cannot access the underlying host FS

We can change this with Security Context Constraints

$ oc get scc 
# list the built in policies

Result: containers are allowed to mount host path volumes

Native Dependencies

Mounting local code including node_modules breaks native dependencies. We Installed node_modules in another folder.

Result: native deps are compiled for the right platform.

Caveat: must rebuild container when deps change.

demo
What about scaling?

Scaling Minishift

How?

$ minishift config set memory 4096
$ minishift config set cpus 4
$ oc describe node

Conclusions

Minishift has potential to be a great dev environment

  • Fantastic UI/UX
  • Breaking down barriers between dev and ops
  • Potential to become 'universal dev environment'
but it's not perfect

There's Still Work to do

  • How do we organise our projects with multiple codebases?
  • How do we co-ordinate multiple projects?
  • Can we turn it into a general solution? (one size fits all)
  • What is the pathway going from local OpenShift to production OpenShift?
We don't have the answers 
We would love your suggestions and contributions
(yet)

Conor O'Neill - Chief Product Officer

conoro

conor.oneill@nearform.com

Dara Hayes - Devops Engineer

darragh_hayes

dara.hayes@nearform.com

end ☕️

Minishift as a Development Environment for Node.js

By Dara Hayes

Minishift as a Development Environment for Node.js

  • 3,800