# Chat Server: allow ingress from ingress controller, egress to Redis, PostgreSQL, DNS # WebSocket connections; depends on Redis for pub/sub --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: chat-server-allow namespace: veza-production spec: podSelector: matchLabels: app: veza-chat-server policyTypes: - Ingress - Egress ingress: - from: - namespaceSelector: matchLabels: name: ingress-nginx ports: - protocol: TCP port: 8081 - from: - podSelector: {} ports: - protocol: TCP port: 8081 egress: - to: - ipBlock: cidr: 0.0.0.0/0 ports: - protocol: TCP port: 5432 - protocol: TCP port: 6379 - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: kube-system ports: - protocol: UDP port: 53