Azure / AKS-Construction

Accelerate your onboarding to AKS with; Helper Web App, bicep templating and CI/CD samples. Flexible & secure AKS baseline implementations in a Microsoft + community maintained reference implementation.
https://azure.github.io/AKS-Construction/
MIT License
356 stars 165 forks source link

PodCIDR patch for Overlay. #633

Closed samaea closed 10 months ago

samaea commented 1 year ago

PR Summary

Resolves https://github.com/Azure/AKS-Construction/issues/617. PodCIDR was not being passed when the network plugin is set to Overlay.

PR Checklist

pjlewisuk commented 1 year ago

Hey @samaea I've been looking at this today. When I try to deploy a cluster with CNI Overlay, I get the following error:

/workspaces/AKS-Construction/bicep/network.bicep(173,5) : Error BCP353: The variables "aks_podSubnet", "aks_podsubnet" differ only in casing. The ARM deployments engine is not case sensitive and will not be able to distinguish between them.
/workspaces/AKS-Construction/bicep/network.bicep(192,5) : Error BCP353: The variables "aks_podSubnet", "aks_podsubnet" differ only in casing. The ARM deployments engine is not case sensitive and will not be able to distinguish between them.
/workspaces/AKS-Construction/bicep/network.bicep(409,9) : Warning BCP334: The provided value can have a length as small as 0 and may be too short to assign to a target with a configured minimum length of 3.
/workspaces/AKS-Construction/bicep/main.bicep(130,16) : Error BCP104: The referenced module has errors.

The aks_podSubnet and aks_podsubnet appear in https://github.com/Azure/AKS-Construction/blob/se-podCIDR/bicep/network.bicep with different cases.

It looks like this change was introduced in early May in this commit, but I don't know why it's only showing as a problem now.

Suggestions for best way to proceed? @khowling for input too :)

pjlewisuk commented 1 year ago

FWIW, I think the error is being triggered by one or more of these (URL) parameters, which get added when the "CNI Overlay" option is enabled:

net.networkPluginMode=true
net.vnetAksSubnetAddressPrefix=10.240.0.0%2F24
net.podCidr=10.244.0.0%2F16

This causes the podCidr=10.244.0.0/16 parameter to be added to the az deployment group create command. However, if I manually remove this parameter, the az deployment group create command still fails with the error shown above.

pjlewisuk commented 1 year ago

My codespace was running bicep v0.21.1, Sam created the PR against v0.20.4. When I downgraded my codespace to bicep v0.21.1 the error went away, so seems this is related to the bicep version.

From the 0.21.1 release notes, this was called out as a bug that was fixed: "Catch case-insensitive clashes of type property names (https://github.com/Azure/bicep/pull/11457)"

pjlewisuk commented 10 months ago

Issue #653 has been address in PR #672. Will review this again once that PR has merged.