-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added check for AKS clusters with basic a load balancer (#110)
* Added check for AKS cluster basic load balancers * removed failing test for empty backends & az.network inport
- Loading branch information
Showing
5 changed files
with
143 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
AzureBasicLoadBalancerUpgrade/testEnvs/modules/aks/aks.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
param loadBalancerType string = 'bnasic' | ||
param location string | ||
param subnetId string | ||
param k8sVersion string | ||
param vmSize string | ||
|
||
var suffix = uniqueString(resourceGroup().id) | ||
|
||
resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-11-01' = { | ||
name: 'aks-${suffix}' | ||
location: location | ||
sku: { | ||
name: 'Base' | ||
tier: 'Free' | ||
} | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
dnsPrefix: 'aks-${suffix}' | ||
kubernetesVersion: k8sVersion | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
loadBalancerSku: loadBalancerType | ||
serviceCidr: '10.1.0.0/24' | ||
dnsServiceIP: '10.1.0.10' | ||
} | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool1' | ||
count: 2 | ||
type: 'VirtualMachineScaleSets' | ||
mode: 'System' | ||
vnetSubnetID: subnetId | ||
vmSize: vmSize | ||
osType: 'Linux' | ||
osSKU: 'Ubuntu' | ||
} | ||
] | ||
} | ||
} | ||
|
51 changes: 51 additions & 0 deletions
51
AzureBasicLoadBalancerUpgrade/testEnvs/scenarios/115-aks-basic-lb.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
targetScope = 'subscription' | ||
param location string | ||
param resourceGroupName string | ||
param vmSize string = 'Standard_D2_v2' | ||
|
||
// Resource Group | ||
module rg '../modules/Microsoft.Resources/resourceGroups/deploy.bicep' = { | ||
name: '${resourceGroupName}-${location}' | ||
params: { | ||
name: resourceGroupName | ||
location: location | ||
} | ||
} | ||
|
||
// vnet | ||
module virtualNetworks '../modules/Microsoft.Network/virtualNetworks/deploy.bicep' = { | ||
name: 'virtualNetworks-module' | ||
scope: resourceGroup(resourceGroupName) | ||
params: { | ||
// Required parameters | ||
location: location | ||
addressPrefixes: [ | ||
'10.0.0.0/16' | ||
] | ||
name: 'vnet-01' | ||
subnets: [ | ||
{ | ||
name: 'subnet-01' | ||
addressPrefix: '10.0.1.0/24' | ||
} | ||
] | ||
} | ||
dependsOn: [ | ||
rg | ||
] | ||
} | ||
|
||
module aks '../modules/aks/aks.bicep' = { | ||
name: 'aks-module' | ||
scope: resourceGroup(resourceGroupName) | ||
params: { | ||
k8sVersion: '1.28.3' | ||
location: location | ||
subnetId: virtualNetworks.outputs.subnetResourceIds[0] | ||
vmSize: vmSize | ||
loadBalancerType: 'basic' | ||
} | ||
dependsOn: [ | ||
virtualNetworks | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
#annotations: | ||
# service.beta.kubernetes.io/azure-load-balancer-internal: "true" | ||
name: my-service | ||
namespace: default | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 60000 | ||
type: LoadBalancer | ||
|