Skip to content

Commit

Permalink
Merge pull request oracle#319 from galiacheng/main
Browse files Browse the repository at this point in the history
Remove availability zone restriction as Reza suggests.
  • Loading branch information
rjeberhard authored Jul 9, 2024
2 parents b2e8fc0 + ff5b79d commit 690190a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<properties>
<!-- versions start -->
<!-- weblogic azure aks versions -->
<version.wls-on-aks-azure-marketplace>1.0.78</version.wls-on-aks-azure-marketplace>
<version.wls-on-aks-azure-marketplace>1.0.79</version.wls-on-aks-azure-marketplace>
<!-- weblogic azure vm versions -->
<version.arm-oraclelinux-wls>1.0.27</version.arm-oraclelinux-wls>
<version.arm-oraclelinux-wls-admin>1.0.51</version.arm-oraclelinux-wls-admin>
Expand Down
2 changes: 0 additions & 2 deletions weblogic-azure-aks/src/main/arm/createUiDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@
"Standard_DS2_v2"
],
"constraints": {
"numAvailabilityZonesRequired": 3,
"zone": "3",
"excludedSizes": [
"Standard_A0",
"Standard_A1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,24 @@ function validate_appgateway_vnet() {
fi
}

function query_available_zones() {
if [[ "${createAKSCluster,,}" == "true" ]]; then
outputAvailableZones=$(az vm list-skus -l ${location} --size ${aksAgentPoolVMSize} --zone true | jq -c '.[] | .locationInfo[] | .zones')
fi

if [ -z "${outputAvailableZones}" ]; then
outputAvailableZones="[]"
fi

export outputAvailableZones="${outputAvailableZones}"
}

function output_result() {
echo "AKS version: ${outputAksVersion}"
result=$(jq -n -c \
--arg aksVersion "$outputAksVersion" \
'{aksVersion: $aksVersion}')
--arg agentAvailabilityZones "${outputAvailableZones}" \
'{aksVersion: $aksVersion, agentAvailabilityZones: $agentAvailabilityZones}')
echo "result is: $result"
echo $result >$AZ_SCRIPTS_OUTPUT_PATH
}
Expand Down Expand Up @@ -650,5 +663,7 @@ fi

validate_appgateway_vnet

query_available_zones

output_result

2 changes: 2 additions & 0 deletions weblogic-azure-aks/src/main/bicep/mainTemplate.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ module wlsDomainDeployment 'modules/setupWebLogicCluster.bicep' = if (!enableCus
aksClusterNamePrefix: aksClusterNamePrefix
aksClusterRGName: aksClusterRGName
aksClusterName: aksClusterName
aksAgentAvailabilityZones:validateInputs.outputs.aksAgentAvailabilityZones
aksVersion: validateInputs.outputs.aksVersion
appPackageUrls: appPackageUrls
appReplicas: appReplicas
Expand Down Expand Up @@ -639,6 +640,7 @@ module wlsDomainWithCustomSSLDeployment 'modules/setupWebLogicCluster.bicep' = i
aksClusterNamePrefix: aksClusterNamePrefix
aksClusterRGName: aksClusterRGName
aksClusterName: aksClusterName
aksAgentAvailabilityZones:validateInputs.outputs.aksAgentAvailabilityZones
aksVersion: validateInputs.outputs.aksVersion
appPackageUrls: appPackageUrls
appReplicas: appReplicas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ param aciResourcePermissions bool = true
param aciRetentionInDays int = 120
@description('Pricing tier: PerGB2018 or legacy tiers (Free, Standalone, PerNode, Standard or Premium) which are not available to all customers.')
param aciWorkspaceSku string = 'pergb2018'
param agentAvailabilityZones array = []
@maxLength(12)
@minLength(1)
@description('The name for this node pool. Node pool must contain only lowercase letters and numbers. For Linux node pools the name cannot be longer than 12 characters.')
Expand All @@ -27,11 +28,6 @@ param location string
param utcValue string = utcNow()

var const_aksAgentPoolOSDiskSizeGB = 128
var const_aksAvailabilityZones = [
'1'
'2'
'3'
]
var name_aciWorkspace = 'Workspace-${guid(utcValue)}-${location}'
// Generate a unique AKS name scoped to subscription.
var name_aksClusterNameForSV = '${aksClusterNamePrefix}${uniqueString(utcValue)}'
Expand Down Expand Up @@ -79,7 +75,7 @@ resource aksCluster 'Microsoft.ContainerService/managedClusters@${azure.apiVersi
osDiskType: 'Managed'
kubeletDiskType: 'OS'
type: 'VirtualMachineScaleSets'
availabilityZones: const_aksAvailabilityZones
availabilityZones: agentAvailabilityZones
mode: 'System'
osType: 'Linux'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,4 @@ resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVers
}

output aksVersion string = deploymentScript.properties.outputs.aksVersion
output aksAgentAvailabilityZones array = json(deploymentScript.properties.outputs.agentAvailabilityZones)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ param aciRetentionInDays int = 120
param aciWorkspaceSku string = 'pergb2018'
param acrName string = ''
param acrResourceGroupName string = ''
param aksAgentAvailabilityZones array = []
@maxLength(12)
@minLength(1)
@description('The name for this node pool. Node pool must contain only lowercase letters and numbers. For Linux node pools the name cannot be longer than 12 characters.')
Expand Down Expand Up @@ -161,6 +162,7 @@ module aksClusterDeployment './_azure-resoruces/_aks.bicep' = if (createAKSClust
aciResourcePermissions: aciResourcePermissions
aciRetentionInDays: aciRetentionInDays
aciWorkspaceSku: aciWorkspaceSku
agentAvailabilityZones: aksAgentAvailabilityZones
aksAgentPoolName: aksAgentPoolName
aksAgentPoolNodeCount: aksAgentPoolNodeCount
aksAgentPoolNodeMaxCount: aksAgentPoolNodeMaxCount
Expand Down

0 comments on commit 690190a

Please sign in to comment.