AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Changing the Service Principal associated with the AKS Cluster

Open nourselim0 opened this issue 8 years ago • 5 comments

I just moved the Azure Subscription that contains my AKS Cluster to another account. This in turn removed all Service Principals (I don't know why). Which in turn made K8s fail to manage external load balancers.

I could create a new Service Principal, but how can I tell AKS to use that new one?

nourselim0 avatar Jul 13 '18 15:07 nourselim0

You can not. AKS does not support changing service principle, at least right now. You need to create a new cluster and redeploy all deployments, assuming you keep all your deployment yaml scripts.

qike-ms avatar Jul 14 '18 06:07 qike-ms

I have all my deployment yaml files, but I didn't want to go through the config steps for ingress-nginx and cert-manager, so I did a few kubectl gets with --all-namespaces and -o yaml, then manually removed all ClusterIP fields and anything in the kube-system namespace. It took a few hours but it was ok, very few hiccups.

I posted a suggestion on the uservoice to enable changing the service principal. Here it is in case anybody wants to vote on it: https://feedback.azure.com/forums/34192--general-feedback/suggestions/34835914-allow-changing-the-service-principal-associated-wi

nourselim0 avatar Jul 15 '18 14:07 nourselim0

Closing it as it's being tracked on user voice.

weinong avatar Aug 07 '18 19:08 weinong

Just wanted to inform anybody who stumbles upon this that the UserVoice request has been completed! Docs: https://docs.microsoft.com/en-us/azure/aks/update-credentials

nourselim0 avatar Jun 12 '19 19:06 nourselim0

@hassanselim0 while provisioning AKS somehow i put wrong credentials of client id and secret. I am assuming that if i update aks with correct service principal and i am assigning service principal for ACR pull role on ACR then AKS Cluster should perfectly without error coming ImagePullBackOff

partha-sarathi-sarkar avatar Dec 19 '19 07:12 partha-sarathi-sarkar