85 lines
2.3 KiB
YAML
85 lines
2.3 KiB
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-execution-worker-isolation
|
|
namespace: hermes
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: hermes-execution-worker
|
|
policyTypes: [Ingress, Egress]
|
|
ingress: []
|
|
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-agent}
|
|
ports: [{protocol: TCP, port: 9007}]
|
|
- to:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-switchyard}
|
|
ports: [{protocol: TCP, port: 9005}]
|
|
- to:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-model-gate}
|
|
ports: [{protocol: TCP, port: 8080}]
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels: {kubernetes.io/metadata.name: gitea}
|
|
podSelector:
|
|
matchLabels: {app: gitea}
|
|
ports: [{protocol: TCP, port: 3000}]
|
|
- 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
|
|
- 224.0.0.0/4
|
|
ports: [{protocol: TCP, port: 443}]
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-execution-pool-ingress
|
|
namespace: hermes
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: hermes-agent}
|
|
policyTypes: [Ingress]
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-execution-worker}
|
|
ports: [{protocol: TCP, port: 9007}]
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: hermes-execution-switchyard-ingress
|
|
namespace: hermes
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: hermes-switchyard}
|
|
policyTypes: [Ingress]
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels: {app: hermes-execution-worker}
|
|
ports: [{protocol: TCP, port: 9005}]
|