kubernetes-sigs / cluster-api-provider-azure

Cluster API implementation for Microsoft Azure
https://capz.sigs.k8s.io/
Apache License 2.0
287 stars 414 forks source link

Management Cluster initiation failed while using User managed Identity for Cluster Provision into our Azure subscription #4951

Open v-mpurohit opened 5 days ago

v-mpurohit commented 5 days ago

Hi, we are provisioning a management cluster assigning user managed identity for CAPZ kubernetes distribution with the below cluster.yaml file and getting the error while initiating the mangement cluster. The error is

cluster.cluster.x-k8s.io/capz-n-4962-80947-1-vt7ofnz created 2024-06-17T04:40:49.4253943Z machinedeployment.cluster.x-k8s.io/capz-n-4962-80947-1-vt7ofnz-md-0 created 2024-06-17T04:40:49.7725316Z kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/capz-n-4962-80947-1-vt7ofnz-md-0 created 2024-06-17T04:40:49.8611929Z Error from server (InternalError): error when creating "capzcluster.yaml": Internal error occurred: failed calling webhook "default.azurecluster.infrastructure.cluster.x-k8s.io": failed to call webhook: Post "https://capz-webhook-service.capz-system.svc:443/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster?timeout=10s": no endpoints available for service "capz-webhook-service" 2024-06-17T04:40:49.8613822Z Error from server (InternalError): error when creating "capzcluster.yaml": Internal error occurred: failed calling webhook "default.kubeadmcontrolplane.controlplane.cluster.x-k8s.io": failed to call webhook: Post "https://capi-kubeadm-control-plane-webhook-service.capi-kubeadm-control-plane-system.svc:443/mutate-controlplane-cluster-x-k8s-io-v1beta1-kubeadmcontrolplane?timeout=10s": no endpoints available for service "capi-kubeadm-control-plane-webhook-service" 2024-06-17T04:40:49.8614801Z Error from server (InternalError): error when creating "capzcluster.yaml": Internal error occurred: failed calling webhook "default.azuremachinetemplate.infrastructure.cluster.x-k8s.io": failed to call webhook: Post "https://capz-webhook-service.capz-system.svc:443/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinetemplate?timeout=10s": no endpoints available for service "capz-webhook-service" 2024-06-17T04:40:49.8616359Z Error from server (InternalError): error when creating "capzcluster.yaml": Internal error occurred: failed calling webhook "default.azuremachinetemplate.infrastructure.cluster.x-k8s.io": failed to call webhook: Post "https://capz-webhook-service.capz-system.svc:443/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinetemplate?timeout=10s": no endpoints available for service "capz-webhook-service" 2024-06-17T04:40:49.8617869Z Error from server (InternalError): error when creating "capzcluster.yaml": Internal error occurred: failed calling webhook "validation.azureclusteridentity.infrastructure.cluster.x-k8s.io": failed to call webhook: Post "https://capz-webhook-service.capz-system.svc:443/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclusteridentity?timeout=10s": no endpoints available for service "capz-webhook-service"

The cluster.yaml configuration is: `apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: ${clusterName} spec: clusterNetwork: services: cidrBlocks:

Could you please help with the configuration which supports initializing management cluster (AKS) with User assigned managed identity instead of default service principal?