Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-3129

servicePorts are not copied into ports

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None

      Description

      I pushed the 2 following applications to my cluster:

       json
      {
        "container": {
          "type": "DOCKER",
          "docker": {
            "image": "nginx",
            "network": "BRIDGE",
            "portMappings": [
              { "containerPort": 80, "hostPort": 0, "servicePort": 0, "protocol": "tcp" },
              { "containerPort": 80, "hostPort": 0, "servicePort": 0, "protocol": "tcp" }
            ]
          }
        },
        "id": "network2",
        "instances": 1,
        "cpus": 0.1,
        "mem": 64
      }
      
       json
      {
        "container": {
          "type": "DOCKER",
          "docker": {
            "image": "nginx",
            "network": "BRIDGE",
            "portMappings": [
              { "containerPort": 80, "hostPort": 0, "servicePort": 80, "protocol": "tcp" },
              { "containerPort": 80, "hostPort": 0, "servicePort": 81, "protocol": "tcp" }
            ]
          }
        },
        "id": "network4",
        "instances": 1,
        "cpus": 0.1,
        "mem": 64
      }
      

      But the API returns me the following:

       bash
      $ curl -s http://<marathon ip>:8080/v2/apps | jq '.apps[] | {ports: .ports, id: .id, portMappings: .container.docker.portMappings }'
      
       json
      {
        "portMappings": [
          {
            "protocol": "tcp",
            "servicePort": 10000,
            "hostPort": 0,
            "containerPort": 80
          },
          {
            "protocol": "tcp",
            "servicePort": 10001,
            "hostPort": 0,
            "containerPort": 80
          }
        ],
        "id": "/network2",
        "ports": [
          10000,
          10001
        ]
      }
      {
        "portMappings": [
          {
            "protocol": "tcp",
            "servicePort": 80,
            "hostPort": 0,
            "containerPort": 80
          },
          {
            "protocol": "tcp",
            "servicePort": 81,
            "hostPort": 0,
            "containerPort": 80
          }
        ],
        "id": "/network4",
        "ports": [
          0
        ]
      }
      

      In the second case, I expect to have ports: [80,81].
      Am I wrong?

        Attachments

          Activity

            People

            • Assignee:
              GitHub_kolloch Peter Kolloch (Inactive)
              Reporter:
              GitHub_MiLk Emilien Kenler (Inactive)
              Team:
              Orchestration Team
              Watchers:
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: