kubernetes-sigs / cloud-provider-azure

Cloud provider for Azure
https://cloud-provider-azure.sigs.k8s.io/
Apache License 2.0
258 stars 272 forks source link

LB Dynamic Backend-Pool isn't enabled when implementing CCM (Cloud Controller manager) #6703

Open RimDammak opened 1 month ago

RimDammak commented 1 month ago

Hii guys, I am encountering an issue where the Load Balancer's Dynamic Backend-Pool feature is not enabled while implementing the Cloud Controller Manager (CCM) (Azure Provider). Below are the steps I've followed and the issue I'm facing.

  1. I created Azure Cloud Provider Secret:

    kubectl create secret generic azure-cloud-provider --from-file=cloud-config=./cloud.json -n kube-system
  2. I added Cloud Provider Azure helm repo:

    helm repo add cloud-provider-azure https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo
  3. I installed Azure CCM helm-chart with the config i needed:

    helm install azure-ccm cloud-provider-azure/cloud-provider-azure \
    --set cloud-provider-azure.infra.clusterName="error-tf" \
    --set cloud-provider-azure.cloudControllerManager.cloudConfig='' \
    --set cloud-provider-azure.cloudControllerManager.cloudConfigSecretName="azure-cloud-provider" \
    --set cloud-provider-azure.cloudControllerManager.enableDynamicReloading="true" \
    --set cloud-provider-azure.cloudControllerManager.configureCloudRoutes="true" \
    --set cloud-provider-azure.cloudControllerManager.allocateNodeCidrs="true" \
    --set cloud-provider-azure.cloudControllerManager.imageRepository="mcr.microsoft.com/oss/kubernetes"
  4. I edited the cloud controller manager arguments I DELETED --cloud-config=/etc/kubernetes/azure.json and added the secrets config:
    image

After doing all of this, I tried to deploy an ngnix service with Load Balancer, the load balancer is created automatically with its public IP, but the issue is the LB's backend pool isn't associated to my nodes, can you help me resolve this issue? Also, I'm using Terraform, and when I destroy everything, the lb and public IP stay, any tips on how I can automatically delete them as well? Logs Messages:

   1 azure_loadbalancer.go:2259] reconcileLoadBalancer for service (default/nginx)(true): lb rules updated: [{"name":"xxxx-TCP-80","properties":{"backendAddressPool":{"id":"/subscriptions/xxxxx-/resourceGroups/rg-x/providers/Microsoft.Network/loadBalancers/kubernetes/backendAddressPools/kubernetes"},"backendPort":80,"disableOutboundSnat":false,"enableFloatingIP":true,"enableTcpReset":true,"frontendIPConfiguration":{"id":"/subscriptions/xxxxx/resourceGroups/xxxxxx-rg/providers/Microsoft.Network/loadBalancers/kubernetes/frontendIPConfigurations/xxxx"},"frontendPort":80,"idleTimeoutInMinutes":4,"loadDistribution":"Default","probe":{"id":"/subscriptions/xxxxxx/resourceGroups/xxxx/providers/Microsoft.Network/loadBalancers/kubernetes/probes/xxxxxxxx-TCP-80"},"protocol":"Tcp"}}]

image

RimDammak commented 1 month ago

Do I need to configure the azure-cloud-node-manager? (I am using a single node in my work)

nilo19 commented 1 week ago

The master node will be ignored by default. Please try to add a worker node in your cluster.