azurekubernetesazure-aks

AKS - Error from server (Forbidden): User cannot create resource "namespaces" in API group "" at the cluster scope


I am trying to use the K8S through Azure AKS.

But when doing a simple command like: kubectl create namespace airflow

I get the following error message:

Error from server (Forbidden): namespaces is forbidden: User "xxx" cannot create resource "namespaces" in API group "" at the cluster scope

I have already commanded az aks get-credentials to connect to the cluster and then I try to create the namespace but without success.


Solution

  • In my case, this works when I use this command:

    az aks get-credentials --resource-group <RESOURCE GROUP NAME> --name <AKS Cluster Name> --admin