apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: waitlist-api-egress namespace: customer1 spec: podSelector: matchLabels: app: waitlist-api policyTypes: - Egress egress: # Allow DNS resolution (required for api.telegram.org lookups) - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: kube-system - podSelector: matchLabels: k8s-app: kube-dns ports: - protocol: UDP port: 53 - protocol: TCP port: 53 # Allow PostgreSQL to CNPG cluster - to: - podSelector: matchLabels: cnpg.io/cluster: siriusdevops-pgdb ports: - protocol: TCP port: 5432 # Allow Telegram Bot API - to: - ipBlock: cidr: 0.0.0.0/0 except: - 10.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16 ports: - protocol: TCP port: 443