Network policy are not working in AKS?

Tanul 1,251 Reputation points
2023-05-27T18:58:21.6566667+00:00

I have created AKS with this command

az aks create \
    --resource-group $RESOURCE_GROUP_NAME \
    --name $CLUSTER_NAME \
    --node-count 1 \
    --network-plugin azure \
    --network-policy azure

And created this network policy

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: denyall.policy
  namespace: ingress-kong
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
  egress:
  - to:
    - namespaceSelector: {}
    ports:
      - port: 53
        protocol: UDP
      - port: 53
        protocol: TCP
---

Still I'm able to execute curl and ping commands from the pods created within ingress-kong namespace.. Am I missing something. I ran this command curl ifconfig.me?

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,975 questions
{count} votes