F5Networks / marathon-bigip-ctlr

Repository for F5 BIG-IP Controller for Marathon.
Apache License 2.0
3 stars 11 forks source link

Marathon BigIP Controller breaks with Marathon 1.5.2(DC/OS 1.10.2) #244

Closed frankmesen closed 6 years ago

frankmesen commented 6 years ago

Description

Bug: The component throws: Keyerror: 'ports' with Marathon 1.5.2

Root cause: /marathon/v2/apps doesn't have app['ports'] anymore and Marathon BigIP Controller depends on it.

Mesos Version

1.4.0

Marathon Version

1.5.2

Controller Version marathon-bigip-ctlr being used

Version: 1.1.0

BIG-IP Version

12.1.1 HF1

Diagnostic Information

Root cause provided, it's very simple to replicate the issue, just examine the output of marathon/v2/apps. There is a clear dependency on app['ports'] at https://github.com/F5Networks/marathon-bigip-ctlr/blob/master/marathon-bigip-ctlr.py#L581

Output of /marathon/v2/apps for one application { "apps": [ { "id": "/SANITIZED", "backoffFactor": 1.15, "backoffSeconds": 1, "cmd": "SANITIZED", "constraints": [ [ "hostname", "UNIQUE" ] ], "container": { "type": "DOCKER", "docker": { "forcePullImage": true, "image": "SANITIZED", "parameters": [

      ],
      "privileged": false
    },
    "volumes": [

    ],
    "portMappings": [
      {
        "containerPort": SANITIZED,
        "hostPort": SANITIZED,
        "labels": {

        },
        "name": "SANITIZED",
        "protocol": "tcp",
        "servicePort": SANITIZED
      }
    ]
  },
  "cpus": 0.01,
  "disk": 0,
  "executor": "",
  "instances": SANITIZED,
  "labels": {
    "DCOS_PACKAGE_RELEASE": "SANITIZED",
    "DCOS_PACKAGE_SOURCE": "http://universe.marathon.mesos:SANITIZED/repo",
    "DCOS_PACKAGE_METADATA": "SANITIZED",
    "DCOS_PACKAGE_REGISTRY_VERSION": "SANITIZED",
    "DCOS_PACKAGE_VERSION": "SANITIZED",
    "DCOS_PACKAGE_NAME": "SANITIZED",
    "DCOS_PACKAGE_IS_FRAMEWORK": "false",
    "MONITORING": "true"
  },
  "maxLaunchDelaySeconds": 3600,
  "mem": SANITIZED,
  "gpus": 0,
  "networks": [
    {
      "mode": "container/bridge"
    }
  ],
  "requirePorts": false,
  "upgradeStrategy": {
    "maximumOverCapacity": 1,
    "minimumHealthCapacity": 1
  },
  "version": "SANITIZED",
  "versionInfo": {
    "lastScalingAt": "SANITIZED",
    "lastConfigChangeAt": "SANITIZED"
  },
  "killSelection": "YOUNGEST_FIRST",
  "unreachableStrategy": {
    "inactiveAfterSeconds": 300,
    "expungeAfterSeconds": 600
  },
  "tasksStaged": 0,
  "tasksRunning": 3,
  "tasksHealthy": 0,
  "tasksUnhealthy": 0,
  "deployments": [

  ]
}
}

Note: Sanitize the data. For example, be mindful of IPs, ports, application names and URLs Note: The following F5 article outlines the information required when opening an issue. https://support.f5.com/csp/article/K60974137

edarzins commented 6 years ago

marathon-bigip-ctlr v1.1.0 is not compatible with the Marathon v1.5.2 API, breaking changes to the Marathon API were introduced, described here: https://github.com/mesosphere/marathon/blob/master/changelog.md

It appears that we can get the servicePort info from "container.portMappings" in that version.

frankmesen commented 6 years ago

That is correct, there is another change that will break the Marathon BigIP controller. The healthcheck. Marathon v1.5.2 will omit app['healthChecks'] when the application doesn't have one, breaking the component.

amudukutore commented 6 years ago

@frankmesen - this issue will be addressed in the next version (v1.2.0) of the controller which should be out around Jan. 15th.

frankmesen commented 6 years ago

@amudukutore - thank you very much for the information.

edarzins commented 6 years ago

Fixed in master and 1.1-stable branches.

amudukutore commented 6 years ago

@frankmesen - We’ve released bugfix version v1.1.1 for the BIG-IP Controller for Marathon (marathon-bigip-ctlr) today in response to a P1 issue that was filed recently. Images for this version are now public and accessible via the following links:

DockerHub: https://hub.docker.com/r/f5networks/marathon-bigip-ctlr/ Docker CLI: docker pull f5networks/marathon-bigip-ctlr:1.1.1 GitHub: https://github.com/F5Networks/marathon-bigip-ctlr/releases/tag/v1.1.1 Solution Documentation: http://clouddocs.f5.com/containers/latest/marathon/ Product Documentation: http://clouddocs.f5.com/products/connectors/marathon-bigip-ctlr/v1.1/