Skip to content

Commit 11eb9e9

Browse files
committed
Update Istio nftables doc
Signed-off-by: Yuanlin Xu <[email protected]>
1 parent e27c7e6 commit 11eb9e9

File tree

4 files changed

+107
-13
lines changed

4 files changed

+107
-13
lines changed

chart/samples/istio-sample-nftables.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Istio
33
metadata:
44
name: default
55
spec:
6-
version: v1.28-alpha.24646157
6+
version: master
77
namespace: istio-system
88
updateStrategy:
99
type: InPlace

chart/samples/istiocni-sample-nftables.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: IstioCNI
33
metadata:
44
name: default
55
spec:
6-
version: v1.28-alpha.24646157
6+
version: master
77
namespace: istio-cni
88
values:
99
global:

docs/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@
7070
- [Troubleshoot issues](common/istio-ambient-waypoint.md#troubleshoot-issues)
7171
- [Cleanup](common/istio-ambient-waypoint.md#cleanup)
7272
- [Introduction to Istio Native Nftables Support](common/istio-nftables.md)
73-
- [Prerequisites](common/istio-nftables.md#prerequisites)
74-
- [Installation Steps](common/istio-nftables.md#installation-steps)
75-
- [Validation](common/istio-nftables.md#validation)
7673
- [Addons](addons/addons.md#addons)
7774
- [Deploy Prometheus and Jaeger addons](addons/addons.md#deploy-prometheus-and-jaeger-addons)
7875
- [Deploy Kiali addon](addons/addons.md#deploy-kiali-addon)

docs/common/istio-nftables.md

Lines changed: 105 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,43 @@
44

55
- [Istio nftables backend](#istio-nftables-backend)
66
- [Prerequisites](#prerequisites)
7-
- [Installation steps](#installation-steps)
8-
- [Installation on OpenShift](#installation-on-openshift)
7+
- [Installation](#installation)
8+
- [Install with Sail Operator on OpenShift](#install-with-sail-operator-on-openshift)
9+
- [Install in Ambient Mode](#install-in-ambient-mode)
910
- [Validation](#validation)
11+
- [Upgrade](#upgrade)
12+
- [Upgrade with Sail Operator on OpenShift](#upgrade-with-sail-operator-on-openshift)
13+
- [Upgrade in Ambient Mode](#upgrade-in-ambient-mode)
1014

11-
## Istio nftables backend
1215

13-
This document outlines the configuration steps for the nftables backend in Istio. As the official successor to iptables, nftables offers a modern, high-performance alternative for transparently redirecting traffic to and from the Envoy sidecar proxy. Many major Linux distributions are actively moving towards adopting native nftables support. At present, this backend supports Istio sidecar mode only, with ambient mode support currently under development.
16+
## Istio nftables backend
1417

18+
This document outlines the configuration steps for the nftables backend in Istio. As the official successor to iptables, nftables offers a modern, high-performance alternative for transparently redirecting traffic to and from the Envoy sidecar proxy. Many major Linux distributions are actively moving towards adopting native nftables support.
1519
### Prerequisites
1620

1721
- **nftables version**: Requires `nft` binary version 1.0.1 or later.
1822

19-
### Installation Steps
23+
### Installation
24+
25+
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,
26+
27+
Installation with Istioctl
2028

21-
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 create an instance of the `Istio` resource with `spec.values.global.nativeNftables=true`:
29+
```sh
30+
istioctl install --set values.global.nativeNftables=true -y
31+
```
32+
33+
Installation with Helm
34+
35+
```sh
36+
helm install istiod-canary istio/istiod \
37+
--set values.global.nativeNftables=true \
38+
-n istio-system
39+
```
40+
41+
#### Install with Sail Operator on OpenShift
42+
43+
When you install an Istio resource with Sail Operator, you can create an instance of the `Istio` resource with `spec.values.global.nativeNftables=true`.
2244

2345
```sh
2446
apiVersion: sailoperator.io/v1
@@ -38,8 +60,6 @@ spec:
3860

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

41-
#### Installation on OpenShift
42-
4363
To enable the Istio native nftables feature, using the following steps:
4464

4565
1. Create the `Subscription` object with a 1.27 channel.
@@ -109,6 +129,8 @@ spec:
109129
nativeNftables: true
110130
```
111131

132+
#### Install in Ambient Mode
133+
112134
### Validation
113135

114136
When using the `nftables` backend, you can verify the traffic redirection rules using the `nft list ruleset` command in the `istio-proxy` container. The following example installs a sample application `curl` in a data plane namespace `test-ns`.
@@ -168,3 +190,78 @@ table inet istio-proxy-nat {
168190
```
169191

170192
More guidelines: [Debugging Guidelines](https://github.com/istio/istio/tree/master/tools/istio-nftables/pkg#debugging-guidelines)
193+
194+
### Upgrade
195+
196+
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.
197+
198+
```sh
199+
istioctl install -y
200+
201+
kubectl create ns test-ns
202+
kubectl label namespace test-ns istio-injection=enabled
203+
kubectl apply -n test-ns -f samples/curl/curl.yaml
204+
```
205+
206+
You may create another Istio control plane with a revision value and gradually migrate data plane traffic to the new revision Istio control plane. This canary upgrade approach is much safer than doing an in-place upgrade. For example,
207+
208+
1. Install a canary version of Istio with the nftables backend.
209+
210+
```sh
211+
istioctl install --set revision=canary --set values.global.nativeNftables=true -y
212+
```
213+
214+
2. Upgrade the data plane and restart the deployment
215+
216+
```sh
217+
kubectl label namespace test-ns istio-injection- istio.io/rev=canary
218+
kubectl rollout restart deployment -n test-ns
219+
```
220+
221+
3. Check the nftables backend running in the curl application pod. When using the nftables backend, You get the table inet rules in the istio-proxy container. For example, attach a debug container and run nft list ruleset command:
222+
223+
```sh
224+
kubectl -n test-ns debug --image istio/base --profile netadmin --attach -t -i \
225+
"$(kubectl -n test-ns get pod -l app=curl -o jsonpath='{.items..metadata.name}')"
226+
227+
root@curl-6c88b89ddf-kbzn6:$ nft list ruleset
228+
```
229+
230+
4. Verify the connectivity between two pods is working. For example, deploy a httpbin application using the following step:
231+
232+
```sh
233+
kubectl apply -n test-ns -f samples/httpbin/httpbin.yaml
234+
kubectl exec -n test-ns "$(kubectl get pod -l app=curl -n test-ns -o jsonpath={.items..metadata.name})" -c curl -n test-ns -- curl http://httpbin.test-ns:8000/ip -s -o /dev/null -w "%{http_code}\n"
235+
236+
200
237+
```
238+
239+
5. After upgrading both the control plane and data plane, you can uninstall the old control plane in this example.
240+
241+
```sh
242+
istioctl uninstall --revision default -y
243+
```
244+
245+
When upgrading Istio with the CNI node agent, you can install a canary version of Istio control plane and upgrade the istio-cni node agent separately. For example, there is an Istio CNI component running in the istio-cni namespace, you can upgrade and enable the nftables backend using the following steps:
246+
247+
1. Install a canary version of Istiod control plane with the nftables backend.
248+
249+
```sh
250+
helm install istiod-canary istio/istiod \
251+
--set revision=canary \
252+
--set values.global.nativeNftables=true \
253+
-n istio-system
254+
```
255+
256+
2. Upgrade the CNI component separately from the revisioned control plane.
257+
258+
```sh
259+
helm upgrade istio-cni istio/cni \
260+
--set values.global.nativeNftables=true \
261+
-n istio-cni --wait
262+
```
263+
264+
#### Upgrade with Sail Operator on OpenShift
265+
266+
#### Upgrade in Ambient mode
267+

0 commit comments

Comments
 (0)