F5 Solutions for Containers > Appendix > Appendix 7: Introduction to Mesos / Marathon > Module 2: F5 Container Connector with Mesos / Marathon Source | Edit on
Lab 3.2 - F5 Container Connector Usage¶
Now that our container connector is up and running, let’s deploy an application and leverage our F5 CC.
For this lab we’ll use a simple pre-configured docker image called “f5-hello-world”. It can be found on docker hub at f5devcentral/f5-hello-world
App Deployment¶
From the jumpbox connect to the Marathon UI at http://10.2.10.21:8080 and click “Create Application”.

Click on “JSON mode” in the top-right corner
REPLACE the 8 lines of default JSON code shown with the following JSON code and click Create Application
1{ 2 "id": "f5-hello-world", 3 "cpus": 0.1, 4 "mem": 128.0, 5 "instances": 2, 6 "container": { 7 "type": "DOCKER", 8 "docker": { 9 "image": "f5devcentral/f5-hello-world:latest", 10 "network": "BRIDGE", 11 "forcePullImage": false, 12 "portMappings": [ 13 { "containerPort": 8080, "hostPort": 0, "protocol": "tcp" } 14 ] 15 } 16 }, 17 "labels": { 18 "F5_PARTITION": "mesos", 19 "F5_0_BIND_ADDR": "10.2.10.81", 20 "F5_0_MODE": "http", 21 "F5_0_BALANCE": "round-robin", 22 "F5_0_PORT": "80" 23 }, 24 "healthChecks": [ 25 { 26 "protocol": "HTTP", 27 "portIndex": 0, 28 "path": "/", 29 "gracePeriodSeconds": 5, 30 "intervalSeconds": 16, 31 "maxConsecutiveFailures": 3 32 } 33 ] 34}
F5-Hello-World is “Deploying”
Note
The JSON app definition specified several things:
- What container image to use (line 9)
- The BIG-IP configuration (Partition, VS IP, VS Port).
- The Marathon health check for this app. The BIG-IP will replicate those health checks.
- The number of instances (line 5)
Wait for your application to be successfully deployed and be in a running state.
Click on “f5-hello-world”. Here you will see two instance deployed, with their node IP and Port.
Click on one of the <IP:Port> assigned to be redirect there:
We can check whether the Marathon BIG-IP Controller has updated our BIG-IP configuration accordingly. Connect to your BIG-IP on https://10.1.1.245 and go to Local Traffic –> Virtual Server.
Warning
Don’t forget to select the “mesos” partition or you’ll see nothing.
You should have something like this:
Go to Local Traffic –> Pool –> “f5-hello-world_80” –> Members. Here we can see that two pool members are defined and the IP:Port match ou deployed app in Marathon.
You should be able to access the application. In your browser try to connect to http://10.2.10.81
Scale the f5-hello-world app. Go back to the Marathon UI (http://10.2.10.21:8080). Go to Applications –> “f5-hello-world” and click “Scale Application”.
Let’s increase the number from 2 to 10 instances and click on “Scale Application”.
Once it is done you should see 10 “healthy instances” running in Marathon UI.
You can also check your pool members list on your BIG-IP.
As we can see, the Marathon BIG-IP Controller is adapting the pool members setup based on the number of instances delivering this application automatically.
Scale back the application to 2 to save resources for the next labs.