<p>I was wondering if anyone knows how to create a json file that would be the same as running:</p>

<p>docker run -p 80:80 -p 443:443 starblade/pydio-v4</p>

<p>I trying something very ambitious, I want to start my docker container in kubernetes-mesos cluster but can't seem to get the ports correct in the json file, alas I am still very new to this.</p>

<p>Thanks,
TT</p>

<p>Here are my json files:</p>

<p>`</p>

<pre><code>{
"id": "frontend-controller",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
"replicas": 3,
"replicaSelector": {"name": "frontend"},
"podTemplate": {
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "frontend-controller",
"containers": [{
"name": "pydio-v4",
"image": "starblade/pydio-v4",
"ports": [{"containerPort": 10001, "protocol": "TCP"}]
}]
}
},
"labels": {"name": "frontend"}
}},
"labels": {"name": "frontend"}
}
</code></pre>

<p><code>
</code></p>

<pre><code>{
"id": "frontend",
"kind": "Service",
"apiVersion": "v1beta1",
"port": 80,
"port": 443,
"targetPort": 10001,
"selector": {
"name": "frontend"
},
"publicIPs": [
"${servicehost}"
]
}
</code></pre>

<p><code>
Docker container Env info pulled from docker inspect command:
</code></p>

<pre><code>"Env": [
"FRONTEND_SERVICE_HOST=10.10.10.14",
"FRONTEND_SERVICE_PORT=443",
"FRONTEND_PORT=tcp://10.10.10.14:443",
"FRONTEND_PORT_443_TCP=tcp://10.10.10.14:443",
"FRONTEND_PORT_443_TCP_PROTO=tcp",
"FRONTEND_PORT_443_TCP_PORT=443",
"FRONTEND_PORT_443_TCP_ADDR=10.10.10.14",
"KUBERNETES_SERVICE_HOST=10.10.10.2",
"KUBERNETES_SERVICE_PORT=443",
"KUBERNETES_PORT=tcp://10.10.10.2:443",
"KUBERNETES_PORT_443_TCP=tcp://10.10.10.2:443",
"KUBERNETES_PORT_443_TCP_PROTO=tcp",
"KUBERNETES_PORT_443_TCP_PORT=443",
"KUBERNETES_PORT_443_TCP_ADDR=10.10.10.2",
"KUBERNETES_RO_SERVICE_HOST=10.10.10.1",
"KUBERNETES_RO_SERVICE_PORT=80",
"KUBERNETES_RO_PORT=tcp://10.10.10.1:80",
"KUBERNETES_RO_PORT_80_TCP=tcp://10.10.10.1:80",
"KUBERNETES_RO_PORT_80_TCP_PROTO=tcp",
"KUBERNETES_RO_PORT_80_TCP_PORT=80",
"KUBERNETES_RO_PORT_80_TCP_ADDR=10.10.10.1",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"PYDIO_VERSION=6.0.5"
],
"ExposedPorts": {
"443/tcp": {},
"80/tcp": {}
},
</code></pre>

<p>`</p>

<p>The pod and service both start and run ok.</p>

<p>However I am unable to access the running Pydio site on any of the master, minion or frontend ips.</p>

<p>Note:
I am running a modified version of the this docker container:</p>

<p><a href="https://registry.hub.docker.com/u/kdelfour/pydio-docker/" rel="nofollow">https://registry.hub.docker.com/u/kdelfour/pydio-docker/</a></p>

<p>My container has been tested and it runs as expected.
You should see the login screen once it is running.</p>

<p>Please let me know if I can provide any other information.</p>

<p>Thanks again.</p>

<p>So, I finally got this to work using the following .json files:</p>

<p>frontend-service.json</p>

<pre><code>    {
  "id": "frontend",
  "kind": "Service",
  "apiVersion": "v1beta1",
  "port": 443,
  "selector": {
    "name": "frontend"
  },
  "publicIPs": [
    "${servicehost}"
  ]
}
</code></pre>

<p>frontend-controller.json</p>

<pre><code>{
  "id": "frontend-controller",
  "kind": "ReplicationController",
  "apiVersion": "v1beta1",
  "desiredState": {
    "replicas": 1,
    "replicaSelector": {"name": "frontend"},
    "podTemplate": {
      "desiredState": {
         "manifest": {
           "version": "v1beta1",
           "id": "frontend-controller",
           "containers": [{
             "name": "pydio-v4",
             "image": "starblade/pydio-v4",
             "ports": [{"containerPort": 443, "hostPort": 31000}]
           }]
         }
       },
       "labels": {"name": "frontend"}
      }},
  "labels": {"name": "frontend"}
}
</code></pre>

<p>I now have pydio with SSL running in a Mesos-Kubernetes env on GCE.</p>

<p>Going to run some tests using more hostPorts to see if I can get more than one replica running on one host. At this point I can resize up to 3.</p>

<p>Hope this helps someone.</p>

<p>Thanks,
TT</p>
