Hello @kumaran G
Thanks for posting your question here.
Looking at the error you may have more than one cluster / context in your .kubeconfig file and maybe something got mixed up or recent cert changes.
- Can u please confirm if you are able to run any other kubectl commands on that cluster, other than creating a namespace?
- Can u please try to pull credentials again? with command az aks get-credentials --resource-group <Your RG> --name <Cluster Name> and --admin flag on the end if required as per your permissions.
- Then try to create a namespace using kubectl create namespace <name of your new namespace>.
If the issue still persists after above steps, can u please confirm:
- Was this working fine before and not working all of the sudden, or is this your first time creating a namespace in this cluster?
- Any recent certificate rotations on the cluster?
- Is there anything between the client and the cluster (eg. Firewall for instance)?
Hope this helps, look forward to hearing from you.