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

Use new istio-iptables cleanup methodology in VMs #52918

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

leosarra
Copy link
Contributor

@leosarra leosarra commented Aug 29, 2024

This update will change the current handling of start/stop/clean operations in VMs to rely on istio-iptables --cleanup-only instead of the old istio-clean-iptables command.

istio-iptables --cleanup-only computes the rules that need to be deleted in a "dynamic" way based on what the command would have applied if the cleanup option was not used.
On the other hand, istio-clean-iptables relied on hardcoded logic which was separate from the one used to create rules in istio-iptables. This approach required constant maintenance to ensure that the two different tools did not diverge over time.

This change removes the need to maintain istio-clean-iptables and prevents issues similar to #52835 and #41431 from occurring.

I'm not sure whether the istio-clean-iptables source code in the repo should be removed right away or not. We could keep it around for 1-2 releases in case someone is using it outside of our scripts but that would entail that we still need to support it a bit more in case of changes in istio-iptables rules.

@istio-testing
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Aug 29, 2024
@istio-policy-bot istio-policy-bot added area/environments area/networking release-notes-none Indicates a PR that does not require release notes. labels Aug 29, 2024
@istio-testing istio-testing added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 29, 2024
@istio-testing istio-testing added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 29, 2024
@istio-testing istio-testing added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 29, 2024
@leosarra leosarra changed the title Use new iptbles cleanup methodology in VMs Use new istio-iptables cleanup methodology in VMs Aug 30, 2024
@leosarra leosarra marked this pull request as ready for review August 30, 2024 09:41
@leosarra leosarra requested a review from a team as a code owner August 30, 2024 09:41
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Aug 30, 2024
@@ -66,7 +66,7 @@ if [ "${ISTIO_CUSTOM_IP_TABLES}" != "true" ] ; then
if [[ ${1-} == "init" || ${1-} == "-p" ]] ; then
Copy link
Contributor Author

@leosarra leosarra Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find where this codepath is used but I adjusted it anyway. Perhaps it is something old we don't need to support anymore?

@@ -77,7 +77,7 @@ if [ "${ISTIO_CUSTOM_IP_TABLES}" != "true" ] ; then
if [[ ${1-} != "run" ]] ; then
# clean the previous Istio iptables chains. This part is different from the init image mode,
# where the init container runs in a fresh environment and there cannot be previous Istio chains
"${ISTIO_BIN_BASE}/pilot-agent" istio-clean-iptables
"${ISTIO_BIN_BASE}/pilot-agent" istio-iptables --cleanup-only
Copy link
Contributor Author

@leosarra leosarra Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have been simplified in one ""${ISTIO_BIN_BASE}/pilot-agent" istio-iptables --reconcile" cmd but I'm keeping the "preemptive cleanup"+apply step separate to be as consistent as possible with the old handling

@istio-testing istio-testing merged commit 4815dfe into istio:master Aug 30, 2024
27 checks passed
luksa pushed a commit to luksa/istio that referenced this pull request Oct 14, 2024
* upstream/master:
  Automator: update proxy@master in istio/istio@master (istio#52957)
  Add/Increase retry timeout due to delay in AWS config propagation (istio#52938)
  Apply local weight lb only when locality lb is enabled (istio#52898)
  Fix sending to external service entry from a VS (istio#52589)
  Automator: update proxy@master in istio/istio@master (istio#52946)
  Add option to exclude CRDs during install (istio#52947)
  Use new istio-iptables cleanup methodology in VMs (istio#52918)
@leosarra leosarra mentioned this pull request Nov 19, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/environments area/networking release-notes-none Indicates a PR that does not require release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants