feat: Add NetworkPolicy for Ollama security on high-performance branch (Task 3)
This commit is contained in:
parent
8f777775c9
commit
b709d31b67
1 changed files with 53 additions and 0 deletions
53
apps/ollama/base/networkpolicy.yaml
Normal file
53
apps/ollama/base/networkpolicy.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: ollama-ingress-restriction
|
||||
namespace: nxtgauge-ai
|
||||
labels:
|
||||
app: ollama
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: ollama
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
# Allow traffic from users service (port 11434)
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: default
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: users
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 11434
|
||||
# Allow traffic from payments service
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: default
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: payments
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 11434
|
||||
# Allow traffic from nxtgauge-ai-assistant service
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
name: nxtgauge-ai
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: nxtgauge-ai-assistant
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 11434
|
||||
# Allow traffic from within the same namespace (for health checks, etc.)
|
||||
- from:
|
||||
- podSelector: {}
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 11434
|
||||
Loading…
Add table
Reference in a new issue