apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: bot-db-network-policy
  namespace: cronohub
spec:
  podSelector:
    matchLabels:
      app: bot-db
  policyTypes:
    - Ingress
    - Egress
  ingress:
    - from:
        - podSelector:
            matchLabels:
              app: bot-app
      ports:
        - protocol: TCP
          port: 5432
  egress:
    - to:
        - podSelector:
            matchLabels:
              app: bot-app
      ports:
        - protocol: TCP
          port: 5432