Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure cluster defaulting webhook should add default subnet CIDRs when subnet CIDRs already exist #5431

Open
nawazkh opened this issue Feb 14, 2025 · 0 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@nawazkh
Copy link
Member

nawazkh commented Feb 14, 2025

/kind bug

[Before submitting an issue, have you checked the Troubleshooting Guide self-managed & managed?]

What steps did you take and what happened:
[A clear and concise description of what the bug is.]

  • Upon deploying a self managed cluster, the azure cluster validation webhook complains about subnet CIDR being inadmissible.
  • Error:
    E0214 20:07:00.141000       8 controller.go:316] "Reconciler error" err="failed to patch AzureCluster default/default-32152: admission webhook \"validation.azurecluster.infrastructure.cluster.x-k8s.io\" denied the request: AzureCluster.infrastructure.cluster.x-k8s.io \"default-32152\" is invalid: [spec.networkSpec.subnets[0].CIDRBlocks: Invalid value: []string{\"10.0.0.0/16\"}: field is immutable, spec.networkSpec.subnets[1].CIDRBlocks: Invalid value: []string{\"10.1.0.0/16\"}: field is immutable]" controller="azurecluster" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AzureCluster" AzureCluster="default/default-32152" namespace="default" name="default-32152" reconcileID="23226a8b-c26d-43ea-8eee-29e3ae9a1a69"
    E0214 20:07:00.652249       8 controller.go:316] "Reconciler error" err="failed to patch AzureCluster default/default-32152: admission webhook \"validation.azurecluster.infrastructure.cluster.x-k8s.io\" denied the request: AzureCluster.infrastructure.cluster.x-k8s.io \"default-32152\" is invalid: [spec.networkSpec.subnets[0].CIDRBlocks: Invalid value: []string{\"10.0.0.0/16\"}: field is immutable, spec.networkSpec.subnets[1].CIDRBlocks: Invalid value: []string{\"10.1.0.0/16\"}: field is immutable]" controller="azurecluster" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AzureCluster" AzureCluster="default/default-32152" namespace="default" name="default-32152" reconcileID="d01128b1-b335-433a-8ee7-4ec5a950d30f"
    
  • This seems to happen because of the defaults being set at
    func (c *AzureCluster) setSubnetDefaults() {
    • This commit can be used to see the source of this error : 36078c1

What did you expect to happen:

  • Azure cluster validation webhook to not complain about the CIDRs.
  • Azure cluster defaulting webhook should not add extra CIDRs.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • cluster-api-provider-azure version: v1.18
  • Kubernetes version: (use kubectl version): v1.30.2
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 14, 2025
@nawazkh nawazkh added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Todo
Development

No branches or pull requests

2 participants