64 lines
1.4 KiB
YAML
64 lines
1.4 KiB
YAML
# services/hermes-chat/networkpolicy.yaml
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-chat-isolation
|
|
namespace: hermes-chat
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: hermes-chat
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: traefik
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: traefik
|
|
ports:
|
|
- protocol: TCP
|
|
port: 9119
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: kube-system
|
|
podSelector:
|
|
matchLabels:
|
|
k8s-app: kube-dns
|
|
ports:
|
|
- protocol: UDP
|
|
port: 53
|
|
- protocol: TCP
|
|
port: 53
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: hermes
|
|
podSelector:
|
|
matchLabels:
|
|
app: hermes-model-gate
|
|
ports:
|
|
- protocol: TCP
|
|
port: 8080
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 10.43.0.1/32
|
|
ports:
|
|
- protocol: TCP
|
|
port: 443
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 0.0.0.0/0
|
|
except:
|
|
- 10.0.0.0/8
|
|
- 100.64.0.0/10
|
|
- 127.0.0.0/8
|
|
- 169.254.0.0/16
|
|
- 172.16.0.0/12
|
|
- 192.168.0.0/16
|