[redfish] Deliver bridged-container syslog to the host over docker0 - #29258
Conversation
Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
rebuild-source: sonic-net#29258 @ nexthop-ai/sonic-buildimage 0bd6207 [case: upstream:open]
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
yxieca
left a comment
There was a problem hiding this comment.
Approve.
Generalizes the dhcp_server-specific docker0-syslog plumbing in docker_image_ctl.j2 and rsyslog-config.sh to a bridged_containers = ["dhcp_server", "redfish"] set, so redfish (bridge-networked) delivers its container syslog to the host over the docker0 gateway. This is the container-side counterpart to sonic-host-services#429.
Verified:
- Single source of truth: the
bridged_containerslist drives the rule check, both waits, and the syslog-target selection, so the dhcp_server and redfish paths can't drift. - The container
-Ccheck and caclmgrd's-Arule resolve to the same kernel rule (iptables-Ccanonicalizes-p tcpand normalizes ordering); theredfish_syslogcomment tag matches. If they ever diverge, the wait degrades to a warn-only timeout rather than a failure. - Loop rewrite
{0..10}->for (( attempt=0; attempt<=BRIDGE_SYSLOG_WAIT_SECS; attempt++ ))is behavior-preserving (11 iterations, ~10s); the C-style form is needed to interpolate the parameterized bound. sudo iptablesis correctly used for redfish's check (redfish.service runs as sonicadmin) while dhcp_server keeps plain iptables;SYSLOG_TARGET_IPpoints bridged containers at the docker0 gateway.
Non-blocking: the -C wait is warn-only, so early syslog can be dropped until the next caclmgrd rebuild lands the rule — same behavior as the existing dhcp_server path.
Reviewed with AI assistance on behalf of Ying.
rebuild-source: sonic-net#29258 @ nexthop-ai/sonic-buildimage 0bd6207 [case: upstream:open]
rebuild-source: sonic-net#29258 @ nexthop-ai/sonic-buildimage 0bd6207 [case: upstream:open]
|
This PR is approved for branch msft-202608. No cherry pick PR has been created because of code conflict. @shreyansh-nexthop, please manually create the cherry pick PR. ---Powered by SONiC BuildBot
|
|
Hi @shreyansh-nexthop , Could you help resolve the cherry-pick conflict to 202608 branch |
Why I did it
redfishruns bridge-networked, asdocker_image_ctl.j2already notes at the port-mapping block, so its127.0.0.1is not the host's and its rsyslog cannot reach the host over loopback. Logs emitted inside the container never reach the host/var/log/syslog, including a process going FATAL at startup, which is exactly when they are most needed.Three pieces are missing for
redfish, all of whichdhcp_serveralready has:SYSLOG_TARGET_IP=127.0.0.1, which loops back inside the container. Onlydhcp_serveris pointed at the docker0 gateway.docker0_ipis keyed on thedhcp_serverFEATURE entry, which aspeed images do not have, so no docker0 input is generated for the host rsyslog.docker0rather thanlo, matches no ACCEPT, and is swept intocaclmgrd's catch-all DROP. That side is handled by [caclmgrd] Own the redfish docker0 syslog INPUT exception sonic-host-services#429.This extends #28580, which added the
dhcp_serverstart and stop waits on the caclmgrd-owned rule.How I did it
files/build_templates/docker_image_ctl.j2bridged_containerslist names the bridge-networked containers once, and the rule check, both waits, and the syslog target render from single parametrized blocks, so thedhcp_serverandredfishcopies cannot drift.SYSLOG_TARGET_IPpoints at the docker0 gateway forredfish, as it already does fordhcp_server.sudoforredfish, sinceredfish.serviceruns assonicadmin.BRIDGE_SYSLOG_WAIT_SECSreplaces the hardcoded 10 second bound.stop()warning read "rule not absent" and now reads "rule still present".files/image_config/rsyslog/rsyslog-config.shdocker0_ipis populated when any bridged feature entry exists, so the host rsyslog binds its RELP listener on the docker0 gateway. Theredfishentry is only appended on aspeed images, so other platforms are unaffected.-ntest.Both waits warn and continue rather than fail, as in #28580.
How to verify it
On an aspeed platform with
redfishenabled:ESTABLISHEDentry cannot mask the result:redfishdisabled and without rebooting:dhcp_serverbehaviour is unchanged: the rendered script for that container is equivalent to what #28580 produced, with the container name and the wait bound now supplied by the shared blocks.Which release branch to port
Description for the changelog
[redfish] Deliver bridged-container syslog to the host over the docker0 gateway, and render the bridged-container syslog handling in docker_image_ctl from a single list so dhcp_server and redfish cannot drift.
Link to config_db schema for YANG module changes
N/A, no schema change.