-
Notifications
You must be signed in to change notification settings - Fork 519
fix: add masterSubnet to azuredeploy.parameters.json while using custom VNET #431
Conversation
…n while using custom VNET
Codecov Report
@@ Coverage Diff @@
## master #431 +/- ##
===========================================
+ Coverage 53.38% 67.24% +13.85%
===========================================
Files 95 121 +26
Lines 14374 20429 +6055
===========================================
+ Hits 7674 13737 +6063
+ Misses 6037 5809 -228
- Partials 663 883 +220 |
@@ -64,6 +64,7 @@ func getParameters(cs *api.ContainerService, generatorCode string, aksEngineVers | |||
} | |||
if properties.OrchestratorProfile.IsKubernetes() { | |||
addValue(parametersMap, "vnetCidr", properties.MasterProfile.VnetCidr) | |||
addValue(parametersMap, "masterSubnet", properties.MasterProfile.VnetCidr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not adding this in params_k8s.go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Check the pre-conditions for populating VnetCidr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if properties.MasterProfile.IsCustomVNET() {
addValue(parametersMap, "masterVnetSubnetID", properties.MasterProfile.VnetSubnetID)
if properties.MasterProfile.IsVirtualMachineScaleSets() {
addValue(parametersMap, "agentVnetSubnetID", properties.MasterProfile.AgentVnetSubnetID)
}
if properties.OrchestratorProfile.IsKubernetes() {
addValue(parametersMap, "vnetCidr", properties.MasterProfile.VnetCidr)
addValue(parametersMap, "masterSubnet", properties.MasterProfile.VnetCidr)
}
} else {
addValue(parametersMap, "masterSubnet", properties.MasterProfile.Subnet)
addValue(parametersMap, "agentSubnet", properties.MasterProfile.AgentSubnet)
}
This is the whole part of related code, masterSubnet is added in else condition, I followed this rule to add my code here. Do I need to move it to params_k8s.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think setting redundant parameters is advisable. i.e having masterSubnet
and VnetCidr
point to the same value. If there are references to masterSubnet
in windows scenarios. They should probably reference VnetCidr
.
I'll let @PatrickLang chime in as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vnetCidr
is not used in any condition now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I believe we should change that to use VnetCidr, not duplicate values across different parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few parameters related to custom VNET, they are vnetCidr
/kubeClusterCidr
/masterSubnet
/agentSubnet
. vnetCidr
is not used, agentSubnet
is a null value. kubeClusterCidr
and masterSubnet
are added to azure cni's exception list only.
I guess there were some thoughts for custom VNET, but not fully implemented yet on Windows. From my side this PR is more as a workaround with minimal change to make things work.
@PatrickLang
Any ideas?
/LGTM @jsturtevant - do you have anyone looking for this functionality and if so would you be able to help document this? |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: PatrickLang, zhiweiv If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@tariq1890 @PatrickLang @CecileRobertMichon |
/azp run pr-e2e |
Azure Pipelines successfully started running 1 pipeline(s). |
@tariq1890 what is still holding this PR? |
I am enquiring if there is a way instead of going for a workaround here. Having values duplicated across multiple parameters seems like a code/design smell to me. |
The PR maybe not a good solution, I will keep using local build as workaround. AKS-Engine doesn't work for Windows nodes with custom VNET by default now, hope this can be fixed sometime. |
Is it true, this fix is still not in the current version (v0.35.1) ? So there is currently no way to use a hybrid setup with custom vnet than to manually add the mastersubnet after aks-engine generate to azuredeploy.parameters.json? |
@rogersollberger |
Reason for Change:
masterSubnet is used by Windows nodes, it is missing from azuredeploy.parameters.json while using custom VNET, we can add it to azuredeploy.parameters.json manually while building cluster as a workaround, however while scaling cluster, aks-engine updates the cluster directly, we don't get change to update the template, the new added Windows nodes do not join the cluster due to missing masterSubnet. This PR make it work at least while master and agents using same custom VNET.
Issue Fixed:
Fixes #210
Fixes #341
Requirements:
Notes: