Skip to content

Commit 37b7f60

Browse files
authored
manifests: add optional network policy charts for ztunnel (#57680)
[release1.27][cherry-pick]manifests: add optional network policy charts for ztunnel (#57680)
2 parents 15d69d8 + e4c535c commit 37b7f60

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{- if (.Values.global.networkPolicy).enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: {{ include "ztunnel.release-name" . }}{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
app: ztunnel
9+
app.kubernetes.io/name: ztunnel
10+
istio.io/rev: {{ .Values.revision | default "default" | quote }}
11+
install.operator.istio.io/owning-resource: {{ .Values.ownerName | default "unknown" }}
12+
operator.istio.io/component: "Ztunnel"
13+
release: {{ .Release.Name }}
14+
{{- include "istio.labels" . | nindent 4 }}
15+
spec:
16+
podSelector:
17+
matchLabels:
18+
app: ztunnel
19+
policyTypes:
20+
- Ingress
21+
- Egress
22+
ingress:
23+
# Readiness probe
24+
- from: []
25+
ports:
26+
- protocol: TCP
27+
port: 15021
28+
# Monitoring/prometheus
29+
- from: []
30+
ports:
31+
- protocol: TCP
32+
port: 15020 # Metrics
33+
# Admin interface
34+
- from: []
35+
ports:
36+
- protocol: TCP
37+
port: 15000 # Admin interface
38+
# HBONE traffic
39+
- from: []
40+
ports:
41+
- protocol: TCP
42+
port: 15008
43+
# Outbound traffic endpoint
44+
- from: []
45+
ports:
46+
- protocol: TCP
47+
port: 15001
48+
# Traffic endpoint for inbound plaintext
49+
- from: []
50+
ports:
51+
- protocol: TCP
52+
port: 15006
53+
# DNS Captures
54+
- from: [ ]
55+
ports:
56+
- protocol: TCP
57+
port: 15053
58+
- protocol: UDP
59+
port: 15053
60+
egress:
61+
# Allow all egress
62+
- {}
63+
{{- end }}

manifests/charts/ztunnel/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ _internal_defaults_do_not_set:
1717
# corresponds to the networks in the map of mesh networks.
1818
network: ""
1919

20+
global:
21+
# When enabled, default NetworkPolicy resources will be created
22+
networkPolicy:
23+
enabled: false
24+
2025
# resourceName, if set, will override the naming of resources. If not set, will default to 'ztunnel'.
2126
# If you set this, you MUST also set `trustedZtunnelName` in the `istiod` chart.
2227
resourceName: ""
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: release-notes/v2
2+
kind: feature
3+
area: security
4+
5+
issue:
6+
- https://github.com/istio/api/issues/56877
7+
8+
releaseNotes:
9+
- |
10+
**Added** optional NetworkPolicy deployment for ztunnel.
11+
12+
You can set `global.networkPolicy.enabled=true` to deploy a default NetworkPolicy for ztunnel.

tests/integration/iop-ambient-test-defaults.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ spec:
1717
- matchExpressions:
1818
- key: istio.io/test-exclude-namespace
1919
operator: DoesNotExist
20+
global:
21+
networkPolicy:
22+
enabled: true

0 commit comments

Comments
 (0)