karpenter-provider-azure: Unable to set Auto on nodeProvisioningProfile for existing cluster due to aadProfile

Version

Karpenter Version: v0.0.0

Kubernetes Version: v1.27.3

Expected Behavior

I am trying to shift an existing cluster, setting the node provisioning mode to Auto. by running the following command: az aks update --resource-group myGroup --name myAKS --node-provisioning-mode Auto

Actual Behavior

After running the command: az aks update --resource-group myGroup --name myAKS --node-provisioning-mode Auto I get the following error:

Argument ‘–node-provisioning-mode’ is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus The behavior of this command has been altered by the following extension: aks-preview (OperationNotAllowed) .properties.nodeProvisioningProfile.mode cannot be Auto if .properties.aadProfile is specified. Code: OperationNotAllowed Message: .properties.nodeProvisioningProfile.mode cannot be Auto if .properties.aadProfile is specified.

Steps to Reproduce the Problem

  1. Created a cluster using terraform that has one nodepool with Manual Provision
  2. Register the NodeAutoProvisioningPreview feature flag following this
  3. Run the CLI cmd in the expected behavior to update the provision mode to Auto
  4. Cli complains that the operation is not allowed

Resource Specs and Logs

AKS cluster 1.27.3 CNI: Azure with Overlay Cilium DataPlane enabled

I am trying to create a cluster using terraform and afterwards change the autoprovision so that I can create nodepools with Karpenter however the error in the section Actual Behavior happens.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18

Most upvoted comments

@nfsouzaj talked to the azapi terraform provider team, and seems the docs that Phil shared are out of date. This is what was said.


The docs are not update to date, but the azapi provider does support the latest 2023-10-02-preview, here’s an example of how to use the node provisioning profile:

resource "azapi_resource" "rg" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = "henglu0109aks"
  location = "westeurope"

}
resource "azapi_resource" "cluster" {
  type      = "Microsoft.ContainerService/managedClusters@2023-10-02-preview"
  parent_id = azapi_resource.rg.id
  name      = "henglu0109aks"
  location  = "westeurope"
  identity {
    type = "SystemAssigned"
    identity_ids = []
  }
  
  body = jsonencode({
    properties = {
      agentPoolProfiles = [
        {
          count  = 1
          mode   = "System"
          name   = "default"
          vmSize = "Standard_DS2_v2"
        },
      ]
      nodeProvisioningProfile = {
        mode = "Auto"
      }
      dnsPrefix = "henglu0109aks"
    }
  })
}

Currently AKS does not support enabling karpenter through nap on existing clusters, so the command needs to be run on cluster create. Karpenter also will not be supporting service principal and only allow for MSI auth.