Kubernetes seems to be all about deploying containers to a cloud of clusters. What it doesn't seem to touch is development and staging environments (or such).
During development you want to be as close as possible to production environment with some important changes:
- Deployed locally (or at least somewhere where you and only you can access)
- Use latest source code on page refresh (supposing its a website; ideally page auto-refresh on local file save which can be done if you mount source code and use some stuff like Yeoman).
Similarly one may want a non-public environment to do continuous integration.
Does Kubernetes support such kind of development environment or is it something one has to build, hoping that during production it'll still work?
The disadvantage of using
minkube
is that it spawns another virtual machine over your machine. Also, with latestminikube
version it minimum requires to have 2 CPU and 2GB of RAM from your system, which makes it pretty heavy If you do not have the system with enough resources.This is the reason I switched to
microk8s
for development on kubernetes and I love it.microk8s
supports the DNS, local-storage, dashboard, istio, ingress and many more, everything you need to test your microservices.It is designed to be a fast and lightweight upstream Kubernetes installation isolated from your local environment. This isolation is achieved by packaging all the binaries for Kubernetes, Docker.io, iptables, and CNI in a single snap package.
A single node kubernetes cluster can be installed within a minute with a single command:
Make sure your system doesn't have any docker or kubelet service running.
Microk8s
will install all the required services automatically.Please have a look at the following link to enable other add ons in
microk8s
.You can check the status using:
Update (2016-07-15)
With the release of Kubernetes 1.3, Minikube is now the recommended way to run Kubernetes on your local machine for development.
You can run Kubernetes locally via Docker. Once you have a node running you can launch a pod that has a simple web server and mounts a volume from your host machine. When you hit the web server it will read from the volume and if you've changed the file on your local disk it can serve the latest version.
You can use a remote kubernetes cluster and configure your local machines to connect to this cluster. Use kubectl cp commands to copy code to running pods for hot reload of code during development.
See https://github.com/kubernetes/kubernetes/issues/12278 for how to mount a volume from the host machine, the equivalent of: