F5Networks / k8s-bigip-ctlr

Repository for F5 Container Ingress Services for Kubernetes & OpenShift.
Apache License 2.0
364 stars 195 forks source link

log_as3_response doesn´t log response #3595

Closed alonsocamaro closed 1 month ago

alonsocamaro commented 1 month ago

Setup Details

Build: quay.io/f5networks/k8s-bigip-ctlr-devel:747c54aea334532b39bb611bd04d16036d8f6b05 Agent Mode: AS3

Description

Using the following configuration:

   agent: as3
    as3-validation: true
    bigip_partition: $PARTITION_DEFAULT
    bigip_url: ${BIGIP_IP[0]}
    custom-resource-mode: true
    insecure: true
    log_as3_response: true
    log_level: INFO
    manage_routes: false
    multi-cluster-mode: primary
    extended-spec-configmap: $CIS_NS/global-cm.${CLUSTERS_ALIAS[0]}
    pool-member-type: nodeport
    share-nodes: true

I only get the following messages:

2024/10/15 14:35:00 [INFO] [Retry][AS3] post resulted in FAILURE
2024/10/15 14:35:30 [INFO] [Retry][AS3] posting request to https://10.1.1.7 for mc-twotier tenants
2024/10/15 14:35:33 [INFO] [Retry][AS3] post resulted in FAILURE
2024/10/15 14:36:03 [INFO] [Retry][AS3] posting request to https://10.1.1.7 for mc-twotier tenants
2024/10/15 14:36:05 [INFO] [Retry][AS3] post resulted in FAILURE

There is no way the customer can know what is happening. The customer has to use DEBUG mode to figure out what is happening:

2024/10/15 14:48:58 [DEBUG] [AS3] Raw response from Big-IP: map[code:422 declarationFullId: message:Unable to find /Common/oneconnect-32 for /mc-twotier/Shared/crd_10_1_10_106_443/profileMultiplex] 

But DEBUG is very user unfriendly because it posts too much info.

Steps To Reproduce

Create a bad config

Expected Result

The default behaviour of CIS should be to include the AS3 response in case of error in order to figure out what is the culprit when something is wrong.

Please consider adding the AS3 response in INFO level even if log_as3_response is not true.

Actual Result

Not user friendly logging

trinaths commented 1 month ago

Recommend using AS3DEBUG for more info in the logs.