From docker containers to Google Kubernetes
Should the time come that I have 15 containers to manage, instead of 5, is there any merit in using Google Kubernetes?
If you run containers on a single server using the Docker daemon and its Remote API sounds appropriate.
If you need to run containers on more than one server, that's where orchestration solutions like Kubernetes, Docker swarm, Fleet, Mesos, Geard becomes useful.
My primary issue here is that 'dockerfiles' are completely different from pod configs.
Because they have different purposes:
-
Dockerfile
specifies how to build a container image from a tree of sources -
pod.yaml
defines how to schedule (image, command line, volumes, port) a set of co-located containers (sharing network namespace, and volumes) on one of the node of your cluster.
You can see pods as a way to declarative specify a set of docker run --net=container:... -v ... -p ...
commands.
Also, is there an 'official', or at least 'definitive', workflow to migrate from Docker containers to 'pods', the native unit of Kubernetes.
There is a small tool in kubernetes/contrib called podex that allow you to generate a pod manifest from image metadata stored in the public registry.
$ go get github.com/GoogleCloudPlatform/kubernetes/contrib/podex
$ podex google/nodejs-hello
id: nodejs-hello
kind: Pod
apiVersion: v1beta1
desiredState:
manifest:
version: v1beta2
containers:
- name: nodejs-hello
image: google/nodejs-hello
ports:
- name: nodejs-hello-tcp-8080
containerPort: 8080