Thoughts on developer and single-node installation as per Locally-managed workbench.

Use case

The primary use case is for a developer to run a local copy of Labs Workbench on their laptop or a remote VM (AWS, GCE, Azure, OpenStack, etc).  The basic requirements are simple: 

A secondary use case is the single-node installation for a project. This has come up a few times, but for example:

Current environment (ndslabs-startup)

For developers, we achieve this with the ndslabs-startup repo. A simple shell script  kube-up.sh brings up Kubernetes via Hyperkube.  This requires access to /var/lib/docker and /var/lib/kubelet, which has proven problematic on MacOS and Windows with newer Docker installs.  A second shell script ndslabs-up.sh collects information from the user (domain name, IP address, email address) and uses kubectl to deploy a number of templated YAML files.  

Pros:

Cons:

Other options:

Minikube

Minikube runs Kubernetes in a VM and sets up kubeconfig environment

Minikube on MacOS

Minikube Windows 10

Linux/VM

Hyperkube (ndslabs-startup)

Our current ndslabs-startup/kube-up.sh relies on Hyperkube (Kubernetes in Docker)

MacOS

Windows 10

VirtualBox VM

Openstack VM

Azure VM

AWS VM

 


Vagrant

Vagrant is a tool to manage virtual machines. The approach described below comes from CoreOS as a method to deploy a Kubernetes cluster via VirtualBox (or similar). Vagrant has multiple providers, so it might be possible to use the same Vagrant configuration to deploy a Kubernetes cluster on VirtualBox on your laptop and deploy a full cluster on OpenStack. However, it's not clear how useful this might be.

MacOS

The VirtualBox/Vagrant approach suggested by David works on MacOS. As with Minikube, this will not work on an OpenStack or other VM without running a different virtualization package (VirtualBox won't work in a VM). It's not clear that Vagrant will support this configuration.

Following instructions from Multi Node Kubernetes developer environment - using VBox/Vagrant/CoreOS

  1. Install Vagrant
    1. vagrant version
    2. Got error "failed generating SSL artifacts", solved with https://github.com/mitchellh/vagrant/issues/7747

      sudo ln -sf /usr/local/bin/openssl /opt/vagrant/embedded/bin/openssl
  2. git clone https://github.com/coreos/coreos-kubernetes.git
  3. cd coreos-kubernetes/multi-node/vagrant/
  4. cp config.rb.sample config.rb, uncomment values
    1. Want 2GB for compute for us
  5. vagrant up --provider virtualbox
  6. vagrant status
    1. Should show three instances e1 (etcd), w1 (compute), c1 (master/controller)
    2. vagrant ssh c1 will take you into the controller node, will need to 
  7. Takes a few minutes for things to come up
    1. kubectl get nodes

ndslabs-up

Recommendations