This repository has been archived by the owner on May 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsample.yaml
76 lines (76 loc) · 1.97 KB
/
sample.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: some-cool-app
metadata:
name: some-cool-app
objects:
- kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: deny-by-default
labels:
app: some-cool-app
spec:
# This project's default posture is "security first". All
# traffic is denied by default.
podSelector: {}
ingress: []
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-openshift-ingress
labels:
app: some-cool-app
spec:
# Any pod with an external route & service combination is
# allowed to accept traffic; if we don't want external access
# we do not assign a route.
ingress:
- from:
- namespaceSelector:
matchLabels:
network.openshift.io/policy-group: ingress
podSelector: {}
policyTypes:
- Ingress
- kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-api-to-patroni
labels:
app: some-cool-app
spec:
# Allow the API pod to communicate to any pod in the Patroni
# cluster on the given port.
podSelector:
matchLabels:
cluster-name: patroni
ingress:
- from:
- podSelector:
matchLabels:
component: api
ports:
- protocol: TCP
port: 5432
- kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-api-to-minio
labels:
app: some-cool-app
spec:
# Allow the API pod to talk to any pod to communicate with
# any minio pod on the given port.
podSelector:
matchLabels:
component: minio
ingress:
- from:
- podSelector:
matchLabels:
component: api
ports:
- protocol: TCP
port: 9000