Lab 4 - Creating FAST Template for future app deployments

Install FAST template on BIG-IP

  1. Connect to admin@10.1.1.6 by clicking the device in the F5 HOSTS view

  2. You should see that FAST is already installed.

    ../../_images/lab01_vscode_fastInstalledVersion.png
  3. If you do not see FAST installed you can do the following:

  4. Navigate to FAST under the BIG-IP menu by choosing BIG-IP >> ATC >> FAST

    ../../_images/VScodeFASTDropdown.jpg
  5. Under the FAST dropdown, you should see a list of version options for the FAST extension. Select the Latest version. This will automatically install the rpm file to the connected BIG-IP. After a minute or so, you should see messages in your output indicating that it is installed:

    [INFO]: installing atc rpm job complete, waiting for services to restart (~30 seconds)
    
  6. After seeing the above message, please wait another a minute for your connected device to update in VSCode. If it has not refreshed automatically after a minute, try clicking on the 10.1.1.6 host again to refresh manually.

Render Simple FAST YML template to AS3

This lab will focus on rendering a FAST yml template using VScode template HTML Preview and generating AS3 declaration which can posted to BIG-IP in VScode istself.

  1. Copy the below YML file into the VScode browser. The below yml shows the values already populated for tenant name, virtual address, virtual port, server addresses and server port. The template portion has those variables already templatize with double curly braces.

    title: Simple HTTP Application
    description: Simple HTTP load balancer using the same port on client and server side.
    parameters:
      tenant_name: tophttp
      application_name: defaultsHTTP_8080
      virtual_address: 10.0.0.200
      virtual_port: 8080
      server_addresses:
        - 10.1.20.10
        - 10.1.20.11
      service_port: 80
    template: |
      {
        "class": "ADC",
        "schemaVersion": "3.20.0",
        "{{tenant_name}}": {
          "class": "Tenant",
          "{{application_name}}": {
            "class": "Application",
            "template": "http",
            "serviceMain": {
              "class": "Service_HTTP",
              "virtualAddresses": [
                "{{virtual_address}}"
              ],
              "virtualPort": {{virtual_port}},
              "pool": "{{application_name}}_Pool1"
            },
            "{{application_name}}_Pool1": {
              "class": "Pool",
              "monitors": [
                "icmp"
              ],
              "members": [
                {
                  "serverAddresses": {{server_addresses::array}},
                  "servicePort": {{service_port}}
                }
              ]
            }
          }
        }
      }
    
  2. Remaining on the VScode, select Render FAST template HTML Preview.

    ../../_images/render.png
  3. Review the Simple HTTP Application details.

    ../../_images/simplehttp.png
  4. Click on the Render button at the bottom of screen to see the generated AS3 declaration.

    ../../_images/renderas3.png
  5. Review the generated AS3 declaration.

    ../../_images/as3.png
  6. Remaining on VScode right click to POST as AS3 Declaration.

    ../../_images/postas3.png
  7. Remaining on VScode click on the AS3 tab --> Tenant, and you can see your tophttp application.

    ../../_images/tophttp1.png
  8. Go to UDF bigip1 Access, and click on TMUI to access bigip1.

    ../../_images/BIGIP_TMUIlogin.jpg
  9. Access bigip1 by logging into the GUI to review the configuration, Select partition as tophttp to see the details.

    ../../_images/bigip1.png
  10. Clean up the tenant after use. In VScode window, right click on the tophttp tenant and select Delete Tenant.

    ../../_images/deletetophttp1.png

Use VScode for Posting FAST Template Set

This lab will focus on converting an AS3 declaration into FAST YML and then packaging into FAST Template Set. The template set can be pushed to the BIG-IP. The FAST App can be deployed using the recently pushed template set.

  1. Go to VScode and select the explorer icon (files). Right click on fast >> templates folder and click on New Folder as shown below

    ../../_images/ag1.png
  2. Type name of the folder as Agility and hit return

    ../../_images/ag2.png
  3. Ensure that you have the 10.1.1.6 host selected in the F5 Extension.

  4. Create a new file in VSCode and copy/paste the AS3 declaration below

    {
      "$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema/latest/as3-schema.json",
      "class": "AS3",
      "action": "deploy",
      "persist": true,
      "declaration": {
        "class": "ADC",
        "schemaVersion": "3.0.0",
        "id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
        "label": "Sample 1",
        "remark": "Simple HTTP application with RR pool",
        "Sample_01": {
          "class": "Tenant",
          "A1": {
            "class": "Application",
            "template": "http",
            "serviceMain": {
              "class": "Service_HTTP",
              "virtualAddresses": [
                "10.0.1.10"
              ],
              "pool": "web_pool"
            },
            "web_pool": {
              "class": "Pool",
              "monitors": [
                "http"
              ],
              "members": [
                {
                  "servicePort": 80,
                  "serverAddresses": [
                    "192.0.1.10",
                    "192.0.1.11"
                  ]
                }
              ]
            }
          }
        }
      }
    }
    
  5. We need to convert from AS3 JSON to YML FAST template

    ../../_images/ag8.png
  6. While in the VScode right click to see the AS3-->FAST YAML option

    ../../_images/ag9.png
  7. Review the converted YML file.

  8. Replace the Virtual Server IP address "10.0.1.10" with "{{virtual_server}}".

  9. Replace ["192.0.1.10", "192.0.1.11"] with {{server_address::array}}.

  10. Replace 80 with {{service_port::integer}}.

    ../../_images/ag11.png
  11. Below shows the replacement or templatized parameters.

    ../../_images/ag12.png
  12. Now add the server_address, service_port and virtual_server to the parameters section along with description as shown below.

    virtual_server: Virtual Server
    service_port: 80
    server_addres: Server Address
    
    ../../_images/ag13.png
  13. Save the file as http.yml in the Agility folder.

    ../../_images/saveas.png ../../_images/ag14.png
  14. Review the YML template file which was just created.

    title: template title
    description: template description
    parameters:
      tenant_name: default tenant name
      service_address: Server Addresses
      service_port: 80
      virtual_server: Virtual Server
    definitions:
      tenant_name:
        title: Tenant Name
        type: string
        description: partition on bigip
    template: |
      {
        "$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema/latest/as3-schema.json",
        "class": "AS3",
        "action": "deploy",
        "persist": true,
        "declaration": {
          "class": "ADC",
          "schemaVersion": "3.0.0",
          "id": "urn:uuid:33045210-3ab8-4636-9b2a-c98d22ab915d",
          "label": "Sample 1",
          "remark": "Simple HTTP application with RR pool",
          "{{tenant_name}}": {
            "class": "Tenant",
            "A1": {
              "class": "Application",
              "template": "http",
              "serviceMain": {
                "class": "Service_HTTP",
                "virtualAddresses": [
                  "{{virtual_server}}"
                ],
                "pool": "web_pool"
              },
              "web_pool": {
                "class": "Pool",
                "monitors": [
                  "http"
                ],
                "members": [
                  {
                    "servicePort": {{service_port::integer}},
                    "serverAddresses": {{server_address::array}}
                  }
                ]
              }
            }
          }
        }
      }
    
  15. While you are in the VScode window highlight the folder Agility. Right click and select Post Template Set to post the new template to BIG-IP.

    ../../_images/ag16.png
  16. Go to UDF and Click on the bigip1 TMUI and login into the BIG-IP, Click on the iApps --> Application Services --> Application LX

    ../../_images/ag17.png
  17. Go to FAST Templates and scroll to the bottom to see the new Agility Template Set

    ../../_images/ag18.png
  18. Under the Agility Template set, Click on the template title

  19. Once you click on the template title, the template with default values will appear. you will see the template is rendered and is ready to take different values:

    ../../_images/ag21.png
  20. Enter the following values

    Tenant Name: Agility1
    service_port: 80
    virtual_server: 10.0.0.200
    
  21. Next, click Add row under server_addresses to expand. Enter the server addresses 10.1.20.10 and 10.1.20.11.

  22. Once finished, select Deploy in the top right corner of the screen.

  23. After deploying, you will be brought to the History tab with the status of your deployment:

    ../../_images/ag22.png
  24. Click on Partition on the top right select Agility1

    ../../_images/ag25.png
  25. Now go to Local Traffic and Select Virtual Servers to see the new Virtual Server created

    ../../_images/ag26.png
  26. Go back to VScode and click on your 10.1.1.6 BIG-IP under F5 Hosts. Then click on FAST VIEW >> Deployed Applications to see yournew Agility1/A1 application

    ../../_images/ag27.png
  27. Remianing on the Agility/A1 Right Click and Select Delete FAST App to remove the application frm BIG-IP

    ../../_images/ag28.png
  28. You can go back to BIG-IP GUI and check the application / Tenant is deleted.

This completes the lab.