F5 Container Integrations v1.3

Current Page

Application Services Proxy

Cloud Foundry

Kubernetes / OpenShift

Mesos Marathon

Support

Troubleshooting

Tutorials

Cloud Docs Home > F5 Container Integrations Index

Install the ASP and ASP Controller - Marathon

The ASP Controller for Marathon is a Docker container that runs as a Marathon Application. You can install it via the Marathon REST API or the Marathon Web Interface. The ASP Controller dynamically deploys the Application Services Proxy (ASP) when it discovers a Marathon Application with the f5-asp:enable label.

When you launch the ASP Controller, provide the global configuration parameter(s) you want it to apply to new ASP instances. You can override the global configurations on a per-Application basis.

Initial Setup

Before you deploy the Application Services Proxy, complete the following tasks:

  1. Accept the Terms of Service in Docker Store.

  2. Set up Marathon to use a private Docker registry so you can pull the ASP image from Docker Store.

  3. Set up the ASP ephemeral store. [1]

Deploy the ASP Controller for Marathon

  1. Define the default ASP Marathon configuration labels in a JSON file.

    Tip

    Provide the URI for your Docker config file in the App definition using the ASP_DEFAULT_URIS in the App definition. Otherwise, Marathon won’t be able to pull the ASP image from Docker Store.

     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
    //NOTE: REMOVE ALL COMMENTS BEFORE USING THIS FILE
    {
      "id": "/marathon-asp-ctlr",
      "cpus": 1,
      "mem": 128,
      "instances": 1,
      "container": {
        "type": "DOCKER",
        "docker": {
          "image": "f5networks/marathon-asp-ctlr:1.1.0",
          "network": "BRIDGE",
          "forcePullImage": true,
          "privileged": false,
          "portMappings": []
        },
        "volumes": []
      },
      // defines the global ASP configurations
      "env": {
        "MARATHON_URL": "http://10.190.25.75:8080",
        // ASP image
        "ASP_DEFAULT_CONTAINER": "store/f5networks/asp:1.1.0",
        // defines the label you will use in App definitions to activate the ASP
        "ASP_ENABLE_LABEL": "f5-asp",
        // provide the location where credentials for Docker Store can be found
        // REQUIRED TO PULL THE ASP IMAGE
        "ASP_DEFAULT_URIS": "file:///etc/docker.tar.gz",
        "ASP_DEFAULT_CPU": "1",
        "ASP_DEFAULT_MEM": "256",
        "ASP_DEFAULT_LOG_LEVEL": "debug",
        // Required as of ASP v1.1
        // Replace "myUser" with the name of an ephemeral-store user;
        // must match the "/CN" setting provided for a user certificate
        // Provide the complete contents of the user .key and .crt files
        // Provide the complete contents of the rootCA.crt file
        "ASP_EPHEMERAL_STORE": "{
          \"host\": \"ephemeral-store.marathon.l4lb.thisdcos.directory\",
          \"port\": 8087,
          \"users\": {
             \"myUser\" : {
                 \"key\": \"<user-private-key-in-PEM-format>\",
                 \"cert\": \"<user-cert-in-PEM-format>\"
             }
          },
          \"root-ca\": \"<rootCA-cert-in-PEM-format>\"
        }",
        "ASP_DEFAULT_STATS_FLUSH_INTERVAL": "10000",
        // include if sending stats to an external service
        "ASP_DEFAULT_STATS_URL": "http://<splunk_url>:8088",
        "ASP_DEFAULT_STATS_TOKEN": "<provide_stats_auth_token>",
        "ASP_DEFAULT_STATS_BACKEND": "splunk"
      }
    }
    

    f5-marathon-asp-ctlr-example.json

  2. Upload the config file to the Marathon API server.

    1
    curl -X POST -H "Content-Type: application/json" http://10.190.25.75:8080/v2/apps -d @f5-marathon-asp-ctlr.json
    
  3. Send a GET request to the Marathon API server to verify successful creation of the ASP Controller App.

Tip

You can pass the response through a pretty-print tool like jq for better readability.

 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
curl -X GET http://10.190.25.75:8080/v2/apps/marathon-asp-ctlr | jq .
   {
     "app": {
       "id": "/marathon-asp-ctlr",
       "cmd": null,
       "args": null,
       "user": null,
       "env": {
         "ASP_DEFAULT_STATS_URL": "http://<splunk_url>:8088",
         "ASP_DEFAULT_MEM": "256",
         "MARATHON_URL": "http://10.190.25.75:8080",
         "ASP_DEFAULT_STATS_TOKEN": "<provide_stats_auth_token>",
         "ASP_DEFAULT_CONTAINER": "f5networks/asp:1.1",
         "ASP_EPHEMERAL_STORE": "{\"host\": \"ephemeral-store.marathon.l4lb.thisdcos.directory\", \"port\": 8087, \"users\": {\"myUser\" : {\"key\": \"----REDACTED----\", \"cert\": \"----REDACTED----\"}}, \"root-ca\": \"----REDACTED----\"}",
         "ASP_DEFAULT_STATS_FLUSH_INTERVAL": "10000",
         "ASP_DEFAULT_CPU": "1",
         "ASP_DEFAULT_STATS_BACKEND": "splunk",
         "ASP_ENABLE_LABEL": "ASP",
         "ASP_DEFAULT_LOG_LEVEL": "debug"
       },
       "instances": 1,
       "cpus": 1,
       "mem": 128,
       "disk": 0,
       "gpus": 0,
       "executor": "",
       "constraints": [],
       "uris": [],
       "fetch": [],
       "storeUrls": [],
       "backoffSeconds": 1,
       "backoffFactor": 1.15,
       "maxLaunchDelaySeconds": 3600,
       "container": {
         "type": "DOCKER",
         "volumes": [],
         "docker": {
           "image": "f5networks/marathon-asp-ctlr:1.1.0",
           "network": "BRIDGE",
           "portMappings": null,
           "privileged": false,
           "parameters": [],
           "forcePullImage": true
         }
       },
       "healthChecks": [],
       "readinessChecks": [],
       "dependencies": [],
       "upgradeStrategy": {
         "minimumHealthCapacity": 1,
         "maximumOverCapacity": 1
       },
       "labels": {},
       "acceptedResourceRoles": null,
       "ipAddress": null,
       "version": "2017-06-20T20:27:03.548Z",
       "residency": null,
       "secrets": {},
       "taskKillGracePeriodSeconds": null,
       "ports": [
         10002
       ],
       "portDefinitions": [
         {
           "port": 10002,
           "protocol": "tcp",
           "labels": {}
         }
       ],
       "requirePorts": false,
       "versionInfo": {
         "lastScalingAt": "2017-06-20T20:27:03.548Z",
         "lastConfigChangeAt": "2017-06-20T20:27:03.548Z"
       },
       "tasksStaged": 0,
       "tasksRunning": 1,
       "tasksHealthy": 1,
       "tasksUnhealthy":0,
       "deployments": [],
       "tasks": [...],
     }
   }

What’s Next

Footnotes

[1]Required as of asp v1.1.0.