cluster-api-provider-azure: PublicIP resources should not PUT on each AzureCluster reconcile

/kind bug

[Before submitting an issue, have you checked the Troubleshooting Guide?]

What steps did you take and what happened: When reconciling an AzureCluster each reconcile loop will cause a PUT for each PublicIP resource.

What did you expect to happen: PublicIP resources should only be mutated with a PUT if the desired state has changed.

/assign @CecileRobertMichon

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (11 by maintainers)

Most upvoted comments

/unassign /assign @karuppiah7890

We realized in #1791 that there might also be a bug associated with this behavior: since we update the public IP when it already exists, it means we will also update an IP that was pre-created by the user and thus add the CAPZ managed tags to it which would cause it to be deleted later on when deleting the cluster because CAPZ would see it as “managed”.

Great questions, @karuppiah7890. The goal here is to minimize “writes” (mutations) to the Azure API. Azure APIs have lower throttling limits for writes than for reads, particularly reads that GET by resource ID.

For any resource, we should be able to GET from Azure, compare the state in Azure, then only mutate state in Azure if the desired state in K8s is different than the state in Azure.