Is it possible to remove the network policy setting from an AKS cluster?

Eric Bjustrom 0 Reputation points
2025-02-05T17:30:05.14+00:00

I have a pre-existing AKS cluster that I am looking to test Karpenter on. A pre-requisite for that is the Azure CNI Overlay. The console and documentation says Overlay is not possible with network policy being set. Is there a way to change from network policy azure to no network policy without recreating the AKS cluster?

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,456 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 11,055 Reputation points Volunteer Moderator
    2025-02-05T17:48:30.5733333+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    You can change the network policy to "none" using the Azure CLI command:

    az aks update --resource-group YOUR_RESOURCE_GROUP --name YOUR_CLUSTER_NAME --network-policy none
    
    

    This command will disable the current network policy on your AKS cluster. However, there are a few important considerations:

    • Your AKS cluster must be running version 1.22 or later
    • The cluster should not have any Windows node pools
    • Ensure that you have removed any existing network policies from your cluster before running this command.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.