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

proposal: deprecate and eventually eliminate support for service ports, and PORTxxx vars

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Medium
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Service ports have been a consistent source of pain in Marathon

      • the API is confusing
      • the implementation is complex and grows bugs every time someone attempts to improve readability, performance, or something else about the code
      • Marathon shouldn't be managing a slab of ports anyway
        • service ports are a discovery artifact whose allocation should be managed by an external system

      Rough outline of a plan:

      1. v1.5
        1. announces that service ports will be deprecated and likely replaced by the `endpoints` API that pods uses
        2. announces that by-index envvars like PORT0, PORT1 are deprecated
        3. use of `endpoints` implies that port names are now required; people should start naming their ports now
        4. service ports are deprecated and will become labels of an endpoint
      2. v1.6 defines "appEndpoints" feature: implements `endpoints` for apps
        1. app API normalization code prefers `endpoints` 
          1. `portDefinitions` and `requirePorts` are migrated to `endpoints`
          2.  `portMappings` are migrated to `endpoints`
          3. service ports are migrated to endpoint labels
        2. endpoints require that all ports are named
          1. ? how to migate existing ports without names?
        3. v2 REST APIs generate an `endpoints` for GET requests unless query parameter returnEndpoints=false is supplied
        4. returnEndpoints is true by default
        5. PORT0, PORT1, PORT_NAME envvars are no longer generated; ENDPOINT and EP_ vars are generated instead (just like we did for pods)
        6. appEndpoints feature defaults to off
      3. v1.7
        1. appEndpoints feature defaults to on
      4. v1.8
        1. appEndpoints feature becomes noop
        2. old portDefinitions, requirePorts, portMappings are never generated by the API
        3. PORT0, PORT1, PORT_NAME vars are never generated for tasks

      This should give plenty of time for people to:

      • digest the plan and comment on it
      • migrate their Marathon integration code to work with the new API
      • migrate their service discovery code to tooling that understands the new API

      ? should we expose the Marathon API version or Marathon feature flags as an envvar in v1.5 so that people writing apps now can take this into account when writing wrapper scripts?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jdef James DeFelice
                Team:
                Mesosphere
                Watchers:
                daltonmatos, James DeFelice, Jason Gilanfarr (Inactive)
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: