F5 Resources Explained

An F5 Resource is a specially-formatted JSON blob that defines a set of BIG-IP objects. In Kubernetes and OpenShift, you can include the F5 Resource in a ConfigMap to Attach Virtual Servers to Services.

Creating a virtual server with an F5 Resource gives you the greatest degree of control over the objects that the BIG-IP Controller ultimately creates on the BIG-IP system. If you only need to define a few basic settings, consider using an Ingress resource in Kubernetes or a Route resource in OpenShift.

You can use an F5 Resource ConfigMap to create custom virtual servers for your Applications. For example:

  • HTTP virtual servers that use non-standard ports;
  • HTTP virtual servers that needs customization beyond the BIG-IP Controller Ingress annotations (like iApps);
  • virtual servers for TCP or UDP applications that require non-HTTP ingress.

F5 Resource properties

The F5 resource is a JSON blob consisting of the properties shown in the table below.

F5 Resource properties
Property Description Required
data A JSON object Required
  • frontend
Defines BIG-IP objects.  
  • backend

Identifies the Service you want to proxy.

Defines a BIG-IP health monitor(s) for the Service.

 
f5type A label property watched by the BIG-IP Controller. Required
schema Tells the BIG-IP Controller how to interpret the encoded data. Required

Data.Frontend

The data.frontend property defines the objects you want to create on the BIG-IP system for a specific Service. In this section, you can define a custom virtual server using the virtualServer properties or deploy an iApp using the iApp properties.

The iApp configuration parameters include a set of customizable iappVariables parameters. These custom user-defined parameters must correspond to fields in the iApp template you want to launch. You can also define the iApp pool member table that the iApp creates on the BIG-IP system.

Tip

With the iApp configuration parameters, you can also deploy objects across BIG-IP modules (for example, ASM and LTM).

Data.Backend

Use the data.backend property to identify the Kubernetes Service that makes up the back end server pool.

Tip

You can also define BIG-IP health monitors in this section.

F5 type

The f5type is a Kubernetes Resource metadata label. Its usage differs depending on whether you’re working in Kubernetes or OpenShift.

In Kubernetes, when used in an F5 Resource ConfigMap, the f5type value must be virtual-server. This tells the BIG-IP Controller that you want to create a virtual server on the BIG-IP device.

In OpenShift, when used in a Route Resource, you can use the f5type label to identify which Routes you want the BIG-IP Controller to watch. When you deploy the Controller with the --route-label setting, the BIG-IP Controller watches the OpenShift API for Routes that contain the specified label. See Attach Virtual Servers to OpenShift Routes for more information.

F5 schema

The F5 schema defines the structure and formatting for the data defined in the F5 resource. The BIG-IP Controller uses the schema version provided to validate the other inputs.

While all BIG-IP Controller versions are backwards-compatible, using an older schema may limit Controller functionality. Be sure to use the most recent schema version that corresponds with your Controller version to ensure access to the full feature set.

See also

See the F5 schema compatibility table for Controller-schema compatibility.

Example F5 Resources

F5 Virtual Server ConfigMap

The example below creates an HTTP virtual server with a pool, pool member, and health monitor for the Service named “myService”. The BIG-IP Controller will create the virtual server in the k8s partition, which already exists on the BIG-IP system.

kind: ConfigMap
apiVersion: v1
metadata:
  name: myApp.vs
  labels:
    f5type: virtual-server
data:
  # See the f5-schema table for schema-controller compatibility
  # http://clouddocs.f5.com/containers/latest/releases_and_versioning.html#f5-schema
  schema: "f5schemadb://bigip-virtual-server_v0.1.7.json"
  data: |
    {
      "virtualServer": {
        "backend": {
          "servicePort": 80,
          "serviceName": "myService",
          "healthMonitors": [{
            "interval": 30,
            "protocol": "http",
            "send": "GET HTTP/1.1/\r\n",
            "recv": "200|OK",
            "timeout": 120
          }]
        },
        "frontend": {
          "virtualAddress": {
            "port": 8080,
            "bindAddr": "1.2.3.4"
          },
          "partition": "k8s",
          "balance": "least-connections-member",
          "mode": "http"
        }
      }
    }

F5 iApp ConfigMap

The example below uses the BIG-IP Controller to deploy the F5 iApp called f5.http, which resides in the /Common partition on the BIG-IP device.

kind: ConfigMap
apiVersion: v1
metadata:
  name: k8s.http
  namespace: default
  labels:
    f5type: virtual-server
data:
  # See the f5-schema table for schema-controller compatibility
  # http://clouddocs.f5.com/containers/latest/releases_and_versioning.html#f5-schema
  schema: "f5schemadb://bigip-virtual-server_v0.1.7.json"
  data: |
    {
      "virtualServer": {
        "backend": {
          "serviceName": "myService",
          "servicePort": 80
        },
        "frontend": {
          "partition": "k8s",
          "iapp": "/Common/f5.http",
          "iappPoolMemberTable": {
            "name": "pool__members",
            "columns": [
                {"name": "addr", "kind": "IPAddress"},
                {"name": "port", "kind": "Port"},
                {"name": "connection_limit", "value": "0"}
            ]
          },
          "iappOptions": {
            "description": "myService_f5.http iApp"
          },
          "iappVariables": {
            "monitor__monitor": "/#create_new#",
            "monitor__response": "none",
            "monitor__uri": "/",
            "net__client_mode": "wan",
            "net__server_mode": "lan",
            "pool__addr": "127.0.0.2",
            "pool__pool_to_use": "/#create_new#",
            "pool__port": "4430"
          }
        }
      }
    }