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

NP-621: add doc for nodeport host addresses #1372

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

zshi-redhat
Copy link
Contributor

ovn-kubernetes doesn't restrict the host addresses where
k8s nodeport service can be accessed from outside microshift
node, this commit adds nftable instructions to drop packet
matching the nodeport and host interface IPs. These nftable
instructions can work regardless of firewalld service state.

Signed-off-by: Zenghui Shi zshi@redhat.com

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 14, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 14, 2023

@zshi-redhat: This pull request references NP-621 which is a valid jira issue.

In response to this:

ovn-kubernetes doesn't restrict the host addresses where
k8s nodeport service can be accessed from outside microshift
node, this commit adds nftable instructions to drop packet
matching the nodeport and host interface IPs. These nftable
instructions can work regardless of firewalld service state.

Signed-off-by: Zenghui Shi zshi@redhat.com

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot requested review from oglok and pmtk February 14, 2023 09:56
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2023
docs/network/default_cni_plugin.md Outdated Show resolved Hide resolved
docs/network/default_cni_plugin.md Outdated Show resolved Hide resolved
```

> Record the `handle` number of the newly added rule (for removal)

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to also tell users how to make the nft rules permanent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Updated the nftable rule to use PREROUTING chain which doesn't need to specify rule handle, this makes it easier to add a persist rule with nftables systemd service. Also added a link to the rhel9 doc about persisting and auto-loading nftable rules with systemd service.

Comment on lines 166 to 167
> Replace value of NODEPORT variable with the host port number assigned to kubernetes NodePort service
> Replace value of INTERFACE_IP with the IP address from the host interface where you'd like to block the NodePort service
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this, but I looked at "rich diff" and these two lines were merged into one. Maybe adding one empty with > will keep them separate but in the same quote block

Suggested change
> Replace value of NODEPORT variable with the host port number assigned to kubernetes NodePort service
> Replace value of INTERFACE_IP with the IP address from the host interface where you'd like to block the NodePort service
> Replace value of NODEPORT variable with the host port number assigned to kubernetes NodePort service
>
> Replace value of INTERFACE_IP with the IP address from the host interface where you'd like to block the NodePort service

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added line break at the end of each line.

ovn-kubernetes doesn't restrict the host addresses where
k8s nodeport service can be accessed from outside microshift
node, this commit adds nftable instructions to drop packet
matching the nodeport and host interface IPs. These nftable
instructions can work regardless of firewalld service state.

Signed-off-by: Zenghui Shi <zshi@redhat.com>
Co-authored-by: Patryk Matuszak <305846+pmtk@users.noreply.github.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 15, 2023

@zshi-redhat: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@pmtk
Copy link
Member

pmtk commented Feb 15, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pmtk, zshi-redhat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit e9b515a into openshift:main Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants