7

This one is a little theoretical but please bear with me.

Currently I have a server running a few Docker containers (4 or 5, depending on day and time). I plan to add another one, just like the first, and maybe even a third one.

Now, my question is this: Should the time come that I have 15 containers to manage, instead of 5, is there any merit in using Google Kubernetes?

Also, is there an 'official', or at least 'definitive', workflow to migrate from Docker containers to 'pods', the native unit of Kubernetes. Before you ask, I do know that pods are made of containers (some times even one). My primary issue here is that 'dockerfiles' are completely different from pod configs.

Any ideas?

7

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
0

@proppy's answer is correct: One is only working for single server.

I had the same initial reaction, however you can actually have multiple Services and Pods in a single file (separated by ---). This way you still have 1 service + 1 pod per container in general, but that's not too bad.

You also have to name a bunch of things more than in docker-compose (sometimes I feel it's more than necessary). Once you passed learning which name matter where, you'll be fine and maintenance of the files won't be much harder.

Deployment is a lot heavier IMO but again it's distributed, and also a Deployment Pod type is coming which should simplify upgrades (currently as beta extension in v1.1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.