Closed mazocode closed 2 years ago
@mazocode Thanks for the nice PR :). After fix PR, Could you provide the fixed network-node-manager image to verify rules?
Found an issue with the last cleanup rule being broken because iptables adds a warning like this
# Warning: iptables-legacy tables present, use iptables-legacy-save to see them
to the output. The result looks like this:
2021-08-31T13:03:05.722Z INFO controllers.Service.initalize there is no service info in k8s. cleanup output chain IPv4 rule {"rule": "-A NMANAGER_EX_CLUS_OUTPUT -d a.b.c.d/32 -m comment --comment \"41b0a981-d40c-53dd-84b4-7cb2a265647a/rdg-public-tcp# Warning: iptables-legacy tables present, use iptables-legacy-save to see them"}
I've fixed this by removing anything after #.
@mazocode Thanks for the nice PR :). After fix PR, Could you provide the fixed network-node-manager image to verify rules?
Image for testing is available here: registry.idnt.io/public/network-node-manager:idnt-1.2.3-ci
Found an issue with the last cleanup rule being broken because iptables adds a warning ....
Still broken with this fix:
2021-08-31T15:56:09.422Z INFO controllers.Service.initalize service info is diff. cleanup output chain IPv4 rule {"rule": "-A NMANAGER_EX_CLUS_OUTPUT -d a.b.c.d/32 -m comment --comment \"41b0a981-d40c-53dd-84b4-7cb2a265647a/rdg-public-tcp"}
2021-08-31T15:56:09.424Z ERROR controllers.Service.initalize iptables: Bad rule (does a matching rule exist in that chain?).
{"error": "exit status 1"}
Still broken with this fix:
Not sure what is going on with CombinedOutput() but somehow the Warning (sent to stderr) ends up somewhere within the output. Don't know if this is to be expected (not an go expert ;). However, I've changed the code to work around CombinedOutput and the result looks good.
@mazocode Can i test with registry.idnt.io/public/network-node-manager:idnt-1.2.3-ci image??
@mazocode Can i test with registry.idnt.io/public/network-node-manager:idnt-1.2.3-ci image?? Sure, feel free to try the image :) I've tested with k8 v1.20.10 and v1.20.7 on Rocky 8.4
@mazocode Thanks for the nice commit. After merging this, I will fix some codes. Thanks:)
This adds a wrapper script for iptables / nftables detection to support Rocky, CentOS and any other nftables based distribution. Tested with CentOS 8 and Rocky 8.