Cloud Docs Home > F5 Marathon ASP Controller Index

F5 Marathon ASP Controller

The F5 Marathon ASP Controller deploys the F5 Application Services Proxy (ASP) in a Marathon cluster.

Release Notes

Attributions

Attributions.md

Features

  • Dynamic discovery of Marathon Apps.
  • Dynamic launch and configuration of ASP.

Architecture

The F5 Marathon ASP Controller watches Marathon’s event stream. It deploys (or updates) the ASP when the following events occur:

  • a new Marathon app with label f5-asp: enable launches;
  • the configuration for an existing App with label f5-asp: enable changes;
  • an existing App has label f5-asp: enable added for the first time.

When the F5 Marathon ASP Controller discovers a Marathon Application with ASP enabled, it:

  1. launches an ASP instance to front the App;
  2. creates a virtual server on the ASP instance;
  3. assigns an address to each Application task;
  4. records a MesosDNS entry for each Application task (for example, asp-<app-name>.<domain-name>);

Configuration Parameters

The F5 Marathon ASP Controller configurations must be valid JSON. Use the configuration parameters to define the default settings for the ASP. You can use the override labels to override the default settings when you enable ASP for a new App. The virtual server related override labels override default settings for either all virtual servers within an App, or a specific virtual server referenced by its index number. The virtual server index corresponds to the index of the port, in the App port definitions array, that the virtual server corresponds to.

Parameter Type Required Default Description Override Label
MARATHON_URL string Required  

Set Marathon API URL

Example: http://127.0.0.1:8080

 
ASP_ENABLE_LABEL string Optional f5-asp Set default Application label for ASP. The label must conform to the same set of restrictions as a valid Marathon app name, i.e., only contain digits (0-9), dashes (-), dots (.) and lowercase letters (a-z). [1]  
ASP_DEFAULT_CPU decimal Optional 1.0 Set default CPU for ASP tasks ASP_CPU
ASP_DEFAULT_MEM decimal Optional 256.0 Set default memory for ASP tasks ASP_MEM
ASP_DEFAULT_STORAGE integer Optional 0 Allocate storage for ASP tasks ASP_STORAGE
ASP_DEFAULT_COUNT_PER_APP integer Optional 1 Set default number of ASP tasks per Application ASP_COUNT_PER_APP
ASP_DEFAULT_CONTAINER string Optional f5networks/asp Set the default ASP Docker image to pull ASP_CONTAINER
ASP_DEFAULT_CONTAINER_PORT integer Optional 8000 Set the default container port [2]
ASP_DEFAULT_URIS string Optional EMPTY Set the default URIs to pass to Marathon (comma-separated list) ASP_URIS
ASP_DEFAULT_VS_HEALTH JSON blob Optional   Specifies the health monitor for the virtual server [3] ASP_VS_HEALTH ASP_VS_<IDX>_HEALTH [7]
ASP_DEFAULT_VS_KEEP_ALIVE integer Optional 1000 Set the default virtual server keep-alive (msecs) ASP_VS_KEEP_ALIVE ASP_VS_<IDX>_KEEP_ALIVE [7]
ASP_DEFAULT_VS_PROTOCOL string Optional http

Set default protocol

Options: - http - tcp

ASP_VS_PROTOCOL ASP_VS_<IDX>_PROTOCOL [7]
ASP_DEFAULT_STATS_URL string Optional   Set default URL for backend stats server / analytics provider ASP_STATS_URL
ASP_DEFAULT_STATS_TOKEN [4] string Optional   Set default authentication token for backend stats server ASP_STATS_TOKEN
ASP_DEFAULT_STATS_BACKEND [4] string Optional   Set default stats backend (e.g., Splunk) ASP_STATS_BACKEND
ASP_DEFAULT_STATS_FLUSH_INTERVAL integer Optional   Set default interval for flushing stats (msecs) ASP_STATS_FLUSH _INTERVAL
ASP_DEFAULT_STATS_REJECT_UNAUTHORIZED [5] boolean Optional   Set default behavior for verifying server certificate ASP_STATS_REJECT _UNAUTHORIZED
ASP_DEFAULT_STATS_CA [5] string Optional   Set default trusted certificate string (in PEM format) ASP_STATS_CA
ASP_DEFAULT_FORCE_PULL boolean Optional true Set default behavior for pulling image from Docker ASP_FORCE_PULL
ASP_DEFAULT_LOG_LEVEL string Optional INFO

Set default logging level

Options: - INFO - DEBUG - ERROR - WARNING

ASP_LOG_LEVEL
ASP_EPHEMERAL_STORE JSON blob Optional   Specifies the ephemeral store config [3]  
ASP_DEFAULT_VS_FLAGS JSON blob Optional {}

Set default vs_flags that define ASP objects

vs_flags accepts boolean values.

ASP_VS_FLAGS ASP_VS_<IDX>_FLAGS [7]
ASP_VIP_PREFIX string Optional ASP_ Set prefix for port labels passed to the ASP  
ASP_ENV_PREFIX string Optional PROXY_ENV_ Set prefix for env variables passed to the ASP  
ASP_UPGRADE_MIN_HEALTH decimal Optional   Set minimum health capacity for ASP upgrade strategy [6]  
ASP_UPGRADE_MAX_OVER decimal Optional   Set maximum over capacity for ASP upgrade strategy [6]  

Application-Specific Configuration Parameters

The configuration parameter(s) below allows you to configure virtual server(s) for a specific application.

Parameter Type Required Default Description Override Label
ASP_VS_EVENT_HANDLERS JSON blob Optional   Specifies the event-handlers for the virtual server [3] ASP_VS_<IDX>_EVENT_HANDLERS [7]
[1]In most cases, you shouldn’t need to override ASP_ENABLE_LABEL. You need to do so if you are in an environment where you can’t make apps named “f5-asp-” or the label “f5-asp” is already used.
[2]To override the default container port setting, edit the applications’ configs in the Marathon UI.
[3](1, 2, 3) See the ASP configuration parameters for a detailed description of the format.
[4](1, 2) When you configure ASP_DEFAULT_STATS_URL, ASP_DEFAULT_STATS_TOKEN and ASP_DEFAULT_STATS_BACKEND become required parameters.
[5](1, 2) Applies if you are sending stats to an HTTPS server.
[6](1, 2) Use these to configure the Upgrade and Deployment strategy of ASP.
[7](1, 2, 3, 4, 5) To override a setting for a particular virtual server use the override label prefix followed by the virtual server index number followed by the label suffix. Ex. Override protocol of virtual server 0 label: ASP_VS_0_PROTOCOL

Example Configuration Files

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
  "id": "/example/marathon-asp-ctlr",
  "cpus": 1,
  "mem": 128,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "f5networks/marathon-asp-ctlr:v1.1.0",
      "network": "BRIDGE",
      "forcePullImage": true,
      "privileged": false,
      "portMappings": []
    },
    "volumes": []
  },
  "env": {
    "MARATHON_URL": "http://marathon.mesos.example.com:8080",
    "ASP_ENABLE_LABEL": "asp",
    "ASP_DEFAULT_CPU": "1",
    "ASP_DEFAULT_MEM": "256",
    "ASP_DEFAULT_STORAGE": "0",
    "ASP_DEFAULT_COUNT_PER_APP": "1",
    "ASP_DEFAULT_CONTAINER": "f5networks/asp:v1.1.0",
    "ASP_DEFAULT_CONTAINER_PORT": "8000",
    "ASP_DEFAULT_URIS": [],
    "ASP_DEFAULT_VS_KEEP_ALIVE": "1000",
    "ASP_DEFAULT_VS_PROTOCOL": "http",
    "ASP_DEFAULT_STATS_URL": "http://splunk.example.com:8088",
    "ASP_DEFAULT_STATS_TOKEN": "example-stats-token",
    "ASP_DEFAULT_STATS_BACKEND": "splunk",
    "ASP_DEFAULT_STATS_FLUSH_INTERVAL": "10000",
    "ASP_DEFAULT_FORCE_PULL": true,
    "ASP_DEFAULT_LOG_LEVEL": "info",
    "ASP_DEFAULT_VS_FLAGS": {
      "x-forwarded-for": false,
      "x-forwarded-by": false
    },
    "ASP_EPHEMERAL_STORE": {
      "host": "ephemeral-store.marathon.l4lb.thisdcos.directory",
      "port": 8087,
      "users": {
        "<user-name>" : {
          "key": "<user-private-key-in-PEM-format>",
          "cert": "<user-cert-in-PEM-format>"
        }
      },
      "root-ca": "<rootCA-cert-in-PEM-format>"
    },
    "ASP_DEFAULT_VS_HEALTH": {
      "health-checks": {
        "sampleActiveHealthCheckUsingDefaults": {
          "active": {
            "http": {}
          }
        },
        "samplePassiveHealthCheckUsingDefaults": {
          "passive": {}
        }
      }
    },
    "ASP_VIP_PREFIX": "ASP",
    "ASP_ENV_PREFIX": "ASP"
  }
}