Hello, I do not understand why we need to look at and modify the egress in the network policy if the exercise in object.
The netpol is linked to pod cyan-app-cka28-trb and we need to modify it to allow/deny incoming connection to the pod.
kind: NetworkPolicy
podSelector:
matchLabels:
app: cyan-app-cka28-trb
So why does the solution want a change to the Egress part as well?
I apply the changes to the ingress and to the port, as per below, and the curl works fine. But the exercise is marked as not passed.
k describe netpol cyan-np-cka28-trb -n cyan-ns-cka28-trb
Name: cyan-np-cka28-trb
Namespace: cyan-ns-cka28-trb
Created on: 2024-12-15 12:52:52 +0000 UTC
Labels: <none>
Annotations: <none>
Spec:
PodSelector: app=cyan-app-cka28-trb
Allowing ingress traffic:
To Port: 80/TCP
From:
NamespaceSelector: kubernetes.io/metadata.name=default
PodSelector: app=cyan-white-cka28-trb
Allowing egress traffic:
To Port: 80/TCP
To: <any> (traffic not restricted by destination)
Policy Types: Ingress, Egress
Thanks