1
votes

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.

2
Do you integrate it with Azure AD? Or what other features do you use? - Charles Xu

2 Answers

2
votes

You dont have sufficient privileges to create namespace in the k8s cluster though you have access to the cluster

Check the below command to know if you have permission to create namespace

# kubectl auth can-i create namespace
yes
2
votes

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

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