Docker Community Forums

Share and learn in the Docker community.

Can't run containerized Kubernetes (low-pri)

(Blackxored) #1

Low priority of course, but in case you’re not aware we can’t run Kubernetes under Docker for Mac.

(Justin Cormack) #2

I have had success reports actually. Instructions to reproduce the failure would be useful.

(Dpratt99) #3

The following docker-compose config fails to start the Kubelet with the error “[Failed to start ContainerManager [open /proc/sys/vm/overcommit_memory: read-only file system, open /proc/sys/kernel/panic: read-only file system, open /proc/sys/kernel/panic_on_oops: read-only file system]]”

version: '2'

    restart: always
    - 4001:4001
    - ./volumes/etcd:/var/etcd
    command: >

    restart: always
    privileged: true
    network_mode: host
    pid: host
    - ./volumes/kubelet:/etc/kubernetes/manifests
    - /var/lib/kubelet:/var/lib/kubelet
    - /var/lib/docker:/var/lib/docker:rw
    - /var/run:/var/run:rw
    - /sys:/sys:ro
    - /:/rootfs:ro
    command: >
      /hyperkube kubelet

    restart: always
    network_mode: host
    privileged: true
    command: >
      /hyperkube proxy

    restart: always
    - etcd
    - 8080:8080
    command: >
      /hyperkube apiserver

    restart: always
    - apiserver
    command: >
      /hyperkube controller-manager

    restart: always
    - apiserver
    command: >
      /hyperkube scheduler

(Justin Cormack) #4

I think that may have been a known issues with last week’s docker release candidate. We are preparing a new beta today, if you could re-test after the update that would be helpful.

(Frenchben) #5

More information from @feelobot if you run that the api server isn't able to connect even when changing to docker.local:8080

I0413 18:36:43.178340 2387 kubelet.go:2255] skipping pod synchronization - [Failed to start ContainerManager [open /proc/sys/vm/overcommit_memory: read-only file system, open /proc/sys/kernel/panic: read-only file system, open /proc/sys/kernel/panic_on_oops: read-only file system]] 
E0413 18:36:46.100370 2387 event.go:201] Unable to write event: 'Post http://docker.local:8080/api/v1/namespaces/default/events: dial tcp: lookup docker.local: no such host' (may retry after sleeping)

I0413 18:17:07.382523 2101 kubelet.go:2618] Recording NodeHasSufficientDisk event message for node 
I0413 18:17:07.384496 2101 kubelet.go:1069] Attempting to register node 
I0413 18:17:07.386417 2101 kubelet.go:1072] Unable to register with the apiserver: Post http://localhost:8080/api/v1/nodes: dial tcp connection refused

(Felix Rodriguez) #6

Thanks! :slight_smile:

(Justin Cormack) #7

Those errors are from the rc, known issue. If you could retry with the new beta that would help.

(Fridder) #8

I am still seeing the unable to register errors. Is there a setting wrong in the yml posted or do you have an example of a correct config or steps to get it running?

(Errordeveloper) #9

Hey folks,

I’ve been able to run it actually, please take a look here:

Do let me know if you have more questions (file issues, or ask here), as docs are still quite fresh.


(Fridder) #10

Thank you. It might be nice to detail how to launch your own pods, etc as it is not clear what is mounted where and from where.

(Jetlabs) #11

I tried the original way to run kubernetes as docker containers and encountered a strange not implemented error. The Kube itself is up and running and responds to kubctl. But running a simple busybox pod hangs at ContainerCreating with the followings message:

{kubelet} Warning FailedMount Unable to mount volumes for pod “busybox_default(d4bf38aa-0fa1-11e6-8863-1ec090dbf22e)”: statfs("/var/lib/kubelet/pods/d4bf38aa-0fa1-11e6-8863-1ec090dbf22e/volumes/"): function not implemented

Could it be that statfs() really isn’t implemented?

(Errordeveloper) #12

@fidder I have improved the docs, please take a look and see if it’s clearer now.

(Spiddy) #13

@errordeveloper looks good, tried it and managed to create the cluster, configured kubectl to point there from Mac’s machine. Can’t figure out how to see services from a browser though. Any hints on a port connectivity mecanisms (outside the docker context - e.g. chrome)?

(Justin Cormack) #14

statfs is currently not implemented in shared volumes, we are still working on that.

(David Sheets) #15

I don’t believe /var/lib/kubelet/pods/d4bf38aa-0fa1-11e6-8863-1ec090dbf22e/volumes/ should be on a shared volume unless kubernetes is doing something odd.

(Errordeveloper) #16

@spiddy Kubernetes (via kubectl proxy) provides URL prefixes for you.

Here is the gist:


(Spiddy) #17

Thanks, that would work. I tried restarting the service and now I get the following error:

➜  ~ docker run \
>   --volume="/:/rootfs" \
>   --volume="/var/run/weave/weave.sock:/docker.sock" \
>     weaveworks/kubernetes-anywhere:toolbox-v1.2 \
>       sh -c 'setup-single-node && compose -p kube up -d'
Creating data volumes container for kubelet (`kubelet-volumes`)...
Docker container `kubelet-volume` aleady exists
Calling `mount  --make-rshared /` to ensure `kubelet-volumes` is functional
Service "kubelet" mounts volumes from "kubelet-pki", which is not the name of a service or container.

any hints?

(Errordeveloper) #18

@spiddy I’ve seen this once earlier, it’s a bit odd, but I have not managed to reproduce it. To reset, please use docker run ... weaveworks/kubernetes-anywhere:toolbox-v1.2 reset-single-node. I’m testing an up/down wrap at the moment, if you are interested to try it out

(Fridder) #19

I am having some occasional success with it but it seems a little brittle, especially with suspend resume.

(Fridder) #20

Looks like the kublet container is not coming up either after resume or if you exit docker for mac and relaunch. It is exiting with a status of 2 and I am not seeing anything obvious in the logs