
Local Django on Kubernetes with Minikube - waprin
https://medium.com/@waprin/local-django-on-kubernetes-with-minikube-89f5ad100378#.35mb0e1nv
======
rckrd
Not the author of this post, but a maintainer of minikube. Glad to answer any
questions.

~~~
foxylion
Is there anything planned to support multiple nodes. So that one can test
outage scenarios, load balancing across nodes, etc?

If not what other local deployment method do you suggest that works good? (All
other methods seem to be deprecated)

~~~
rckrd
We aren't planning to support multiple nodes anytime soon. The resource
overhead would probably be too much for most users just looking to try out
kubernetes.

You can take a look at the k8s docs about running locally. There's a script
that brings up a cluster with a configurable amount of nodes on linux.

[0]
[https://github.com/kubernetes/kubernetes/blob/v1.5.0/docs/de...](https://github.com/kubernetes/kubernetes/blob/v1.5.0/docs/devel/running-
locally.md)

[1]
[https://github.com/kubernetes/kubernetes/blob/v1.5.0/hack/lo...](https://github.com/kubernetes/kubernetes/blob/v1.5.0/hack/local-
up-cluster.sh)

------
collyw
Django doesn't really seem like a framework that is suited to cluster
computing, its almost always backed by a relational database and usually IO to
the DB is the bottleneck, assuming you now how to use it. Can someone explain
the advantages of running it like this to me?

~~~
waprin
As the other poster said, you run Django on Kubernetes for the same reason you
run anything on it:

* Containers are an easy way to package an application so that it's easy to run anywhere, even if it has weird dependencies

* Eventually, you'll want to run containers on more than one machine for performance/reliablity

* Kubernetes makes it easy to schedule containers on a lot of machines, have them talk to each other over a virtual network easily, and provides a toolkit to solve a bunch of other random things you'll probably want (image updates, secret management, namespaces, authentication, jobs, etc)

So the biggest reason to run Django on Kubernetes is you're running other
stuff on it, or just because it's one of the many ways to run a containerized
app. Sure, you could write a Compose file and just run Docker on a single VM,
but you're probably going to quickly want to add other apps or run on more
than one machine, at which point you are likely going to look at Kubernetes,
Swarm, maybe Mesos/Marathon, or roll-your-own container orchestrator.

Running Django on Kubernetes makes a lot of sense. Running something like
Postgres on Kubernetes is the part that is admittedly more questionable. It's
mostly just done for fun/as an exercise. Long term, databases will probably
run in containers since everything else is. Short-term, for a serious project,
I would probably just use a managed database service.

~~~
collyw
Ok so its more about containerization than running multiple instances of the
Django application.

