F5Networks / f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
Apache License 2.0
169 stars 54 forks source link

Service discovery does not work with per-application declarations #869

Open mikebordon opened 3 months ago

mikebordon commented 3 months ago

Environment

Summary

When using the per-app endpoint to deploy a configuration, pools which are configured to populate their members via service discovery never do so.

The deployment request is acknowledged as successful, and all other resources are successfully created, but the pool is never populated with members. Additionally, the typical Got service discovery task request log entries are noticeably absent from restnoded.log.

Per-tenant endpoints (POST and PATCH) behave as expected.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Given an existing tenant, submit the following declaration via POST /mgmt/shared/appsvcs/declare/MyTenant/applications:

    {
    "schemaVersion": "3.52.0",
    "my-app-post": {
        "class": "Application",
        "my-pool-post": {
            "class": "Pool",
            "monitors": [{
                "bigip": "/Common/http"
            }],
            "minimumMonitors": "all",
            "members": [
                {
                    "servicePort": 8080,
                    "addressDiscovery": "consul",
                    "updateInterval": 10,
                    "uri": "http://my-consul:8500/v1/catalog/service/my-service",
                    "rejectUnauthorized": false,
                    "jmesPathQuery": "[*].{id:Node,ip:{private:ServiceAddress,public:ServiceAddress}}"
                }
            ]
        }
    }
    }
  2. For comparison, submit effectively the same declaration via PATCH /mgmt/shared/appsvcs/declare/MyTenant:

    [
    {
        "op": "add",
        "path": "/MyTenant/my-app-patch",
        "value": {
            "class": "Application",
            "my-pool-patch": {
                "class": "Pool",
                "monitors": [{
                    "bigip": "/Common/http"
                }],
                "minimumMonitors": "all",
                "members": [
                    {
                        "servicePort": 8080,
                        "addressDiscovery": "consul",
                        "updateInterval": 10,
                        "uri": "http://my-consul:8500/v1/catalog/service/my-service",
                        "rejectUnauthorized": false,
                        "jmesPathQuery": "[*].{id:Node,ip:{private:ServiceAddress,public:ServiceAddress}}"
                    }
                ]
            }
        }
    }
    ]
  3. Observe the status of each pool in the pool list:

    • my-pool-patch will contain members
    • my-pool-post will not

Expected Behavior

The pool created via the per-app POST and the pool created via the tenant PATCH will ultimately have the same members, as populated via service discovery tasks.

Actual Behavior

The pool created via the per-app POST remains empty indefinitely whereas the the pool created via the tenant PATCH behaves as expected.