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 1
1
# Copyright (c) 2024, Oracle Corporation and/or its affiliates.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
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
-
11
4
function get_cluster_uid(){
12
5
local clusterUid=$( kubectl get clusters -n ${WLS_NAMESPACE} -o=jsonpath=' {.items[].metadata.name}' )
13
6
utility_validate_status " Obtain cluster UID."
@@ -62,7 +55,7 @@ set -Eo pipefail
62
55
63
56
install_kubectl
64
57
65
- connect_aks
58
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
66
59
67
60
get_cluster_uid
68
61
Original file line number Diff line number Diff line change 1
1
# Copyright (c) 2024, Oracle Corporation and/or its affiliates.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
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
11
5
12
6
function enable_promethues_metrics(){
13
7
# 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
396
390
397
391
install_helm
398
392
399
- connect_aks
393
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
400
394
401
395
get_wls_monitoring_exporter_image_url
402
396
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.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates.
4
4
#
@@ -15,10 +15,7 @@ echo "install kubectl"
15
15
az aks install-cli
16
16
17
17
echo " 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
22
19
23
20
wlsDomainNS=" ${WLS_DOMAIN_UID} -ns"
24
21
Original file line number Diff line number Diff line change 2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
4
4
function 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
-
10
5
local ready=false
11
6
local attempt=0
12
7
@@ -36,4 +31,6 @@ set -Eo pipefail
36
31
37
32
install_kubectl
38
33
34
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
35
+
39
36
wait_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.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
# Inputs:
4
4
# AKS_CLUSTER_RESOURCEGROUP_NAME
@@ -8,14 +8,6 @@ echo "Script ${0} starts"
8
8
9
9
export currentStorageAccount=" null"
10
10
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
-
19
11
function query_storage_account() {
20
12
echo " install kubectl"
21
13
az aks install-cli
@@ -42,7 +34,7 @@ function output_result() {
42
34
echo $result > $AZ_SCRIPTS_OUTPUT_PATH
43
35
}
44
36
45
- connect_aks_cluster
37
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
46
38
47
39
query_storage_account
48
40
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.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
4
4
echo " Script ${0} starts"
@@ -80,14 +80,6 @@ function validate_input() {
80
80
fi
81
81
}
82
82
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
-
91
83
function create_datasource_model_configmap_and_secret() {
92
84
echo " get data source secret name"
93
85
jndiLabel=${JDBC_DATASOURCE_NAME// \/ / \_ }
@@ -289,7 +281,7 @@ export wlsDomainNS="${WLS_DOMAIN_UID}-ns"
289
281
290
282
validate_input
291
283
292
- connect_aks_cluster
284
+ connect_aks $AKS_NAME $AKS_RESOURCE_GROUP_NAME
293
285
294
286
install_kubectl
295
287
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.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
4
4
echo " Script ${0} starts"
@@ -114,11 +114,6 @@ function validate_input() {
114
114
fi
115
115
}
116
116
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
-
122
117
function create_svc_lb() {
123
118
# No lb svc inputs
124
119
if [[ " ${LB_SVC_VALUES} " != " []" ]]; then
@@ -147,7 +142,7 @@ validate_input
147
142
148
143
install_utilities
149
144
150
- connect_aks_cluster
145
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RG_NAME
151
146
152
147
create_svc_lb
153
148
Original file line number Diff line number Diff line change @@ -285,11 +285,6 @@ function install_utilities() {
285
285
validate_status ${ret}
286
286
}
287
287
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
-
293
288
# remove the operator if it is not running.
294
289
function uninstall_operator() {
295
290
echo " remove operator"
@@ -772,7 +767,7 @@ query_acr_credentials
772
767
773
768
build_docker_image
774
769
775
- connect_aks_cluster
770
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
776
771
777
772
install_wls_operator
778
773
Original file line number Diff line number Diff line change @@ -98,14 +98,6 @@ function validate_input() {
98
98
fi
99
99
}
100
100
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
-
109
101
function query_wls_cluster_info(){
110
102
WLS_CLUSTER_SIZE=$( kubectl -n ${wlsDomainNS} get domain ${WLS_DOMAIN_UID} -o json \
111
103
| jq ' . | .status.clusters[] | select(.clusterName == "' ${constClusterName} ' ") | .maximumReplicas' )
@@ -291,7 +283,7 @@ validate_input
291
283
292
284
install_kubectl
293
285
294
- connect_aks_cluster
286
+ connect_aks $AKS_CLUSTER_NAME $AKS_CLUSTER_RESOURCEGROUP_NAME
295
287
296
288
query_wls_cluster_info
297
289
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.
2
2
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
# This script runs on Azure Container Instance with Alpine Linux that Azure Deployment script creates.
4
4
@@ -27,6 +27,16 @@ function utility_validate_status() {
27
27
fi
28
28
}
29
29
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
+
30
40
# JAVA_HOME=/usr/lib/jvm/java-11-openjdk
31
41
function install_jdk() {
32
42
local ready=false
You can’t perform that action at this time.
0 commit comments