83 lines
2.3 KiB
YAML
83 lines
2.3 KiB
YAML
# services/hermes/suite-planner-networkpolicy.yaml
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-suite-planner
|
|
namespace: hermes
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: hermes-suite-planner}
|
|
policyTypes: [Ingress, Egress]
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels: {kubernetes.io/metadata.name: traefik}
|
|
podSelector:
|
|
matchLabels: {app.kubernetes.io/name: traefik}
|
|
ports: [{protocol: TCP, port: 9000}]
|
|
- from:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-switchyard}
|
|
ports: [{protocol: TCP, port: 9001}]
|
|
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: vault}
|
|
podSelector:
|
|
matchLabels: {app: vault}
|
|
ports: [{protocol: TCP, port: 8200}]
|
|
- to:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-switchyard}
|
|
ports: [{protocol: TCP, port: 9005}]
|
|
- to:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-model-gate}
|
|
ports: [{protocol: TCP, port: 8082}]
|
|
- 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]
|
|
ports: [{protocol: TCP, port: 443}]
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-suite-switchyard
|
|
namespace: hermes
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: hermes-switchyard}
|
|
policyTypes: [Ingress, Egress]
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-suite-planner}
|
|
ports: [{protocol: TCP, port: 9005}]
|
|
egress:
|
|
- to:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-suite-planner}
|
|
ports: [{protocol: TCP, port: 9001}]
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-suite-local-api
|
|
namespace: hermes
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: hermes-model-gate}
|
|
policyTypes: [Ingress]
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-suite-planner}
|
|
ports: [{protocol: TCP, port: 8082}]
|