Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 30 additions & 12 deletions weblogic-azure-aks/src/main/arm/scripts/buildWLSDockerImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,29 @@ function initialize() {
mkdir wlsdeploy/domainLibraries
}

function download_wdt_wit() {
local wlsToolingFamilyJsonFile=weblogic_tooling_family.json
# download the json file that wls operator version from weblogic-azure repo.
curl -m ${curlMaxTime} -fsL "${gitUrl4WLSToolingFamilyJsonFile}" -o ${wlsToolingFamilyJsonFile}
if [ $? -eq 0 ]; then
wdtDownloadURL=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WDT\") | .downloadURL" | tr -d "\"")
echo "WDT URL: ${wdtDownloadURL}"
witDownloadURL=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WIT\") | .downloadURL" | tr -d "\"")
echo "WIT URL: ${witDownloadURL}"
else
echo "Get latest WDT and WIT."
wdtDownloadURL="https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/weblogic-deploy.zip"
witDownloadURL="https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip"
fi

# Download weblogic tools
curl -m ${curlMaxTime} -fsL ${wdtDownloadURL} -o weblogic-deploy.zip
validate_status "Check status of weblogic-deploy.zip."

curl -m ${curlMaxTime} -fsL ${witDownloadURL} -o imagetool.zip
validate_status "Check status of imagetool.zip."
}

# Install docker, zip, unzip and java
# Download WebLogic Tools
function install_utilities() {
Expand Down Expand Up @@ -160,17 +183,17 @@ function install_utilities() {
unzip --help
validate_status "Check status of unzip."

# Download weblogic tools
curl -m ${curlMaxTime} -fL ${wdtDownloadURL} -o weblogic-deploy.zip
validate_status "Check status of weblogic-deploy.zip."
sudo apt-get -y -q install jq
echo "jq version"
jq --help
validate_status "Check status of unzip."

curl -m ${curlMaxTime} -fL ${witDownloadURL} -o imagetool.zip
validate_status "Check status of imagetool.zip."
download_wdt_wit

curl -m ${curlMaxTime} -fL ${wlsPostgresqlDriverUrl} -o ${scriptDir}/model-images/wlsdeploy/domainLibraries/postgresql-42.2.8.jar
curl -m ${curlMaxTime} -fL ${wlsPostgresqlDriverUrl} -o ${scriptDir}/model-images/wlsdeploy/domainLibraries/${constPostgreDriverName}
validate_status "Install postgresql driver."

curl -m ${curlMaxTime} -fL ${wlsMSSQLDriverUrl} -o ${scriptDir}/model-images/wlsdeploy/domainLibraries/mssql-jdbc-7.4.1.jre8.jar
curl -m ${curlMaxTime} -fL ${wlsMSSQLDriverUrl} -o ${scriptDir}/model-images/wlsdeploy/domainLibraries/${constMSSQLDriverName}
validate_status "Install mssql driver."
}

Expand Down Expand Up @@ -323,11 +346,6 @@ export dbDriversUrls=${12}

export acrImagePath="$azureACRServer/aks-wls-images:${imageTag}"
export dbDriverPaths=""
export ocrLoginServer="container-registry.oracle.com"
export wdtDownloadURL="https://github.com/oracle/weblogic-deploy-tooling/releases/download/release-1.9.17/weblogic-deploy.zip"
export witDownloadURL="https://github.com/oracle/weblogic-image-tool/releases/download/release-1.9.16/imagetool.zip"
export wlsPostgresqlDriverUrl="https://jdbc.postgresql.org/download/postgresql-42.3.6.jar"
export wlsMSSQLDriverUrl="https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/10.2.1.jre8/mssql-jdbc-10.2.1.jre8.jar"

read_sensitive_parameters_from_stdin

Expand Down
5 changes: 5 additions & 0 deletions weblogic-azure-aks/src/main/arm/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ export constDefaultAKSVersion="default"
export constFalse="false"
export constTrue="true"
export constIntrospectorJobActiveDeadlineSeconds=300 # for Guaranteed Qos
export constPostgreDriverName="postgresql-42.3.6.jar"
export constMSSQLDriverName="mssql-jdbc-10.2.1.jre8.jar"

export curlMaxTime=120 # seconds
export ocrLoginServer="container-registry.oracle.com"
export ocrGaImagePath="middleware/weblogic"
export ocrCpuImagePath="middleware/weblogic_cpu"
export gitUrl4CpuImages="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/weblogic_cpu_images.json"
export gitUrl4AksWellTestedVersionJsonFile="https://raw.githubusercontent.com/oracle/weblogic-azure/main/weblogic-azure-aks/src/main/resources/aks_well_tested_version.json"
export gitUrl4WLSToolingFamilyJsonFile="https://raw.githubusercontent.com/galiacheng/weblogic-azure/update-wko-wdt-wit/weblogic-azure-aks/src/main/resources/weblogic_tooling_family.json"

export optUninstallMaxTry=5 # Max attempts to wait for the operator uninstalled
export optUninstallInterval=10

export wlsContainerName="weblogic-server"
export wlsPostgresqlDriverUrl="https://jdbc.postgresql.org/download/postgresql-42.3.6.jar"
export wlsMSSQLDriverUrl="https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/10.2.1.jre8/mssql-jdbc-10.2.1.jre8.jar"
2 changes: 1 addition & 1 deletion weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ domainInfo:
AdminUserName: "@@SECRET:__weblogic-credentials__:username@@"
AdminPassword: "@@SECRET:__weblogic-credentials__:password@@"
ServerStartMode: "prod"
domainLibraries: [ 'wlsdeploy/domainLibraries/postgresql-42.2.8.jar', 'wlsdeploy/domainLibraries/mssql-jdbc-7.4.1.jre8.jar'${dbDriverPaths}]
domainLibraries: [ 'wlsdeploy/domainLibraries/${constPostgreDriverName}', 'wlsdeploy/domainLibraries/${constMSSQLDriverName}'${dbDriverPaths}]

topology:
Name: "@@ENV:CUSTOM_DOMAIN_NAME@@"
Expand Down
29 changes: 26 additions & 3 deletions weblogic-azure-aks/src/main/arm/scripts/setupWLSDomain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ function validate_status() {
fi
}

function get_wls_operator_version() {
local wlsToolingFamilyJsonFile=weblogic_tooling_family.json
# download the json file that wls operator version from weblogic-azure repo.
curl -m ${curlMaxTime} -fsL "${gitUrl4WLSToolingFamilyJsonFile}" -o ${wlsToolingFamilyJsonFile}
if [ $? -eq 0 ]; then
wlsOptVersion=$(cat ${wlsToolingFamilyJsonFile} | jq ".items[] | select(.key==\"WKO\") | .version" | tr -d "\"")
echo "WKO version: ${optVersion}"
else
echo "WKO version: latest"
fi
}

# Install latest kubectl and Helm
function install_utilities() {
if [ -d "apps" ]; then
Expand Down Expand Up @@ -335,14 +347,24 @@ function install_wls_operator() {
fi

echo "install the operator"
helm install ${wlsOptRelease} weblogic-operator/weblogic-operator \
if [[ -n "${wlsOptVersion}" ]]; then
helm install ${wlsOptRelease} weblogic-operator/weblogic-operator \
--namespace ${wlsOptNameSpace} \
--set serviceAccount=${wlsOptSA} \
--set "enableClusterRoleBinding=true" \
--set "domainNamespaceSelectionStrategy=LabelSelector" \
--set "domainNamespaceLabelSelector=weblogic-operator\=enabled" \
--version ${wlsOptVersion} \
--wait
else
helm install ${wlsOptRelease} weblogic-operator/weblogic-operator \
--namespace ${wlsOptNameSpace} \
--set serviceAccount=${wlsOptSA} \
--set "enableClusterRoleBinding=true" \
--set "domainNamespaceSelectionStrategy=LabelSelector" \
--set "domainNamespaceLabelSelector=weblogic-operator\=enabled" \
--version ${wlsOptVersion} \
--wait
fi

validate_status "Installing WLS operator."

Expand Down Expand Up @@ -798,7 +820,6 @@ export wlsOptHelmChart="https://oracle.github.io/weblogic-kubernetes-operator/ch
export wlsOptNameSpace="weblogic-operator-ns"
export wlsOptRelease="weblogic-operator"
export wlsOptSA="weblogic-operator-sa"
export wlsOptVersion="3.2.5"
export wlsIdentityKeyStoreFileName="security/identity.keystore"
export wlsTrustKeyStoreFileName="security/trust.keystore"
export wlsTrustKeyStoreJKSFileName="security/trust.jks"
Expand All @@ -807,6 +828,8 @@ read_sensitive_parameters_from_stdin

validate_input

get_wls_operator_version

install_utilities

query_acr_credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ resource aksCluster 'Microsoft.ContainerService/managedClusters@2021-02-01' = if
httpApplicationRouting: {
enabled: false
}
omsAgent: {
enabled: bool('${enableAzureMonitoring}')
}
omsAgent: enableAzureMonitoring ? obj_aciEnableOmsAgent : obj_aciDisableOmsAgent
}
enableRBAC: true
networkProfile: {
Expand Down