Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support session in iapp services poolMemberTable #247

Open
juliantaylor opened this issue Oct 8, 2019 · 0 comments
Open

support session in iapp services poolMemberTable #247

juliantaylor opened this issue Oct 8, 2019 · 0 comments

Comments

@juliantaylor
Copy link

juliantaylor commented Oct 8, 2019

The k8s bigip controller sets the session value for the poolmembers of a service, but the cccl does not handle it so any kind of dynamic poolmember enabling or disabling cannot be done.

Being able to enable or disable poolmembers can be useful to avoid traffic loss in kubernetes clusters with f5 frontends and externalTrafficPolicy: Local kubernetes service as backend.
In this setup nodes may be added and removed dynamically and F5 by default sends traffic to unknown status nodes which cannot actually receive any traffic.
Being able to configure nodes as disabled and only enable them via the bigipcontroller/api when ready would help there.

The k8s-bigip controller (https://github.com/F5Networks/k8s-bigip-ctlr) sends following configuration data:

"poolMemberTable": {
            "name": "Pool_Definition__Pool_Members",
            "columns": [
              {
                "name": "Pool_Member_IP",
                "kind": "IPAddress"
              },
              {
                "name": "Pool_Member_Port",
                "kind": "Port"
              }
            ],
            "members": [
              {
                "address": "...",
                "port": ...,
                "session": "user-enabled"
              },

note the session: user-enabled value.

But the cccl in _iapp_build_tables https://github.com/f5devcentral/f5-cccl/blob/master/f5_cccl/resource/ltm/app_service.py#L139 does not handle the session field.

Can it be considered to also handle that field by adding another column kind and extending the schema appropriately.

We have tested this with a patched cccl and it does work as expected with following patch:

--- a/f5_cccl/resource/ltm/app_service.py
+++ b/f5_cccl/resource/ltm/app_service.py
@@ -165,6 +165,8 @@ class ApiApplicationService(ApplicationService):
                             row.append(address)
                         elif col['kind'] == 'Port':
                             row.append(str(node['port']))
+                        elif col['kind'] == 'Session':
+                            row.append(str(node['session']))
 
                 rows.append({'row': row})
 
@@ -187,4 +189,5 @@ class ApiApplicationService(ApplicationService):
                     table['rows'].append({'row': row})
                 tables.append(table)
 
+        LOGGER.info("TABLES %r", tables)
         return tables
diff --git a/f5_cccl/schemas/cccl-ltm-api-schema.yml b/f5_cccl/schemas/cccl-ltm-api-schema.yml
index 58b4941..3fd376d 100644
--- a/f5_cccl/schemas/cccl-ltm-api-schema.yml
+++ b/f5_cccl/schemas/cccl-ltm-api-schema.yml
@@ -648,6 +648,22 @@ definitions:
     - "name"
     - "kind"
 
+  iAppSessionType:
+    type: "object"
+    properties:
+      name:
+        description: >
+          Specifies the session column in of the pool-member table
+        type: "string"
+        minLength: 1
+      kind:
+        type: "string"
+        enum:
+        - "Session"
+    required:
+    - "name"
+    - "kind"
+
   iAppPortType:
     type: "object"
     properties:
@@ -721,6 +737,7 @@ definitions:
             type: "array"
             items:
               oneOf:
+              - $ref: "#/definitions/iAppSessionType"
               - $ref: "#/definitions/iAppAddressType"
               - $ref: "#/definitions/iAppPortType"
               - $ref: "#/definitions/iAppValueType"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant