Changing the Service Principal associated with the AKS Cluster
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?
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.
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
Closing it as it's being tracked on user voice.
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
@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