Skip to content

Commit d05bba8

Browse files
committed
On branch wls-autoscaling-0131 Changes supplemental to comment below.
modified: pom.xml - Increment version modified: weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableHpa.sh modified: weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_hpa.bicep - Correct typo. modified: weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enablePrometheusMetrics.sh - I'm worried about the idempotency. Guard against that by ensuring these extension add/removes don't cause a failure. modified: weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh - Best practice. See https://dev.azure.com/edburns-msft/Open%20Standard%20Enterprise%20Java%20(Java%20EE)%20on%20Azure/_wiki/wikis/Open-Standard-Enterprise-Java-(Java-EE)-on-Azure.wiki/2/Team-FAQ?anchor=shell-script-best-practices . modified: weblogic-azure-aks/src/main/bicep/mainTemplate.bicep - Correct typo. modified: weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json - Add note to maintainer. Comment: https://github.com/oracle/weblogic-azure/pull/297/files#r1595939825 Signed-off-by: Ed Burns <[email protected]>
1 parent a1173f6 commit d05bba8

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<properties>
4141
<!-- versions start -->
4242
<!-- weblogic azure aks versions -->
43-
<version.wls-on-aks-azure-marketplace>1.0.74</version.wls-on-aks-azure-marketplace>
43+
<version.wls-on-aks-azure-marketplace>1.0.75</version.wls-on-aks-azure-marketplace>
4444
<!-- weblogic azure vm versions -->
4545
<version.arm-oraclelinux-wls>1.0.27</version.arm-oraclelinux-wls>
4646
<version.arm-oraclelinux-wls-admin>1.0.50</version.arm-oraclelinux-wls-admin>

weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enableHpa.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function get_cluster_uid(){
1616

1717
function scaling_basedon_cpu(){
1818
kubectl autoscale cluster ${WLS_CLUSTER_UID} \
19-
--cpu-percent=${UTILIZATION_PERSENTAGE} \
19+
--cpu-percent=${UTILIZATION_PERCENTAGE} \
2020
--min=1 \
2121
--max=${WLS_CLUSTER_SIZE} \
2222
-n ${WLS_NAMESPACE}
@@ -42,7 +42,7 @@ spec:
4242
resource:
4343
name: memory
4444
target:
45-
averageUtilization: ${UTILIZATION_PERSENTAGE}
45+
averageUtilization: ${UTILIZATION_PERCENTAGE}
4646
type: Utilization
4747
EOF
4848

@@ -72,4 +72,4 @@ if [ "$HPA_SCALE_TYPE" == "cpu" ]; then
7272
scaling_basedon_cpu
7373
elif [ "$HPA_SCALE_TYPE" == "memory" ]; then
7474
scaling_basedon_memory
75-
fi
75+
fi

weblogic-azure-aks/src/main/arm/scripts/inline-scripts/enablePrometheusMetrics.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function connect_aks(){
1111

1212
function enable_promethues_metrics(){
1313
# See https://learn.microsoft.com/en-us/azure/azure-monitor/containers/kubernetes-monitoring-enable?tabs=cli#enable-prometheus-and-grafana
14-
az extension add --name k8s-extension
14+
az extension add --name k8s-extension && true
1515

1616
### Use existing Azure Monitor workspace
1717
az aks update --enable-azure-monitor-metrics \
@@ -22,8 +22,8 @@ function enable_promethues_metrics(){
2222

2323
utility_validate_status "Enable Promethues Metrics."
2424

25-
az extension add --name aks-preview
26-
az extension remove --name k8s-extension
25+
az extension add --name aks-preview && true
26+
az extension remove --name k8s-extension && true
2727

2828
#Verify that the DaemonSet was deployed properly on the Linux node pools
2929
#https://learn.microsoft.com/en-us/azure/azure-monitor/containers/kubernetes-monitoring-enable?tabs=cli#managed-prometheus

weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ export ENABLE_CUSTOM_SSL=${constFalse}
284284
export WLS_CLUSTER_SIZE=5
285285
export URL_3RD_DATASOURCE=$(echo "[]" | base64)
286286

287+
# Main script
288+
set -Eo pipefail
289+
287290
validate_input
288291

289292
install_kubectl

weblogic-azure-aks/src/main/bicep/mainTemplate.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ param acrResourceGroupName string = 'acr-contoso-rg'
3636
param aksAgentPoolName string = 'agentpool'
3737
@maxValue(10000)
3838
@minValue(1)
39-
@description('Set the minimum node count for the cluster..')
39+
@description('Set the minimum node count for the cluster.')
4040
param aksAgentPoolNodeCount int = 3
4141
@maxValue(1000)
4242
@minValue(3)

weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds_enable_hpa.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ resource deploymentScript 'Microsoft.Resources/deploymentScripts@${azure.apiVers
4848
value: hpaScaleType
4949
}
5050
{
51-
name: 'UTILIZATION_PERSENTAGE'
51+
name: 'UTILIZATION_PERCENTAGE'
5252
value: utilizationPercentage
5353
}
5454
{

weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
{
2626
"key": "WME",
27-
"description": "Oracle Weblogic Monitoring Exporter",
27+
"description": "Oracle Weblogic Monitoring Exporter. IMPORTANT note to maintener: This value is hard coded in enablePrometheusMetrics.sh. Please update it there also.",
2828
"version": "2.1.9",
2929
"imageURL": "ghcr.io/oracle/weblogic-monitoring-exporter:2.1.9",
3030
"testedDate": "2024-02-29"

0 commit comments

Comments
 (0)