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

Use UserDefinedRouting for AKS when running with Private Networking #779

Merged
merged 38 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1335742
Update private network profile to UDR
MattMcL4475 May 10, 2024
8c5f4c0
Merge branch 'main' into task/SetOutboundTypeToUdr
MattMcL4475 May 14, 2024
cc13b33
Add script and update deployer and user accessible config
MattMcL4475 May 14, 2024
2333b21
add config setting for UDR
MattMcL4475 May 14, 2024
1ab1f6e
add firewall
MattMcL4475 May 14, 2024
cf797c1
add firewall subnet
MattMcL4475 May 14, 2024
8e7f57d
fix firewall
MattMcL4475 May 14, 2024
66ca418
specify firewall subnet name
MattMcL4475 May 14, 2024
e310a44
change firwall name
MattMcL4475 May 14, 2024
62267cb
add private dns
MattMcL4475 May 15, 2024
9d79eff
minor
MattMcL4475 May 15, 2024
c4519ca
add deployer_subnet_id
MattMcL4475 May 15, 2024
ffcb47b
update zone ID
MattMcL4475 May 15, 2024
3fb3e74
update script
MattMcL4475 May 16, 2024
1ed77f8
minor
MattMcL4475 May 16, 2024
401e09e
Merge branch 'task/SetOutboundTypeToUdr' of https://github.com/micros…
MattMcL4475 May 16, 2024
6aac591
Create hub and spoke
MattMcL4475 May 17, 2024
81bde20
fix variable
MattMcL4475 May 17, 2024
4ee7c14
fix spoke name
MattMcL4475 May 17, 2024
3515fd8
update script
MattMcL4475 May 17, 2024
dbdebc9
update deplyoer subnet
MattMcL4475 May 17, 2024
8e93509
add more echo
MattMcL4475 May 17, 2024
5081dd4
fix subnet name variables
MattMcL4475 May 17, 2024
bb43eb9
set az sub
MattMcL4475 May 17, 2024
ea3d793
fix var
MattMcL4475 May 18, 2024
1906772
link dns zone to spoke0
MattMcL4475 May 18, 2024
4101915
reorder
MattMcL4475 May 18, 2024
dd5e9aa
Merge branch 'main' into task/SetOutboundTypeToUdr
MattMcL4475 May 18, 2024
a9e7dc6
update network
MattMcL4475 May 20, 2024
9683607
Merge branch 'task/SetOutboundTypeToUdr' of https://github.com/micros…
MattMcL4475 May 20, 2024
16b5ebc
add rule for all outbound traffic
MattMcL4475 May 21, 2024
5da3630
add service endpoints
MattMcL4475 May 21, 2024
ed1ed66
update network range
MattMcL4475 May 21, 2024
24bd0fd
remove comments
MattMcL4475 May 21, 2024
eec003d
update subnet names
MattMcL4475 May 21, 2024
b1668a6
Merge branch 'main' into task/SetOutboundTypeToUdr
BMurri Aug 22, 2024
3401636
Add validation of new configuration values (and minimal documentation)
BMurri Aug 22, 2024
c9b8a56
Move script to wiki
BMurri Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/deploy-cromwell-on-azure/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class Configuration : UserAccessibleConfiguration

public abstract class UserAccessibleConfiguration
{
// https://learn.microsoft.com/azure/aks/private-clusters?tabs=azure-portal#configure-a-private-dns-zone CUSTOM_PRIVATE_DNS_ZONE_RESOURCE_ID
public string AksPrivateDnsZoneResourceId { get; set; }
public string AksNodeResourceGroupName { get; set; }
public string IdentityResourceId { get; set; }
public string AzureCloudName { get; set; } = AzureCloudConfig.DefaultAzureCloudName;
Expand All @@ -44,9 +46,9 @@ public abstract class UserAccessibleConfiguration
public string VmSubnetAddressSpace { get; set; } = "10.1.0.0/24"; // 10.1.0.0 - 10.1.0.255, 256 IPs
public string PostgreSqlSubnetAddressSpace { get; set; } = "10.1.1.0/24"; // 10.1.1.0 - 10.1.1.255, 256 IPs
// Address space for kubernetes system services, must not overlap with any subnet.
public string KubernetesServiceCidr = "10.1.4.0/22"; // 10.1.4.0 -> 10.1.7.255, 1024 IPs
public string KubernetesDnsServiceIP = "10.1.4.10";
public string KubernetesDockerBridgeCidr = "172.17.0.1/16"; // 172.17.0.0 - 172.17.255.255, 65536 IPs
public string KubernetesServiceCidr { get; set; } = "10.1.4.0/22"; // 10.1.4.0 -> 10.1.7.255, 1024 IPs
public string KubernetesDnsServiceIP { get; set; } = "10.1.4.10";
public string KubernetesDockerBridgeCidr { get; set; } = "172.17.0.1/16"; // 172.17.0.0 - 172.17.255.255, 65536 IPs
public string BatchNodesSubnetAddressSpace { get; set; } = "10.1.128.0/17"; // 10.1.128.0 - 10.1.255.255, 32768 IPs

public string ResourceGroupName { get; set; }
Expand Down Expand Up @@ -74,6 +76,9 @@ public abstract class UserAccessibleConfiguration
public string PostgreSqlSubnetName { get; set; }
public string BatchSubnetName { get; set; }
public bool? PrivateNetworking { get; set; } = null;
// https://learn.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-userdefinedrouting
// https://learn.microsoft.com/azure/aks/egress-udr
public bool? UserDefinedRouting { get; set; } = null;
public string Tags { get; set; } = null;
public string BatchNodesSubnetId { get; set; } = null;
public bool? DisableBatchNodesPublicIpAddress { get; set; } = null;
Expand Down
13 changes: 13 additions & 0 deletions src/deploy-cromwell-on-azure/Deployer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,18 @@ private async Task<ContainerServiceManagedClusterResource> ProvisionManagedClust
EnablePrivateClusterPublicFqdn = false
};

if (!string.IsNullOrWhiteSpace(configuration.AksPrivateDnsZoneResourceId))
{
cluster.ApiServerAccessProfile.PrivateDnsZone = configuration.AksPrivateDnsZoneResourceId;
}

cluster.PublicNetworkAccess = ContainerServicePublicNetworkAccess.Disabled;

MattMcL4475 marked this conversation as resolved.
Show resolved Hide resolved
if (configuration.UserDefinedRouting == true)
{
cluster.NetworkProfile ??= new();
cluster.NetworkProfile.OutboundType = ContainerServiceOutboundType.UserDefinedRouting;
}
}

return await Execute(
Expand Down Expand Up @@ -2212,6 +2223,8 @@ void ValidateHelmInstall(string helmPath, string featureName)
ThrowIfProvidedForUpdate(configuration.CrossSubscriptionAKSDeployment, nameof(configuration.CrossSubscriptionAKSDeployment));
ThrowIfProvidedForUpdate(configuration.ApplicationInsightsAccountName, nameof(configuration.ApplicationInsightsAccountName));
ThrowIfProvidedForUpdate(configuration.PrivateNetworking, nameof(configuration.PrivateNetworking));
ThrowIfProvidedForUpdate(configuration.AksPrivateDnsZoneResourceId, nameof(configuration.AksPrivateDnsZoneResourceId));
ThrowIfProvidedForUpdate(configuration.UserDefinedRouting, nameof(configuration.UserDefinedRouting));
ThrowIfProvidedForUpdate(configuration.VnetName, nameof(configuration.VnetName));
ThrowIfProvidedForUpdate(configuration.VnetResourceGroupName, nameof(configuration.VnetResourceGroupName));
ThrowIfProvidedForUpdate(configuration.SubnetName, nameof(configuration.SubnetName));
Expand Down
Loading