Skip to content

Commit 6871dd9

Browse files
authored
Merge pull request #34793 from 92nqb/es-network-policies
[es] Translate concept NetworkPolicies
2 parents 39e769c + 4d565e7 commit 6871dd9

File tree

7 files changed

+372
-0
lines changed

7 files changed

+372
-0
lines changed

content/es/docs/concepts/services-networking/network-policies.md

Lines changed: 287 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: allow-all-egress
6+
spec:
7+
podSelector: {}
8+
egress:
9+
- {}
10+
policyTypes:
11+
- Egress
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: allow-all-ingress
6+
spec:
7+
podSelector: {}
8+
ingress:
9+
- {}
10+
policyTypes:
11+
- Ingress
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: default-deny-all
6+
spec:
7+
podSelector: {}
8+
policyTypes:
9+
- Ingress
10+
- Egress
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: default-deny-egress
6+
spec:
7+
podSelector: {}
8+
policyTypes:
9+
- Egress
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: default-deny-ingress
6+
spec:
7+
podSelector: {}
8+
policyTypes:
9+
- Ingress
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: NetworkPolicy
3+
metadata:
4+
name: test-network-policy
5+
namespace: default
6+
spec:
7+
podSelector:
8+
matchLabels:
9+
role: db
10+
policyTypes:
11+
- Ingress
12+
- Egress
13+
ingress:
14+
- from:
15+
- ipBlock:
16+
cidr: 172.17.0.0/16
17+
except:
18+
- 172.17.1.0/24
19+
- namespaceSelector:
20+
matchLabels:
21+
project: myproject
22+
- podSelector:
23+
matchLabels:
24+
role: frontend
25+
ports:
26+
- protocol: TCP
27+
port: 6379
28+
egress:
29+
- to:
30+
- ipBlock:
31+
cidr: 10.0.0.0/24
32+
ports:
33+
- protocol: TCP
34+
port: 5978
35+

0 commit comments

Comments
 (0)