Help on NetworkPolicy lab

Hello,

I did create the network policy on the internal pod in the final question. The egress policy created on the internal pod works as expected to the mysql and payroll pods but the internal pod is also able to communicate with the external pod on port 8080. In my understanding this should fail . Did i miss something here? Just to add i also tried this with the answers yaml files and that is still the case.

TIA

There are known issues with some specific versions of weave where egress does not work properly.

However, I believe the version running in the lab is correct.

Can you send a snippet of your netpol yaml?

It is the same one that comes under /var/answers .

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: internal-policy
namespace: default
spec:
podSelector:
matchLabels:
name: internal
policyTypes:

  • Egress

  • Ingress
    ingress:

    • {}
      egress:
  • to:

    • podSelector:
      matchLabels:
      name: mysql
      ports:
    • protocol: TCP
      port: 3306
  • to:

    • podSelector:
      matchLabels:
      name: payroll
      ports:
    • protocol: TCP
      port: 8080

let me test this and will confirm.