Skip to content

Commit 552654f

Browse files
committed
Synchronize
1 parent 9335e0e commit 552654f

File tree

15 files changed

+299
-292
lines changed

15 files changed

+299
-292
lines changed

documentation/3.4/content/samples/azure-kubernetes-service/domain-on-pv.md

Lines changed: 153 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,39 @@ This sample demonstrates how to use the [WebLogic Kubernetes Operator](/weblogic
2626

2727
##### Clone WebLogic Kubernetes Operator repository
2828

29-
Clone the [WebLogic Kubernetes Operator repository](https://github.com/oracle/weblogic-kubernetes-operator) to your machine. You will use several scripts in this repository to create a WebLogic domain. This sample was tested with v3.3.7, but should work with the latest release.
29+
Clone the [WebLogic Kubernetes Operator repository](https://github.com/oracle/weblogic-kubernetes-operator) to your machine. You will use several scripts in this repository to create a WebLogic domain. This sample was tested with v3.4.2, but should work with the latest release.
3030

3131
```shell
3232
$ git clone --branch v{{< latestVersion >}} https://github.com/oracle/weblogic-kubernetes-operator.git
3333
```
3434

35+
##### Sign in with Azure CLI
36+
37+
The steps in this section show you how to sign in to the Azure CLI.
38+
39+
1. Open a Bash shell.
40+
41+
1. Sign out and delete some authentication files to remove any lingering credentials.
42+
43+
```shell
44+
$ az logout
45+
$ rm ~/.azure/accessTokens.json
46+
$ rm ~/.azure/azureProfile.json
47+
```
48+
49+
1. Sign in to your Azure CLI.
50+
51+
```shell
52+
$ az login
53+
```
54+
55+
1. Set the subscription ID. Be sure to replace the placeholder with the appropriate value.
56+
57+
```shell
58+
$ export SUBSCRIPTION_ID=<your-subscription-id>
59+
$ az account set -s $SUBSCRIPTION_ID
60+
```
61+
3562
{{% notice info %}} The following sections of the sample instructions will guide you, step-by-step, through the process of setting up a WebLogic cluster on AKS - remaining as close as possible to a native Kubernetes experience. This lets you understand and customize each step. If you wish to have a more automated experience that abstracts some lower level details, you can skip to the [Automation](#automation) section.
3663
{{% /notice %}}
3764

@@ -495,9 +522,6 @@ For input values, you can edit `kubernetes/samples/scripts/create-weblogic-domai
495522

496523
| Name in YAML file | Example value | Notes |
497524
|-------------------|---------------|-------|
498-
| `azureServicePrincipalAppId` | `nr086o75-pn59-4782-no5n-nq2op0rsr1q6` | Application ID of your service principal; refer to the application ID in the [Create Service Principal]({{< relref "/samples/azure-kubernetes-service/domain-on-pv#create-a-service-principal-for-aks" >}}) section. |
499-
| `azureServicePrincipalClientSecret` | `8693089o-q190-45ps-9319-or36252s3s90` | A client secret of your service principal; refer to the client secret in the [Create Service Principal]({{< relref "/samples/azure-kubernetes-service/domain-on-pv#create-a-service-principal-for-aks" >}}) section. |
500-
| `azureServicePrincipalTenantId` | `72s988os-86s1-cafe-babe-2q7pq011qo47` | Tenant (Directory ) ID of your service principal; refer to the client secret in the [Create Service Principal]({{< relref "/samples/azure-kubernetes-service/domain-on-pv#create-a-service-principal-for-aks" >}}) section. |
501525
| `dockerEmail` | `yourDockerEmail` | Oracle Single Sign-On (SSO) account email, used to pull the WebLogic Server Docker image. |
502526
| `dockerPassword` | `yourDockerPassword`| Password for Oracle SSO account, used to pull the WebLogic Server Docker image, in clear text. |
503527
| `dockerUserName` | `yourDockerId` | The same value as `dockerEmail`. |
@@ -524,46 +548,140 @@ The script will print the Administration Server address after a successful deplo
524548

525549
#### Deploy sample application
526550

527-
Now that you have WLS running in AKS, you can test the cluster by deploying the simple sample application included in the repository:
528-
529-
1. Go to the WebLogic Server Administration Console, Select "Lock & Edit".
530-
1. Select Deployments.
531-
1. Select Install.
532-
1. Select Upload your file(s).
533-
1. For the Deployment Archive, Select "Choose File".
534-
1. Select the file `kubernetes/samples/charts/application/testwebapp.war`.
535-
1. Select Next. Choose 'Install this deployment as an application'.
536-
1. Select Next. Select cluster-1 and All servers in the cluster. Select Next.
537-
1. Accept the defaults in the next screen and select Next
538-
1. Select Finish.
539-
1. Select Activate Changes.
540-
541-
{{%expand "Click here to view the application deployment screenshot." %}}
542-
![Deploy Application](../screenshot-deploy-test-app.png)
543-
{{% /expand %}}
551+
Now that you have WLS running in AKS, you can test the cluster by deploying the sample application included in the repository.
552+
553+
First, package the application with the following command:
544554

545-
Next you will need to start the application:
555+
```bash
556+
cd integration-tests/src/test/resources/bash-scripts
557+
bash build-war-app.sh -s ../apps/testwebapp/ -d /tmp/testwebapp
558+
```
546559

547-
1. Go to Deployments.
548-
1. Select Control.
549-
1. Select the check box next to `testwebapp`.
550-
1. Select Start.
551-
1. Select Servicing all requests.
552-
1. Select Yes.
560+
Successful output will look like the following:
553561

554-
After the successful deployment, go to the application through the `domain1-cluster-1-lb` external IP.
562+
```text
563+
Found source at ../apps/testwebapp/
564+
build /tmp/testwebapp/testwebapp.war with command jar -cvf /tmp/testwebapp/testwebapp.war *
565+
added manifest
566+
ignoring entry META-INF/
567+
ignoring entry META-INF/MANIFEST.MF
568+
adding: META-INF/maven/(in = 0) (out= 0)(stored 0%)
569+
adding: META-INF/maven/com.oracle.weblogic/(in = 0) (out= 0)(stored 0%)
570+
adding: META-INF/maven/com.oracle.weblogic/testwebapp/(in = 0) (out= 0)(stored 0%)
571+
adding: META-INF/maven/com.oracle.weblogic/testwebapp/pom.properties(in = 117) (out= 113)(deflated 3%)
572+
adding: META-INF/maven/com.oracle.weblogic/testwebapp/pom.xml(in = 1210) (out= 443)(deflated 63%)
573+
adding: WEB-INF/(in = 0) (out= 0)(stored 0%)
574+
adding: WEB-INF/web.xml(in = 951) (out= 428)(deflated 54%)
575+
adding: WEB-INF/weblogic.xml(in = 1140) (out= 468)(deflated 58%)
576+
adding: index.jsp(in = 1001) (out= 459)(deflated 54%)
577+
-rw-r--r-- 1 user user 3528 Jul 5 14:25 /tmp/testwebapp/testwebapp.war
578+
```
555579

556-
```shell
557-
$ kubectl get svc domain1-cluster-1-external-lb
580+
Now, you are able to deploy the sample application in `/tmp/testwebapp/testwebapp.war` to the cluster. This sample uses WLS RESTful API [/management/weblogic/latest/edit/appDeployments](https://docs.oracle.com/en/middleware/standalone/weblogic-server/14.1.1.0/wlrer/op-management-weblogic-version-edit-appdeployments-x-operations-1.html) to deploy the sample application. The WLS administration account and password in this sample are `weblogic:welcome1`, replace them with your value created in [Create WebLogic domain secrets](#create-secrets):
581+
582+
```bash
583+
$ ADMIN_SERVER_IP=$(kubectl get svc domain1-admin-server-external-lb -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
584+
$ curl --user weblogic:welcome1 -H X-Requested-By:MyClient -H Accept:application/json -s -v \
585+
-H Content-Type:multipart/form-data \
586+
-F "model={
587+
name: 'testwebapp',
588+
targets: [ { identity: [ 'clusters', 'cluster-1' ] } ]
589+
}" \
590+
-F "sourcePath=@/tmp/testwebapp/testwebapp.war" \
591+
-H "Prefer:respond-async" \
592+
-X POST http://${ADMIN_SERVER_IP}:7001/management/weblogic/latest/edit/appDeployments
558593
```
594+
595+
After the successful deployment, you will find output similar to the following:
596+
597+
{{%expand "Click here to view the output." %}}
598+
```text
599+
* Trying 52.226.101.43:7001...
600+
* TCP_NODELAY set
601+
* Connected to 52.226.101.43 (52.226.101.43) port 7001 (#0)
602+
* Server auth using Basic with user 'weblogic'
603+
> POST /management/weblogic/latest/edit/appDeployments HTTP/1.1
604+
> Host: 52.226.101.43:7001
605+
> Authorization: Basic d2VibG9naWM6d2VsY29tZTE=
606+
> User-Agent: curl/7.68.0
607+
> X-Requested-By:MyClient
608+
> Accept:application/json
609+
> Prefer:respond-async
610+
> Content-Length: 3925
611+
> Content-Type: multipart/form-data; boundary=------------------------cc76a2c2d819911f
612+
> Expect: 100-continue
613+
>
614+
* Mark bundle as not supporting multiuse
615+
< HTTP/1.1 100 Continue
616+
* We are completely uploaded and fine
617+
* Mark bundle as not supporting multiuse
618+
< HTTP/1.1 202 Accepted
619+
< Date: Thu, 11 Aug 2022 08:32:56 GMT
620+
< Location: http://domain1-admin-server:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/testwebapp
621+
< Content-Length: 764
622+
< Content-Type: application/json
623+
< X-ORACLE-DMS-ECID: 6f205c83-e172-4c34-a638-7f0c6345ce45-00000055
624+
< X-ORACLE-DMS-RID: 0
625+
< Set-Cookie: JSESSIONID=NOCMCQBO7dxyA2lUfCYp4zSYIeFB0S3V1KRRzigmmoOUfmQmlLOh!-546081476; path=/; HttpOnly
626+
< Vary: Accept-Encoding
627+
<
628+
{
629+
"links": [{
630+
"rel": "job",
631+
"href": "http:\/\/domain1-admin-server:7001\/management\/weblogic\/latest\/domainRuntime\/deploymentManager\/deploymentProgressObjects\/testwebapp"
632+
}],
633+
"identity": [
634+
"deploymentManager",
635+
"deploymentProgressObjects",
636+
"testwebapp"
637+
],
638+
"rootExceptions": [],
639+
"deploymentMessages": [],
640+
"name": "testwebapp",
641+
"operationType": 3,
642+
"startTimeAsLong": 1660206785965,
643+
"state": "STATE_RUNNING",
644+
"id": "0",
645+
"type": "DeploymentProgressObject",
646+
"targets": ["cluster-1"],
647+
"applicationName": "testwebapp",
648+
"failedTargets": [],
649+
"progress": "processing",
650+
"completed": false,
651+
"intervalToPoll": 1000,
652+
"startTime": "2022-08-11T08:33:05.965Z"
653+
* Connection #0 to host 52.226.101.43 left intact
559654
```
560-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
561-
domain1-cluster-1-external-lb LoadBalancer 10.0.108.249 52.224.248.40 8001:32695/TCP 30m
655+
{{% /expand %}}
656+
657+
Now, you can go to the application through the `domain1-cluster-1-lb` external IP.
658+
659+
```shell
660+
$ CLUSTER_IP=$(kubectl get svc domain1-cluster-1-external-lb -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
661+
662+
$ curl http://${CLUSTER_IP}:8001/testwebapp/
562663
```
563664

564-
In the example, the application address is: `http://52.224.248.40:8001/testwebapp`.
665+
The test application will list the server host and server IP on the output, like this:
666+
667+
```html
668+
<!DOCTYPE html>
669+
<html>
670+
<head>
671+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
565672

566-
The test application will list the server host and server IP on the page.
673+
<link rel="stylesheet" href="/testwebapp/res/styles.css;jsessionid=9uiMDakndtPlZTyDB9A-OKZEFBBAPyIs_9bG3qC4uA3PYaI8DsH1!-1450005246" type="text/css">
674+
<title>Test WebApp</title>
675+
</head>
676+
<body>
677+
678+
679+
<li>InetAddress: domain1-managed-server1/10.244.1.8
680+
<li>InetAddress.hostname: domain1-managed-server1
681+
682+
</body>
683+
</html>
684+
```
567685

568686
#### Validate NFS volume
569687

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
```shell
22
$ az group delete --yes --no-wait --name $AKS_PERS_RESOURCE_GROUP
33
$ az group delete --yes --no-wait --name "MC_$AKS_PERS_RESOURCE_GROUP"_"$AKS_CLUSTER_NAME"_"$AKS_PERS_LOCATION"
4-
$ az ad sp delete --id $SP_APP_ID
54
```
65

documentation/3.4/content/samples/azure-kubernetes-service/includes/create-aks-cluster-body-01.txt

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,3 @@
1-
##### Create a Service Principal for AKS
2-
3-
An AKS cluster requires either an [Azure Active Directory (AD) service principal](https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals) or a [managed identity](https://docs.microsoft.com/azure/aks/use-managed-identity) to interact with Azure resources.
4-
5-
We will use a service principal to create an AKS cluster. Follow the commands below to create a new service principal.
6-
7-
Please run `az login` first. Do set the subscription you want to work with. You can get a list of your subscriptions by running `az account list`.
8-
9-
```shell
10-
# Login
11-
$ az login
12-
13-
# Set your working subscription
14-
$ export SUBSCRIPTION_ID=<your-subscription-id>
15-
$ az account set -s $SUBSCRIPTION_ID
16-
```
17-
18-
Create the new service principal with the following commands:
19-
20-
```shell
21-
# Create Service Principal
22-
$ export SP_NAME=myAKSClusterServicePrincipal
23-
$ az ad sp create-for-rbac --skip-assignment --name $SP_NAME
24-
25-
# Copy the output to a file, we will use it later.
26-
```
27-
28-
If you see an error similar to the following:
29-
30-
```shell
31-
Found an existing application instance of "5pn2s201-nq4q-43n1-z942-p9r9571qr3rp". We will patch it
32-
Insufficient privileges to complete the operation.
33-
```
34-
35-
The problem may be a pre-existing service principal with the same name. Either delete the other service principal or pick a different name.
36-
37-
Successful output will look like the following:
38-
39-
```json
40-
{
41-
"appId": "r3qnq743-61s9-4758-8163-4qpo87s72s54",
42-
"displayName": "myAKSClusterServicePrincipal",
43-
"name": "http://myAKSClusterServicePrincipal",
44-
"password": "TfhR~uOJ1C1ftD5NS_LzJJj6UOjS2OwXfz",
45-
"tenant": "82sr215n-0ns5-404e-9161-206r0oqyq999"
46-
}
47-
```
48-
49-
Grant your service principal with a contributor role to create AKS resources.
50-
51-
```shell
52-
# Use the <appId> from the output of the last command
53-
$ export SP_APP_ID=r3qnq743-61s9-4758-8163-4qpo87s72s54
54-
$ az role assignment create --assignee $SP_APP_ID --role Contributor
55-
```
56-
57-
Successful output will look like the following:
58-
59-
```json
60-
{
61-
"canDelegate": null,
62-
"id": "/subscriptions/p7844r91-o11q-4n7s-np6s-996308sopqo9/providers/Microsoft.Authorization/roleAssignments/4oq396os-rs95-4n6s-n3qo-sqqpnpo91035",
63-
"name": "4oq396os-rs95-4n6s-n3qo-sqqpnpo91035",
64-
"principalId": "952551r8-n129-4on3-oqo9-231n0s6011n3",
65-
"principalType": "ServicePrincipal",
66-
"roleDefinitionId": "/subscriptions/p7844r91-o11q-4n7s-np6s-996308sopqo9/providers/Microsoft.Authorization/roleDefinitions/o24988np-6180-42n0-no88-20s7382qq24p",
67-
"scope": "/subscriptions/p7844r91-o11q-4n7s-np6s-996308sopqo9",
68-
}
69-
```
70-
711
##### Oracle Container Registry
722

733
You will need an Oracle account. The following steps will direct you to accept the license agreement for WebLogic Server. Make note of your Oracle Account password and email. This sample pertains to 12.2.1.4, but other versions may work as well.

documentation/3.4/content/samples/azure-kubernetes-service/includes/create-aks-cluster-body-02.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ $ export TIMESTAMP=`date +%s`
1313
$ export AKS_CLUSTER_NAME="${NAME_PREFIX}aks${TIMESTAMP}"
1414
$ export AKS_PERS_RESOURCE_GROUP="${NAME_PREFIX}resourcegroup${TIMESTAMP}"
1515
$ export AKS_PERS_LOCATION=eastus
16-
$ export SP_APP_ID=<appId from the az ad sp create-for-rbac command>
17-
$ export SP_CLIENT_SECRET=<password from the az ad sp create-for-rbac command>
1816

1917
$ az group create --name $AKS_PERS_RESOURCE_GROUP --location $AKS_PERS_LOCATION
2018
$ az aks create \
@@ -25,8 +23,7 @@ $ az aks create \
2523
--nodepool-name nodepool1 \
2624
--node-vm-size Standard_DS2_v2 \
2725
--location $AKS_PERS_LOCATION \
28-
--service-principal $SP_APP_ID \
29-
--client-secret $SP_CLIENT_SECRET
26+
--enable-managed-identity
3027
```
3128

3229
Successful output will be a JSON object with the entry `"type": "Microsoft.ContainerService/ManagedClusters"`.

documentation/3.4/content/samples/azure-kubernetes-service/includes/create-aks-cluster-storage.txt

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,33 @@ You will dynamically create and use a persistent volume with Azure Files NFS sha
5858

5959
The command provisions an NFS file share with NFS 4.1 or above.
6060

61-
3. Configure network security.
61+
3. Assign the AKS cluster **Contributor** role to access the storage account.
6262

63-
You must configure the network security allowing access from AKS cluster to the storage account.
63+
You must configure role assignment allowing access from AKS cluster to the storage account.
64+
65+
Get `objectId` of the AKS cluster with the following command and save it with variable `AKS_OBJECT_ID`:
66+
67+
```shell
68+
$ AKS_OBJECT_ID=$(az aks show --name ${AKS_CLUSTER_NAME} --resource-group ${AKS_PERS_RESOURCE_GROUP} --query "identity.principalId" -o tsv)
69+
```
70+
71+
Get Id of the storage account with the following command:
72+
73+
```shell
74+
$ STORAGE_ACCOUNT_ID=$(az storage account show --name ${AKS_PERS_STORAGE_ACCOUNT_NAME} --resource-group ${AKS_PERS_RESOURCE_GROUP} --query "id" -o tsv)
75+
```
76+
77+
Now, you are able to create a role assignment to grant the AKS cluster **Contributor** in the scope of the storage account. Then, the AKS cluster is able to access the file share.
78+
79+
```shell
80+
$ az role assignment create --assignee "${AKS_OBJECT_ID}" \
81+
--role "Contributor" \
82+
--scope "${STORAGE_ACCOUNT_ID}"
83+
```
84+
85+
4. Configure network security.
86+
87+
You must configure the network security allowing access from AKS cluster to the file share.
6488

6589
First, you must get the virtual network name and the subnet name of the AKS cluster.
6690

@@ -72,7 +96,10 @@ You will dynamically create and use a persistent volume with Azure Files NFS sha
7296
$ echo ${aksMCRGName}
7397

7498
# get network name of AKS cluster
75-
$ aksNetworkName=$(az resource list --resource-group ${aksMCRGName} --resource-type Microsoft.Network/virtualNetworks -o tsv --query '[*].name')
99+
$ aksNetworkName=$(az graph query -q "Resources \
100+
| where type =~ 'Microsoft.Network/virtualNetworks' \
101+
| where resourceGroup =~ '${aksMCRGName}' \
102+
| project name = name" --query "data[0].name" -o tsv)
76103
$ echo ${aksNetworkName}
77104

78105
# get subnet name of AKS agent pool

documentation/3.4/content/samples/azure-kubernetes-service/includes/prerequisites-01.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
This sample assumes the following prerequisite environment.
44

55
* Operating System: GNU/Linux, macOS or [WSL2 for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
6-
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.17.1.
7-
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.9.1.
8-
* [Docker for Desktop](https://www.docker.com/products/docker-desktop). This document was tested with `Docker version 20.10.2, build 2291f61`
9-
* [kubectl](https://kubernetes-io-vnext-staging.netlify.com/docs/tasks/tools/install-kubectl/); use `kubectl version` to test if `kubectl` works. This document was tested with version v1.16.3.
10-
* [Helm](https://helm.sh/docs/intro/install/), version 3.1 and later; use `helm version` to check the `helm` version. This document was tested with version v3.2.5.
6+
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.25.1.
7+
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.39.0.
8+
* [Docker for Desktop](https://www.docker.com/products/docker-desktop). This document was tested with `Docker version 20.10.7`
9+
* [kubectl](https://kubernetes-io-vnext-staging.netlify.com/docs/tasks/tools/install-kubectl/); use `kubectl version` to test if `kubectl` works. This document was tested with version v1.21.2.
10+
* [Helm](https://helm.sh/docs/intro/install/), version 3.1 and later; use `helm version` to check the `helm` version. This document was tested with version v3.6.2.
11+
* A Java JDK, Version 8 or 11. Azure recommends [Microsoft Build of OpenJDK](https://docs.microsoft.com/java/openjdk/download). Ensure that your `JAVA_HOME` environment variable is set correctly in the shells in which you run the commands.

0 commit comments

Comments
 (0)