kind: ConfigMap
apiVersion: v1
metadata:
  name: f5-cis-configmap-arcadia
  namespace: arcadia
  labels:
    f5type: virtual-server
    as3: "true"
data:
  template: |
    {
      "class": "AS3",
      "action": "deploy",
      "persist": true,
      "declaration": {
        "class": "ADC",
        "schemaVersion": "3.21.0",
        "id": "f5-cis-configmap-arcadia",
        "arcadia": {
          "class": "Tenant",
          "arcadia_app": {
            "class": "Application",
            "template": "generic",
            "arcadia_vs": {
              "class": "Service_HTTP",
              "iRules": ["arcadia_iRules"],
              "virtualAddresses": [
                "192.168.200.60"
              ],
              "snat": "self",
              "serviceDownImmediateAction": "reset",
              "virtualPort": 80,
              "persistenceMethods": [{
                "use": "arcadia_cookie_encryption"
              }],
              "pool": "arcadia_main_pool"
            },
            "arcadia_cookie_encryption": {
              "class": "Persist",
              "persistenceMethod": "cookie",
              "encrypt": true,
              "cookieMethod": "insert",
              "passphrase": {
                "ciphertext": "a3RjeGZ5Z2Q=",
                "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0="
              }
            },
            "arcadia_main_pool": {
              "class": "Pool",
              "monitors": [
                "http"
              ],
              "loadBalancingMode": "least-connections-member",
              "minimumMembersActive": 0,
              "members": [
              {
                "servicePort": 80,
                "serverAddresses": []
              }
              ]
            },
            "arcadia_backend_pool": {
              "class": "Pool",
              "monitors": [
                "http"
              ],
              "loadBalancingMode": "least-connections-member",
              "minimumMembersActive": 0,
              "members": [
              {
                "servicePort": 80,
                "serverAddresses": []
              }
              ]
            },
            "arcadia_app2_pool": {
              "class": "Pool",
              "monitors": [
                "http"
              ],
              "loadBalancingMode": "least-connections-member",
              "minimumMembersActive": 0,
              "members": [
              {
                "servicePort": 80,
                "serverAddresses": []
              }
              ]
            },
            "arcadia_app3_pool": {
              "class": "Pool",
              "monitors": [
                "http"
              ],
              "loadBalancingMode": "least-connections-member",
              "minimumMembersActive": 0,
              "members": [
              {
                "servicePort": 80,
                "serverAddresses": []
              }
              ]
            },
            "arcadia_iRules": {
              "class": "iRule",
              "remark": "switch between pools",
              "iRule": "when HTTP_REQUEST {\n if { [HTTP::uri] starts_with \"/files\" } {\n pool arcadia_backend_pool \n } elseif {[HTTP::uri] starts_with \"/api\"} {\n pool arcadia_app2_pool \n } elseif {[HTTP::uri] starts_with \"/app3\"} {\n pool arcadia_app3_pool \n } else { \n pool arcadia_main_pool \n }\n  \n}"
            }
          }
        }
      }
    }
