Skip to content

Commit d58d3b9

Browse files
committed
add tabs and split good and bad configuration for gateway
1 parent 94f721b commit d58d3b9

File tree

1 file changed

+49
-16
lines changed

1 file changed

+49
-16
lines changed

site-src/concepts/security-considerations.md

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,55 @@ To avoid this situation, the following actions should be taken:
3030

3131
* On Gateways, admins SHOULD ensure that hostnames are clearly delegated to a specific namespace or set of namespaces:
3232

33-
```yaml
34-
apiVersion: gateway.networking.k8s.io/v1
35-
kind: Gateway
36-
metadata:
37-
name: gateway1
38-
spec:
39-
listeners:
40-
- hostname: "something.tld"
41-
port: 80
42-
protocol: HTTP
43-
allowedRoutes:
44-
namespaces:
45-
from: Selector
46-
selector:
47-
kubernetes.io/metadata.name: ns1
48-
```
33+
=== "Good configuration"
34+
35+
```yaml
36+
apiVersion: gateway.networking.k8s.io/v1
37+
kind: Gateway
38+
metadata:
39+
name: gateway
40+
spec:
41+
gatewayClassName: some-class
42+
listeners:
43+
- hostname: "something.tld"
44+
name: listener1
45+
port: 80
46+
protocol: HTTP
47+
allowedRoutes:
48+
namespaces:
49+
from: Selector
50+
selector:
51+
matchLabels:
52+
kubernetes.io/metadata.name: ns1
53+
- hostname: "otherthing.tld"
54+
name: listener2
55+
port: 80
56+
protocol: HTTP
57+
allowedRoutes:
58+
namespaces:
59+
from: Selector
60+
selector:
61+
matchLabels:
62+
kubernetes.io/metadata.name: ns2
63+
```
64+
65+
=== "Insecure configuration"
66+
67+
```yaml
68+
apiVersion: gateway.networking.k8s.io/v1
69+
kind: Gateway
70+
metadata:
71+
name: gateway
72+
spec:
73+
gatewayClassName: some-class
74+
listeners:
75+
- name: listener1
76+
port: 80
77+
protocol: HTTP
78+
allowedRoutes:
79+
namespaces:
80+
from: All
81+
```
4982

5083
### More than 64 listeners
5184

0 commit comments

Comments
 (0)