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

avoid adding kube-router specific rules to enforce network policies in built-in chain used in fitler table #909

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

murali-reddy
Copy link
Member

@murali-reddy murali-reddy commented May 26, 2020

This is the original design (#185) I had in my mind for network policies implementation. Should have been fixed much earlier.

  • adds one level of indirection. No logic change in sync of pod, network policy chains and cleanup of state chains, ipsets etc
    INPUT -> KUBE-ROUTER-INPUT
    FORWARD -> KUBE-ROUTER-FORWARD
    OUTPUT -> KUBE-ROUTER-OUTPUT

  • easy to troubleshoot with namesake custom chains

// Creates custom chains KUBE-ROUTER-INPUT, KUBE-ROUTER-FORWARD, KUBE-ROUTER-OUTPUT
// and following rules in the filter table to jump from builtin chain to custom chain
// -A INPUT   -m comment --comment "kube-router netpol" -j KUBE-ROUTER-INPUT
// -A FORWARD -m comment --comment "kube-router netpol" -j KUBE-ROUTER-FORWARD
// -A OUTPUT  -m comment --comment "kube-router netpol" -j KUBE-ROUTER-OUTPUT

Fixes #185

Note: this is a breaking change. Users need to flush the filter table so old rules in INPUT, FORWARD, OUTPUT chains are cleared.

@murali-reddy murali-reddy changed the title avoids adding kube-router specific rules to enforce network policies in built-in chain used in fitler table avoid adding kube-router specific rules to enforce network policies in built-in chain used in fitler table May 26, 2020
built in chain used in fitler table

- adds one level of indirection
  INPUT   -> KUBE-ROUTER-INPUT
  FORWARD -> KUBE-ROUTER-FORWARD
  OUTPUT  -> KUBE-ROUTER-OUTPUT

- easy to troubleshoot with namesake custom chains

Fixes #185
@murali-reddy
Copy link
Member Author

I would like to merge this PR over the week end and cut a 1.0 RC candidate. This is a desirable change for 1.0 release. If any one has concerns please raise. Also note

Note: this is a breaking change. Users need to flush the filter table so old rules in INPUT, FORWARD, OUTPUT chains are cleared.

@murali-reddy murali-reddy merged commit 210dc3d into master Jun 8, 2020
Copy link
Collaborator

@aauren aauren left a comment

Choose a reason for hiding this comment

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

I know this review is coming late, but this LGTM.

@murali-reddy
Copy link
Member Author

I know this review is coming late, but this LGTM.

Neverthless thanks. Good to have extra pair of eyes review.

FabienZouaoui pushed a commit to SirDataFR/kube-router that referenced this pull request Jun 22, 2020
…in (cloudnativelabs#909)

built in chain used in fitler table

- adds one level of indirection
  INPUT   -> KUBE-ROUTER-INPUT
  FORWARD -> KUBE-ROUTER-FORWARD
  OUTPUT  -> KUBE-ROUTER-OUTPUT

- easy to troubleshoot with namesake custom chains

Fixes cloudnativelabs#185
@aauren aauren deleted the npc-refactor branch September 4, 2023 15:20
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

Successfully merging this pull request may close these issues.

consolidate network policy iptables rules in FORWARD/OUTPUT chains of filter table
2 participants