Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
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.76</version.wls-on-aks-azure-marketplace>
<version.wls-on-aks-azure-marketplace>1.0.77</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
115 changes: 86 additions & 29 deletions weblogic-azure-aks/src/main/arm/createUiDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"type": "Microsoft.Common.Section",
"label": "Credentials for WebLogic",
"elements": [
{
"name": "listVMSizes",
Copy link
Contributor Author

@galiacheng galiacheng Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the REST API query to the Basics blade, then the data may be ready when it comes to AKS blade.

"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "GET",
"path": "[concat(subscription().id, '/providers/Microsoft.Compute/locations/',location(),'/vmSizes?api-version=2024-03-01')]"
}
},
{
"name": "wlsUserName",
"type": "Microsoft.Common.TextBox",
Expand Down Expand Up @@ -311,14 +319,81 @@
"uri": "https://aka.ms/wls-aks-well-tested-version"
}
}
},
},
{
"name": "nodeVMSizeSelector",
"type": "Microsoft.Compute.SizeSelector",
"label": "Node size",
"toolTip": "The size of virtual machine to provision.",
"recommendedSizes": [
"Standard_DS2_v2"
],
"constraints": {
"numAvailabilityZonesRequired": 3,
"zone": "3",
"excludedSizes": [
"Standard_A0",
"Standard_A1",
"Standard_A1_v2",
"Standard_F1",
"Standard_F1s",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Standard_B12ms",
"Standard_B16als_v2",
"Standard_B16as_v2",
"Standard_B16ls_v2",
"Standard_B16ms",
"Standard_B16pls_v2",
"Standard_B16ps_v2",
"Standard_B16s_v2",
"Standard_B1ls",
"Standard_B1ms",
"Standard_B1s",
"Standard_B20ms",
"Standard_B2als_v2",
"Standard_B2as_v2",
"Standard_B2ats_v2",
"Standard_B2ls_v2",
"Standard_B2ms",
"Standard_B2pls_v2",
"Standard_B2ps_v2",
"Standard_B2pts_v2",
"Standard_B2s",
"Standard_B2s_v2",
"Standard_B2ts_v2",
"Standard_B32als_v2",
"Standard_B32as_v2",
"Standard_B32ls_v2",
"Standard_B32s_v2",
"Standard_B4als_v2",
"Standard_B4as_v2",
"Standard_B4ls_v2",
"Standard_B4ms",
"Standard_B4pls_v2",
"Standard_B4ps_v2",
"Standard_B4s_v2",
"Standard_B8als_v2",
"Standard_B8as_v2",
"Standard_B8ls_v2",
"Standard_B8ms",
"Standard_B8pls_v2",
"Standard_B8ps_v2",
"Standard_B8s_v2"
]
},
"options": {
"hideDiskTypeFilter": false
},
"osPlatform": "Linux",
"count": "[steps('section_aks').clusterInfo.aksNodeCount]",
"visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]"
},
{
"name": "aksNodeCount",
"type": "Microsoft.Common.Slider",
"min": 1,
"max": 100,
"label": "Minimum node count",
"min": "[add(1, div(add(12288, mul(if(empty(basics('basicsOptional').wlsClusterSize),5,basics('basicsOptional').wlsClusterSize), 1536)), first(filter(basics('basicsRequired').listVMSizes.value, (item) => equals(item.name, steps('section_aks').clusterInfo.nodeVMSizeSelector))).memoryInMB))]",
"defaultValue": 3,
"max": 998,
"label": "Minimum node count",
"showStepMarkers": false,
"toolTip": "Set the minimum node count for the cluster.",
"constraints": {
Expand All @@ -329,35 +404,16 @@
{
"name": "aksNodeMaxCount",
"type": "Microsoft.Common.Slider",
"min": "[int(steps('section_aks').clusterInfo.aksNodeCount)]",
"max": 100,
"min": "[add(steps('section_aks').clusterInfo.aksNodeCount,2)]",
"defaultValue": 3,
"max": 1000,
"label": "Maximum node count",
"defaultValue": 5,
"showStepMarkers": false,
"toolTip": "Set the maximum node count for the cluster.",
"constraints": {
"required": true
},
"visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]"
},
{
"name": "nodeVMSizeSelector",
"type": "Microsoft.Compute.SizeSelector",
"label": "Node size",
"toolTip": "The size of virtual machine to provision.",
"recommendedSizes": [
"Standard_DS2_v2"
],
"constraints": {
"numAvailabilityZonesRequired": 3,
"zone": "3"
},
"options": {
"hideDiskTypeFilter": false
},
"osPlatform": "Linux",
"count": "[steps('section_aks').clusterInfo.aksNodeCount]",
"visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]"
}
]
},
Expand Down Expand Up @@ -2024,7 +2080,8 @@
}
]
},
"visible": "[and(bool(steps('section_database').enableDB), not(and(steps('section_database').databaseConnectionInfo.enablePswlessConnection0, equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))))]" },
"visible": "[and(bool(steps('section_database').enableDB), not(and(steps('section_database').databaseConnectionInfo.enablePswlessConnection0, equals(steps('section_database').databaseConnectionInfo.databaseType, 'sqlserver'))))]"
},
{
"name": "enablePswlessConnection",
"type": "Microsoft.Common.CheckBox",
Expand Down Expand Up @@ -2258,7 +2315,7 @@
"visible": "[equals(steps('section_autoScaling').autoScalingInfo.kmsMetrics, 'memory')]"
}
],
"visible": "[bool(steps('section_autoScaling').enableAutoscaling)]"
"visible": "[bool(steps('section_autoScaling').enableAutoscaling)]"
}
]
}
Expand Down Expand Up @@ -2363,4 +2420,4 @@
"wlsUserName": "[basics('basicsRequired').wlsUserName]"
}
}
}
}
8 changes: 7 additions & 1 deletion weblogic-azure-aks/src/main/arm/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates.

export checkPodStatusInterval=20 # interval of checking pod status.
export checkPodStatusMaxAttemps=100 # max attempt to check pod status.
export checkPodStatusMaxAttemps=200 # max attempt to check pod status.
export checkPVStateInterval=5 # interval of checking pvc status.
export checkPVStateMaxAttempt=10 # max attempt to check pvc status.
export checkSVCStateMaxAttempt=50
Expand Down Expand Up @@ -36,6 +36,12 @@ export constMSSQLDriverName="mssql-jdbc-10.2.1.jre8.jar"
export constAzureCoreVersion="1.34.0"
export constDbPodIdentitySelector="db-pod-identity" # do not change the value
export constPreclassDirectoryName="preclassLibraries"
export constLivenessProbePeriodSeconds=30
export constLivenessProbeTimeoutSeconds=5
export constLivenessProbeFailureThreshold=20
export constReadinessProbeProbePeriodSeconds=10
export constReadinessProbeTimeoutSeconds=5
export constReadinessProbeFailureThreshold=3

export curlMaxTime=120 # seconds
export ocrLoginServer="container-registry.oracle.com"
Expand Down
10 changes: 10 additions & 0 deletions weblogic-azure-aks/src/main/arm/scripts/genDomainConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ spec:

# Settings for all server pods in the domain including the introspector job pod
serverPod:
# Tune for small VM sizes
# https://oracle.github.io/weblogic-kubernetes-operator/managing-domains/domain-lifecycle/liveness-readiness-probe-customization/
livenessProbe:
periodSeconds: ${constLivenessProbePeriodSeconds}
timeoutSeconds: ${constLivenessProbeTimeoutSeconds}
failureThreshold: ${constLivenessProbeFailureThreshold}
readinessProbe:
periodSeconds: ${constReadinessProbeProbePeriodSeconds}
timeoutSeconds: ${constReadinessProbeTimeoutSeconds}
failureThreshold: ${constReadinessProbeFailureThreshold}
# Optional new or overridden environment variables for the domain's pods
# - This sample uses CUSTOM_DOMAIN_NAME in its image model file
# to set the Weblogic domain name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,29 @@ function validate_compute_resources() {
echo_stdout "Check compute resources: passed!"
}

# Ensure the cluster has enough memory resources.
# The offer deploys a WLS cluster with 1 + ${APP_REPLICAS} pods, each pod requestes 1.5GB and 0.25CPU.
# Minimum memory requirement: 12 + (APP_REPLICAS + 1)*1.5 GB
function validate_memory_resources() {
if [[ "${createAKSCluster,,}" == "true" ]]; then
local requiredMemoryinGB=$(echo "12+($APP_REPLICAS+1)*1.5" | bc)

local vmDetails=$(az vm list-skus --size ${aksAgentPoolVMSize} -l ${location} --query [0])
validate_status "Query VM details of ${aksAgentPoolVMSize} in ${location}."

local memoryGB=$(echo ${vmDetails} | jq '.capabilities[] | select(.name=="MemoryGB") | .value' | tr -d "\"")
local requestedMemory=$(echo "$aksAgentPoolNodeCount*$memoryGB" | bc)
echo_stdout "Current requested memory is ${requestedMemory}GB."
if [[ $(echo "${requestedMemory}<${requiredMemoryinGB}" | bc) -eq 1 ]]; then
echo_stderr "It requires ${requiredMemoryinGB} GiB memory to create the AKS cluster, you have to select a larger VM size or increase node count."
exit 1
fi

fi

echo_stdout "Check memory resources: passed!"
}

function validate_ocr_account() {
# install docker cli
install_docker
Expand Down Expand Up @@ -601,6 +624,8 @@ sslCertificateKeyVaultOption="keyVaultStoredConfig"

validate_compute_resources

validate_memory_resources

validate_base_image_path

validate_acr_admin_enabled
Expand Down
4 changes: 3 additions & 1 deletion weblogic-azure-aks/src/main/bicep/mainTemplate.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ var const_hasTags = contains(resourceGroup(), 'tags')
// * generate selfsigned certificate for gateway frontend TLS/SSL.
var const_bCreateNewKeyVault = (!const_hasTags || !contains(resourceGroup().tags, name_tagNameForKeyVault) || empty(resourceGroup().tags.wlsKeyVault)) && ((enableCustomSSL && sslConfigurationAccessOption != const_wlsSSLCertOptionKeyVault) || (enableAppGWIngress && (appGatewayCertificateOption != const_appGatewaySSLCertOptionHaveKeyVault)))
var const_bCreateStorageAccount = (createAKSCluster || !const_hasStorageAccount) && const_enablePV
var const_bValidateApplications= validateApplications && (length(appPackageUrls) > 0)
var const_createNewAcr = useOracleImage && createACR
var const_defaultKeystoreType = 'PKCS12'
var const_enableNetworking = (length(lbSvcValues) > 0) || enableAppGWIngress
Expand Down Expand Up @@ -409,6 +410,7 @@ module validateInputs 'modules/_deployment-scripts/_ds-validate-parameters.bicep
appGatewayCertificateOption: appGatewayCertificateOption
appGatewaySSLCertData: appGatewaySSLCertData
appGatewaySSLCertPassword: appGatewaySSLCertPassword
appReplicas: appReplicas
azCliVersion: const_azcliVersion
createAKSCluster: createAKSCluster
createDNSZone: createDNSZone
Expand Down Expand Up @@ -820,7 +822,7 @@ module passwordlessDatasourceDeployment 'modules/_setupPasswordlessDBConnection.
* To check if all the applciations in WLS cluster become ACTIVE state after all configurations are completed.
* This should be the last step.
*/
module validateApplciations 'modules/_deployment-scripts/_ds-validate-applications.bicep' = if (validateApplications) {
module validateApplciations 'modules/_deployment-scripts/_ds-validate-applications.bicep' = if (const_bValidateApplications) {
name: 'validate-wls-application-status'
params: {
_artifactsLocation: _artifactsLocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ param appGatewayCertificateOption string
param appGatewaySSLCertData string
@secure()
param appGatewaySSLCertPassword string
param appReplicas int
param azCliVersion string = ''
param createAKSCluster bool
param createDNSZone bool
Expand Down Expand Up @@ -121,6 +122,10 @@ resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVers
name: 'AKS_VERSION'
value: aksVersion
}
{
name: 'APP_REPLICAS'
value: appReplicas
}
{
name: 'WLS_SSL_KEYVAULT_NAME'
value: sslKeyVaultName
Expand Down