<p>I'm trying to eval <a href="https://github.com/GoogleCloudPlatform/kubernetes" rel="noreferrer">Kubernetes</a>. I interesting to mount kubernetes on CoreOS cluster, and official documentation not have much, only have two references to blog of CoreOS; I'm currently using guide to <a href="https://coreos.com/blog/running-kubernetes-example-on-CoreOS-part-1/" rel="noreferrer">running kubernetes example on CoreOS part 1</a>. </p>

<p><strong>My apiserver.service:</strong></p>

<pre><code>[Unit]
ConditionFileIsExecutable=/opt/kubernetes/bin/apiserver
Description=Kubernetes API Server
[Unit]
ConditionFileIsExecutable=/opt/kubernetes/bin/controller-manager
Description=Kubernetes Controller Manager
Documentation=https://github.com/GoogleCloudPlatform/kubernetes

[Service]
ExecStart=/opt/kubernetes/bin/controller-manager \
--etcd_servers=http://127.0.0.1:4001 \
--master=127.0.0.1:8080 \
--logtostderr=true
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
Documentation=https://github.com/GoogleCloudPlatform/kubernetes

[Service]
ExecStart=/opt/kubernetes/bin/apiserver \
--address=127.0.0.1 \
--port=8080 \
--etcd_servers=http://127.0.0.1:4001 \
--machines=127.0.0.1 \
--logtostderr=true
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
</code></pre>

<p><strong>My controller-manager.service:</strong></p>

<pre><code>[Unit]
ConditionFileIsExecutable=/opt/kubernetes/bin/controller-manager
Description=Kubernetes Controller Manager
Documentation=https://github.com/GoogleCloudPlatform/kubernetes

[Service]
ExecStart=/opt/kubernetes/bin/controller-manager \
--etcd_servers=http://127.0.0.1:4001 \
--master=127.0.0.1:8080 \
--logtostderr=true
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
</code></pre>

<p><strong>My kubelet.service:</strong></p>

<pre><code>[Unit]
ConditionFileIsExecutable=/opt/kubernetes/bin/kubelet
Description=Kubernetes Kubelet
Documentation=https://github.com/GoogleCloudPlatform/kubernetes

[Service]
ExecStart=/opt/kubernetes/bin/kubelet \
--address=127.0.0.1 \
--port=10250 \
--hostname_override=127.0.0.1 \
--etcd_servers=http://127.0.0.1:4001 \
--logtostderr=true
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
</code></pre>

<p><strong>My proxy.service</strong></p>

<pre><code>[Unit]
ConditionFileIsExecutable=/opt/kubernetes/bin/proxy
Description=Kubernetes Proxy
Documentation=https://github.com/GoogleCloudPlatform/kubernetes

[Service]
ExecStart=/opt/kubernetes/bin/proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target
</code></pre>

<p>The problem arises when I create a Kubernetes pod redis. </p>

<p><strong>When I execute command:</strong></p>

<pre><code>/opt/kubernetes/bin/kubecfg -h http://127.0.0.1:8080 -c kubernetes-coreos/pods/redis.json create /pods
</code></pre>

<p><strong>the error outputs after a long time waiting:</strong></p>

<pre><code>{Kind:"", ID:"", CreationTimestamp:"", SelfLink:"", ResourceVersion:0x0}, Status:"failure", Details:"failed to find fit for api.Pod{JSONBase:api.JSONBase{Kind:\"\", ID:\"redis\", CreationTimestamp:\"\", SelfLink:\"\", ResourceVersion:0x0}, Labels:map[string]string{\"name\":\"redis\"}, DesiredState:api.PodState{Manifest:api.ContainerManifest{Version:\"v1beta1\", ID:\"redis\", Volumes:[]api.Volume(nil), Containers:[]api.Container{api.Container{Name:\"redis\", Image:\"registry.vc.datys.cu:5000/redis\", Command:[]string(nil), WorkingDir:\"\", Ports:[]api.Port{api.Port{Name:\"\", HostPort:6379, ContainerPort:6379, Protocol:\"\", HostIP:\"\"}}, Env:[]api.EnvVar(nil), Memory:0, CPU:0, VolumeMounts:[]api.VolumeMount(nil), LivenessProbe:api.LivenessProbe{Enabled:false, Type:\"\", HTTPGet:api.HTTPGetProbe{Path:\"\", Port:\"\", Host:\"\"}, InitialDelaySeconds:0}}}}, Status:\"\", Host:\"\", HostIP:\"\", Info:api.PodInfo(nil)}, CurrentState:api.PodState{Manifest:api.ContainerManifest{Version:\"\", ID:\"\", Volumes:[]api.Volume(nil), Containers:[]api.Container(nil)}, Status:\"\", Host:\"\", HostIP:\"\", Info:api.PodInfo(nil)}}", Code:500}
</code></pre>

<p>NOTE: When I execute: <code>sudo systemctl status proxy</code> return:</p>

<pre><code>● proxy.service - Kubernetes Proxy
   Loaded: loaded (/etc/systemd/system/proxy.service; disabled)
   Active: active (running) since Fri 2014-08-08 14:21:36 UTC; 8s ago
     Docs: https://github.com/GoogleCloudPlatform/kubernetes
 Main PID: 1036 (proxy)
   CGroup: /system.slice/proxy.service
           └─1036 /opt/kubernetes/bin/proxy --etcd_servers=http://127.0.0.1:4001 --logtostderr=true

Aug 08 14:21:42 core-01 proxy[1036]: I0808 14:21:42.074694 01036 logs.go:38] etcd DEBUG: [recv.success. http://127.0.0.1:4001/v2/keys/registry/ser...rted=true]
Aug 08 14:21:42 core-01 proxy[1036]: E0808 14:21:42.074763 01036 etcd.go:115] Failed to get the key registry/services: 100: Key not found (/registry) [57]
Aug 08 14:21:42 core-01 proxy[1036]: E0808 14:21:42.074791 01036 etcd.go:75] Failed to get any services: 100: Key not found (/registry) [57]
Aug 08 14:21:44 core-01 proxy[1036]: I0808 14:21:44.075337 01036 logs.go:38] etcd DEBUG: get [registry/services/specs http://127.0.0.1:4001] [%!s(MISSING)]
Aug 08 14:21:44 core-01 proxy[1036]: I0808 14:21:44.075501 01036 logs.go:38] etcd DEBUG: [Connecting to etcd: attempt 1 for keys/registry/services...rted=true]
Aug 08 14:21:44 core-01 proxy[1036]: I0808 14:21:44.075528 01036 logs.go:38] etcd DEBUG: [send.request.to  http://127.0.0.1:4001/v2/keys/registry/...thod  GET]
Aug 08 14:21:44 core-01 proxy[1036]: I0808 14:21:44.078524 01036 logs.go:38] etcd DEBUG: [recv.response.from http://127.0.0.1:4001/v2/keys/registr...rted=true]
Aug 08 14:21:44 core-01 proxy[1036]: I0808 14:21:44.078824 01036 logs.go:38] etcd DEBUG: [recv.success. http://127.0.0.1:4001/v2/keys/registry/ser...rted=true]
Aug 08 14:21:44 core-01 proxy[1036]: E0808 14:21:44.078897 01036 etcd.go:115] Failed to get the key registry/services: 100: Key not found (/registry) [57]
Aug 08 14:21:44 core-01 proxy[1036]: E0808 14:21:44.078925 01036 etcd.go:75] Failed to get any services: 100: Key not found (/registry) [57]
Hint: Some lines were ellipsized, use -l to show in full.
</code></pre>

<p>And when execute: <code>/opt/kubernetes/bin/kubecfg -h http://127.0.0.1:8080 list /pods</code> return:</p>

<pre><code>Name                Image(s)                          Host                Labels
----------          ----------                        ----------          ----------
redis               dockerfile/redis   127.0.0.1/          name=redis
</code></pre>

<p>What's the problem? I appreciate any idea or collaboration.</p>

<p><strong>EDIT 1:</strong></p>

<p><strong>My redis.json:</strong></p>

<pre><code>{
  "id": "redis",
  "desiredState": {
    "manifest": {
      "version": "v1beta1",
      "id": "redis",
      "containers": [{
        "name": "redis",
        "image": "registry.vc.datys.cu:5000/redis",
        "ports": [{
          "containerPort": 6379,
          "hostPort": 6379
        }]
      }]
    }
  },
  "labels": {
    "name": "redis"
  }
}
</code></pre>

<p>The errors you are seeing in your log is that the pod you are trying to create has a port conflict with the Kubernetes API server. Both are trying to use port 8080. Fix this issue by changing the pod to run on another port.</p>

<p>You'll have to clean things up first. So remove the redis pod using kubecfg command. Update the pod.json file, and try again.</p>

<p>Also please follow the quickstart guide found at the <a href="https://github.com/kelseyhightower/kubernetes-coreos" rel="nofollow">https://github.com/kelseyhightower/kubernetes-coreos</a>. Kubernetes is a fast moving project, so that blog will become out of date fairly quickly. </p>
