Skip to content

Conversation

@yxun
Copy link
Collaborator

@yxun yxun commented Aug 15, 2025

This PR adds new doc and samples about the Istio native nftables feature. That feature was merged in the upstream release-1.27. This doc outlines the configuration steps using Sail Operator.

  • Documentation Update

Related issue: #1123

@yxun yxun requested a review from a team as a code owner August 15, 2025 19:07
@yxun yxun changed the title release-1.27: Add docs for enabling Istio native nftables feature Add docs for enabling Istio native nftables feature Aug 15, 2025
@yxun yxun marked this pull request as draft August 15, 2025 19:10
@codecov
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.75%. Comparing base (8958564) to head (f89ca91).
⚠️ Report is 52 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1122      +/-   ##
==========================================
+ Coverage   77.78%   78.75%   +0.96%     
==========================================
  Files          44       44              
  Lines        2823     2255     -568     
==========================================
- Hits         2196     1776     -420     
+ Misses        521      369     -152     
- Partials      106      110       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yxun
Copy link
Collaborator Author

yxun commented Aug 15, 2025

We don't have a version: v1.27 in Sail Operator now. So I use the version: v1.28-alpha.24646157 in this PR draft now. Will update that in a following commit.

@@ -0,0 +1,13 @@
apiVersion: sailoperator.io/v1
Copy link
Contributor

Choose a reason for hiding this comment

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

While this looks good. In the longer run, we should use templates and update it based on the args.


This feature configures Istio to use the `nftables` backend instead of `iptables` for traffic redirection.

#### Installation on OpenShift
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding the installation on OCP for Sail Operator, I feel we should link to the existing documentation rather than duplicating the steps here once again. If the steps require some explicit config that can be added as a note.

Signed-off-by: Yuanlin Xu <[email protected]>
@yxun yxun marked this pull request as ready for review September 24, 2025 00:30
@yxun yxun marked this pull request as draft September 24, 2025 01:08
@yxun yxun force-pushed the nft-doc branch 2 times, most recently from 11eb9e9 to 79a1d1b Compare September 25, 2025 19:54
Signed-off-by: Yuanlin Xu <[email protected]>
Copy link
Contributor

@sridhargaddam sridhargaddam left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this @yxun


### Installation

The support for native nftables when using Istio sidecar mode was implemented in the upstream istio release-1.27 [release note](https://github.com/istio/istio/blob/master/releasenotes/notes/nftables-sidecar.yaml). It is disabled by default. To enable it, you can set a feature flag as `values.global.nativeNftables=true`. For example,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The support for native nftables when using Istio sidecar mode was implemented in the upstream istio release-1.27 [release note](https://github.com/istio/istio/blob/master/releasenotes/notes/nftables-sidecar.yaml). It is disabled by default. To enable it, you can set a feature flag as `values.global.nativeNftables=true`. For example,
The support for native nftables when using Istio sidecar mode was implemented in the upstream istio [release-1.27](https://github.com/istio/istio/blob/master/releasenotes/notes/nftables-sidecar.yaml). It is disabled by default. To enable it, you can set a feature flag as `values.global.nativeNftables=true`. For example,

Installation with Helm

```sh
helm install istiod-canary istio/istiod \
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are talking about nftables, we can avoid using "istiod-canary"

Suggested change
helm install istiod-canary istio/istiod \
helm install istiod istio/istiod \

metadata:
name: default
spec:
version: v1.28-alpha.24646157
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use 1.27 (or whatever is the latest supported version) here.

Comment on lines 53 to 55
updateStrategy:
type: InPlace
inactiveRevisionDeletionGracePeriodSeconds: 30
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the updateStrategy section is anyways using the defaults, we can avoid specifying it in the yamls.

Comment on lines 67 to 81
```sh
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: sailoperator
namespace: openshift-operators
spec:
channel: "1.27-nightly"
installPlanApproval: Automatic
name: sailoperator
source: community-operators
sourceNamespace: openshift-marketplace
EOF
```
Copy link
Contributor

Choose a reason for hiding this comment

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

As this document is for Sail Operator, lets avoid any OpenShift specific notes. Please use appropriate mechanism for Kind cluster.

inactiveRevisionDeletionGracePeriodSeconds: 30
values:
global:
nativeNftables: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually you can remove this whole section since we are capturing the same info below.

```

#### Install in Ambient Mode

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a TODO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, the Ambient mode part install and upgrade is in progress. When that part is clear, I will update the upgrade task JIRA and this PR draft.

kubectl apply -n test-ns -f https://raw.githubusercontent.com/istio/istio/refs/heads/master/samples/curl/curl.yaml
```

Attach a debug container and you will get the following rules in the `istio-proxy` container:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Attach a debug container and you will get the following rules in the `istio-proxy` container:
Attach a debug container and you can see the nftable rules from the `istio-proxy` container:


### Upgrade

The migration of using the existing Istio iptables backend to nftables backend can be done by upgrading Istio. The following example installs an Istio control plane with the iptables backend and a sample application curl in a data plane namespace test-ns.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The migration of using the existing Istio iptables backend to nftables backend can be done by upgrading Istio. The following example installs an Istio control plane with the iptables backend and a sample application curl in a data plane namespace test-ns.
The migration from iptables backend to nftables backend can be done by upgrading Istio. The following example installs an Istio control plane with the iptables backend and a sample application in test-ns namespace.

The migration of using the existing Istio iptables backend to nftables backend can be done by upgrading Istio. The following example installs an Istio control plane with the iptables backend and a sample application curl in a data plane namespace test-ns.

```sh
istioctl install -y
Copy link
Contributor

Choose a reason for hiding this comment

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

As this is a Sail Operator doc, lets use the installation mechanisms supported in Sail Operator.

Signed-off-by: Yuanlin Xu <[email protected]>
@yxun
Copy link
Collaborator Author

yxun commented Oct 1, 2025

This PR is still WIP. I tried the Sail Operator 1.27.1 but still getting the following error

IstioCNI default violates policy 299 - "unknown field "spec.values.global.nativeNftables""

The api field PR was merged in #1183
I am reopening JIRA https://issues.redhat.com/browse/OSSM-10589

@yxun yxun changed the title Add docs for enabling Istio native nftables feature WIP: Add docs for enabling Istio native nftables feature Oct 1, 2025
@yxun
Copy link
Collaborator Author

yxun commented Oct 1, 2025

The latest Sail Operator (1.27.1) log shows:

2025-10-01T07:31:28Z INFO setup version.BuildInfo{Version:"1.27.1", GitRevision:"18c6703878d493e756a0f3dc12d600d64220a184",

Unfortunately , the api change PR was one commit behind that :
https://github.com/istio-ecosystem/sail-operator/commits/release-1.27

We may need to bump Sail Operator to a newer 1.27 version and then I can verify the nftables feature using Sail Operator.

Signed-off-by: Yuanlin Xu <[email protected]>
@@ -0,0 +1,277 @@
[Return to Project Root](../README.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey, can you please convert these files to ASCII doc? We now have all the docs under the docs folder in ASCII format

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I pushed another commit about adding a ascii one. I'm checking. If the conversion looks correct , I will remove the markdown file in another commit after review.

@yxun yxun changed the title WIP: Add docs for enabling Istio native nftables feature Add docs for enabling Istio native nftables feature Oct 6, 2025
@yxun yxun marked this pull request as ready for review October 6, 2025 09:47
Signed-off-by: Yuanlin Xu <[email protected]>
yxun added 2 commits October 6, 2025 10:12
Signed-off-by: Yuanlin Xu <[email protected]>
@yxun
Copy link
Collaborator Author

yxun commented Oct 8, 2025

@sridhargaddam

Here are two findings :
1. When using Sail Operator, the upgraded IstioCNI and Istio resources spec.version value need to be different from the prior instances. Otherwise, the appended spec.values will not be configured.
2. After ambient mode upgrade, the data plane application deployment(s) still need a restart so that new rules can be applied in the pod network.

The doc PR is ready for review. Thanks.

@yxun yxun requested a review from sridhargaddam October 8, 2025 07:02
Comment on lines 8 to 10
updateStrategy:
type: InPlace
inactiveRevisionDeletionGracePeriodSeconds: 30
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets remove these fields as they are anyways default.

Comment on lines 40 to 41
When you install IstioCNI and Istio resources with Sail Operator, you can create an instance of them with `+spec.values.global.nativeNftables=true+`.
This feature configures Istio to use the `+nftables+` backend instead of `+iptables+` for traffic redirection.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When you install IstioCNI and Istio resources with Sail Operator, you can create an instance of them with `+spec.values.global.nativeNftables=true+`.
This feature configures Istio to use the `+nftables+` backend instead of `+iptables+` for traffic redirection.
When installing `Istio` and `IstioCNI` resources with the Sail Operator, you can enable nftables by setting `spec.values.global.nativeNftables=true` in the resource. This option configures Istio to use the nftables backend for traffic redirection instead of iptables.


To enable the native nftables feature, using the following steps:

[arabic]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what this is for. Can you eloborate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That was automatically generated when I run make gen-api-docs . I can remove that asciidoc format mark.

When you install IstioCNI and Istio resources with Sail Operator, you can create an instance of them with `+spec.values.global.nativeNftables=true+`.
This feature configures Istio to use the `+nftables+` backend instead of `+iptables+` for traffic redirection.

To enable the native nftables feature, using the following steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove this line as we already mentioned above how to enable nftables.

metadata:
name: default
spec:
version: v1.27.2
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be updated to version 1.28

==== Validation

When using the `+nftables+` backend, you can verify the traffic redirection rules using the `+nft list ruleset+` command in a data plane application or sidecar container.
You can find all rules are in the `+inet+` table. The following example installs a sample application `+curl+` in a data plane namespace `+test-ns+`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can find all rules are in the `+inet+` table. The following example installs a sample application `+curl+` in a data plane namespace `+test-ns+`.
You can find all rules are in the `+inet+` table. The following example installs a sample application `+curl+` in a namespace `+test-ns+` that is part of the mesh.


When using Sail Operator, the upgraded `IstioCNI` and `Istio` resources `spec.version` value need to be different from the prior instances. Otherwise, the appended `spec.values` will not be configured.

===== Upgrade with Sail Operator on OpenShift
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
===== Upgrade with Sail Operator on OpenShift
===== Upgrade using Sail Operator


===== Upgrade with Sail Operator on OpenShift

To upgrade an iptable based Istio service mesh, using the following steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To upgrade an iptable based Istio service mesh, using the following steps:
To upgrade an iptable based Istio service mesh with nftables backend, use the following steps:

. Upgrade the IstioCNI and Istio control plane with `+spec.values.global.nativeNftables=true+`.
More details about the Update Strategy are described in link:../update-strategy/update-strategy.adoc[update-strategy.adoc]. For example,

[source,sh]
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole of the section is redundant, we are just repeating things again. Please re-work on the section below. We dont have to show the Yamls again, just include a note saying that spec.values.global.nativeNftables should be set to true in Istio and IstioCNI CRs.


[source,sh]
----
kubectl rollout restart deployment -n test-ns
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... we should find a way to support re-programming the new rules without having to restart the pods. Did you take a look at the code to understand what it does when config changes and the rules do not match?

@sridhargaddam
Copy link
Contributor

When using Sail Operator, the upgraded IstioCNI and Istio resources spec.version value need to be different from the prior instances. Otherwise, the appended spec.values will not be configured.

Are you saying that when we update any spec.values (without modifying the version) the updated values are not reflected in the Istio deployment?
Looping @dgn to check if this is some known.

Signed-off-by: Yuanlin Xu <[email protected]>
@yxun
Copy link
Collaborator Author

yxun commented Oct 20, 2025

When using Sail Operator, the upgraded IstioCNI and Istio resources spec.version value need to be different from the prior instances. Otherwise, the appended spec.values will not be configured.

Are you saying that when we update any spec.values (without modifying the version) the updated values are not reflected in the Istio deployment? Looping @dgn to check if this is some known.

yes, I am not clear about other spec.values settings. When I added the +spec.values.global.nativeNftables=true+, it was only applied when I changed the spec.version value for an in place upgrade scenario.

Signed-off-by: Yuanlin Xu <[email protected]>
@istio-testing
Copy link
Collaborator

@yxun: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
e2e-kind-olm_sail-operator_main f89ca91 link true /test e2e-kind-olm

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-sigs/prow repository. I understand the commands that are listed here.

@yxun
Copy link
Collaborator Author

yxun commented Nov 7, 2025

When using Sail Operator, the upgraded IstioCNI and Istio resources spec.version value need to be different from the prior instances. Otherwise, the appended spec.values will not be configured.

When I run the latest Sail operator 1.27.3+ , I see Istio values overrides behavior works correctly in this upgrade case.
There was already an unit test file covering that.
https://github.com/istio-ecosystem/sail-operator/blob/main/pkg/istiovalues/overrides_test.go

My Quote finding was not correct. It could be caused by running an old Istio version which had not included nftables change there.

@yxun
Copy link
Collaborator Author

yxun commented Nov 7, 2025

hmm... we should find a way to support re-programming the new rules without having to restart the pods.

Still work in progress about the re-programming rule changes without having to restart the application pods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants