F5 Container Integrations v1.1

Current Page

Application Services Proxy

Cloud Foundry

Kubernetes

Mesos Marathon

OpenShift

Support

Troubleshooting

Tutorials

Cloud Docs Home > F5 Container Integrations Index

Deploy iApps with BIG-IP Controller for Marathon

The BIG-IP Controller can deploy any iApp on a BIG-IP device via a set of iApp configuration parameters. The iApp must exist on your BIG-IP device before BIG-IP Controller attempts to deploy it. The steps presented here apply to any built-in or custom iApp.

If you prefer not to use iApps, you can also manage BIG-IP objects directly with BIG-IP Controller.

Define the F5 iApp Application Labels

The example JSON blob shown below defines the f5.http iApp for a Marathon Application using F5 Application Labels. The F5_IAPP_VARIABLE labels correspond to fields in the iApp template ‘s presentation section. You can create iApp variables for any built-in or custom iApp.

See also

The marathon-bigip-ctlr product documentation for detailed information about iApp labels.

Deploy the iApp

  1. Add the iApp labels section to the service definition of your Marathon Application.

    Example F5 iApp Application Labels
     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
    {
      "id": "basic-3",
      "cmd": "python3 -m http.server 8080",
      "cpus": 0.5,
      "mem": 32.0,
      "container": {
        "type": "DOCKER",
        "docker": {
          "image": "python:3",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 8080,
              "hostPort": 0,
              "protocol": "tcp"
            }
          ]
        }
      },
      "instances": 2,
      "labels": {
        "F5_PARTITION": "mesos",
        "F5_0_IAPP_TEMPLATE": "/Common/f5.http",
        "F5_0_IAPP_POOL_MEMBER_TABLE": "{ \"name\": \"pool__members\", \"columns\": [ { \"name\":\"addr\", \"kind\":\"IPAddress\"}, { \"name\":\"port\", \"kind\":\"Port\" }, { \"name\":\"connection_limit\", \"value\": \"0\" }]}",
        "F5_0_IAPP_VARIABLE_net__server_mode": "lan",
        "F5_0_IAPP_VARIABLE_pool__addr": "10.190.25.240",
        "F5_0_IAPP_VARIABLE_pool__pool_to_use": "/#create_new#",
        "F5_0_IAPP_VARIABLE_monitor__monitor": "/#create_new#",
        "F5_0_IAPP_VARIABLE_monitor__uri": "/",
        "F5_0_IAPP_VARIABLE_monitor__response": "none",
        "F5_0_IAPP_VARIABLE_net__client_mode": "wan",
        "F5_0_IAPP_VARIABLE_pool__port": "8080",
        "F5_0_IAPP_OPTION_description": "This is a test iApp"
      },
      "healthChecks": [
        {
          "protocol": "TCP",
          "portIndex": 0,
          "path": "/",
          "gracePeriodSeconds": 5,
          "intervalSeconds": 20,
          "maxConsecutiveFailures": 3
        }
      ]
    }
    

    Download f5-marathon-bigip-ctlr-vs-iApp-example.json

  2. Send a PUT request to the Marathon API server to update the Application definition.

    user@mesos-master:~$ curl -X PUT -H 'Content-Type: application/json' http://10.190.25.75:8080/v2/apps/basic-3 -d @marathon-iapp-example.json
    
  3. Verify creation of the iApp, and its related objects, on the BIG-IP. This is most easily done via the configuration utility:

    • Log in to the BIG-IP configuration utility.
    • Go to iApps ‣ Application Services.
    • Verify that a new item prefixed with the name of your Marathon Application appears in the list, in the correct partition.

Delete iApp objects

  1. Delete the F5 Application Labels from the Application definition.

  2. Send a PUT request to the Marathon API server to update the Application definition.

    user@mesos-master:~$ curl -X PUT -H 'Content-Type: application/json' http://10.190.25.75:8080/v2/apps/basic-3 -d @marathon-iapp-example.json
    
  3. Verify the iApp and its related objects no longer exist on the BIG-IP.

    • Log in to the BIG-IP configuration utility.
    • Go to iApps ‣ Application Services.
    • Verify that the item prefixed with the name of your Marathon Application no longer appears in the list for your partition.