File tree Expand file tree Collapse file tree 13 files changed +36
-83
lines changed
weblogic-azure-aks/src/main
bicep/modules/_deployment-scripts Expand file tree Collapse file tree 13 files changed +36
-83
lines changed Original file line number Diff line number Diff line change 11# Copyright (c) 2024, Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
4- function connect_aks(){
5- az aks get-credentials \
6- --resource-group ${AKS_CLUSTER_RG_NAME} \
7- --name ${AKS_CLUSTER_NAME} \
8- --overwrite-existing
9- }
10-
114function get_cluster_uid(){
125 local clusterUid=$( kubectl get clusters -n ${WLS_NAMESPACE} -o=jsonpath=' {.items[].metadata.name}' )
136 utility_validate_status " Obtain cluster UID."
@@ -62,7 +55,7 @@ set -Eo pipefail
6255
6356install_kubectl
6457
65- connect_aks
58+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
6659
6760get_cluster_uid
6861
Original file line number Diff line number Diff line change 11# Copyright (c) 2024, Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
4- function connect_aks(){
5- az aks get-credentials \
6- -n $AKS_CLUSTER_NAME \
7- -g $AKS_CLUSTER_RG_NAME \
8- --overwrite-existing \
9- --only-show-errors
10- }
4+ #! /bin/bash
115
126function enable_promethues_metrics(){
137 # See https://learn.microsoft.com/en-us/azure/azure-monitor/containers/kubernetes-monitoring-enable?tabs=cli#enable-prometheus-and-grafana
@@ -396,7 +390,7 @@ install_kubectl
396390
397391install_helm
398392
399- connect_aks
393+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
400394
401395get_wls_monitoring_exporter_image_url
402396
Original file line number Diff line number Diff line change 1- # Copyright (c) 2021, Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates.
44#
@@ -15,10 +15,7 @@ echo "install kubectl"
1515az aks install-cli
1616
1717echo " Connect AKS"
18- az aks get-credentials \
19- --resource-group ${AKS_CLUSTER_RESOURCEGROUP_NAME} \
20- --name ${AKS_CLUSTER_NAME} \
21- --overwrite-existing
18+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
2219
2320wlsDomainNS=" ${WLS_DOMAIN_UID} -ns"
2421
Original file line number Diff line number Diff line change 22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
44function wait_for_azure_ingress_ready() {
5- az aks get-credentials \
6- --resource-group ${AKS_CLUSTER_RG_NAME} \
7- --name ${AKS_CLUSTER_NAME} \
8- --overwrite-existing
9-
105 local ready=false
116 local attempt=0
127
@@ -36,4 +31,6 @@ set -Eo pipefail
3631
3732install_kubectl
3833
34+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
35+
3936wait_for_azure_ingress_ready
Original file line number Diff line number Diff line change 1- # Copyright (c) 2021, Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33# Inputs:
44# AKS_CLUSTER_RESOURCEGROUP_NAME
@@ -8,14 +8,6 @@ echo "Script ${0} starts"
88
99export currentStorageAccount=" null"
1010
11- # Connect to AKS cluster
12- function connect_aks_cluster() {
13- az aks get-credentials \
14- --resource-group ${AKS_CLUSTER_RESOURCEGROUP_NAME} \
15- --name ${AKS_CLUSTER_NAME} \
16- --overwrite-existing
17- }
18-
1911function query_storage_account() {
2012 echo " install kubectl"
2113 az aks install-cli
@@ -42,7 +34,7 @@ function output_result() {
4234 echo $result > $AZ_SCRIPTS_OUTPUT_PATH
4335}
4436
45- connect_aks_cluster
37+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
4638
4739query_storage_account
4840
Original file line number Diff line number Diff line change 1- # Copyright (c) 2021, Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
44echo " Script ${0} starts"
@@ -80,14 +80,6 @@ function validate_input() {
8080 fi
8181}
8282
83- # Connect to AKS cluster
84- function connect_aks_cluster() {
85- az aks get-credentials \
86- --resource-group ${AKS_RESOURCE_GROUP_NAME} \
87- --name ${AKS_NAME} \
88- --overwrite-existing
89- }
90-
9183function create_datasource_model_configmap_and_secret() {
9284 echo " get data source secret name"
9385 jndiLabel=${JDBC_DATASOURCE_NAME// \/ / \_ }
@@ -289,7 +281,7 @@ export wlsDomainNS="${WLS_DOMAIN_UID}-ns"
289281
290282validate_input
291283
292- connect_aks_cluster
284+ connect_aks $AKS_NAME $AKS_RESOURCE_GROUP_NAME
293285
294286install_kubectl
295287
Original file line number Diff line number Diff line change 1- # Copyright (c) 2021, Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
44echo " Script ${0} starts"
@@ -114,11 +114,6 @@ function validate_input() {
114114 fi
115115}
116116
117- # Connect to AKS cluster
118- function connect_aks_cluster() {
119- az aks get-credentials --resource-group ${AKS_CLUSTER_RG_NAME} --name ${AKS_CLUSTER_NAME} --overwrite-existing
120- }
121-
122117function create_svc_lb() {
123118 # No lb svc inputs
124119 if [[ " ${LB_SVC_VALUES} " != " []" ]]; then
@@ -147,7 +142,7 @@ validate_input
147142
148143install_utilities
149144
150- connect_aks_cluster
145+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
151146
152147create_svc_lb
153148
Original file line number Diff line number Diff line change @@ -285,11 +285,6 @@ function install_utilities() {
285285 validate_status ${ret}
286286}
287287
288- # Connect to AKS cluster
289- function connect_aks_cluster() {
290- az aks get-credentials --resource-group ${AKS_CLUSTER_RESOURCEGROUP_NAME} --name ${AKS_CLUSTER_NAME} --overwrite-existing
291- }
292-
293288# remove the operator if it is not running.
294289function uninstall_operator() {
295290 echo " remove operator"
@@ -772,7 +767,7 @@ query_acr_credentials
772767
773768build_docker_image
774769
775- connect_aks_cluster
770+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
776771
777772install_wls_operator
778773
Original file line number Diff line number Diff line change @@ -98,14 +98,6 @@ function validate_input() {
9898 fi
9999}
100100
101- # Connect to AKS cluster
102- function connect_aks_cluster() {
103- az aks get-credentials \
104- --resource-group ${AKS_CLUSTER_RESOURCEGROUP_NAME} \
105- --name ${AKS_CLUSTER_NAME} \
106- --overwrite-existing
107- }
108-
109101function query_wls_cluster_info(){
110102 WLS_CLUSTER_SIZE=$( kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json \
111103 | jq ' . | .status.clusters[] | select(.clusterName == "' ${constClusterName} ' ") | .maximumReplicas' )
@@ -291,7 +283,7 @@ validate_input
291283
292284install_kubectl
293285
294- connect_aks_cluster
286+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
295287
296288query_wls_cluster_info
297289
Original file line number Diff line number Diff line change 1- # Copyright (c) 2021, Oracle Corporation and/or its affiliates.
1+ # Copyright (c) 2021, 2024 Oracle Corporation and/or its affiliates.
22# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates.
44
@@ -27,6 +27,16 @@ function utility_validate_status() {
2727 fi
2828}
2929
30+ function connect_aks(){
31+ az aks get-credentials \
32+ -n $1 \
33+ -g $2 \
34+ --overwrite-existing \
35+ --only-show-errors
36+
37+ utility_validate_status " Finished connecting to AKS cluster."
38+ }
39+
3040# JAVA_HOME=/usr/lib/jvm/java-11-openjdk
3141function install_jdk() {
3242 local ready=false
You can’t perform that action at this time.
0 commit comments