Skip to content

Commit e40ba85

Browse files
edburnsGaliarjeberhard
committed
Supercedes #1900 (#1940)
* Fix text parsing issue modified: utility.sh Fix text parsing error on Ubuntu 18.04.5 LTS modified: validate.sh Fix yaml parsing error on MacOS. Wait for resource ready on MacOS and remove code for helm less than 3.0 Add text for domain status troubleshooting Use tag that includes AKS docs. Per Reza, inline OCR authentication Update _index.md Update create-domain-on-aks-inputs.yaml Update _index.md Update _index.md Update _index.md Update _index.md Update _index.md Update _index.md Remove UNIX Update _index.md Use AKS addon name Use alias as Rosemary suggested in our last PR. * Update _index.md * Update _index.md Co-authored-by: Galia <[email protected]> Co-authored-by: Ryan Eberhard <[email protected]>
1 parent 07d3a8b commit e40ba85

File tree

5 files changed

+101
-64
lines changed

5 files changed

+101
-64
lines changed

docs-source/content/samples/simple/azure-kubernetes-service/_index.md

Lines changed: 84 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,21 @@ AKS is a managed Kubernetes Service that lets you quickly deploy and manage Kube
2424

2525
#### Prerequisites
2626

27-
This sample assumes the following prerequisites.
27+
This sample assumes the following prerequisite environment setup.
2828

29-
##### Environment for setup
30-
31-
This sample assumes one of the following two execution environments:
32-
33-
1. Run the commands on your local computer. This allows for the greatest flexibility while requiring some setup effort.
34-
1. Run the commands in the Azure Cloud Shell. Cloud Shell is a browser-based utility and runs on the Azure portal. This option may be best for users already familiar with the utility and Azure. It is also suitable for users wanting to avoid installing additional software on their local computer.
35-
36-
* Local Environment Setup
37-
38-
* Operating System: Linux, UNIX, macOS or [WSL for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
39-
* [Git](https://git-scm.com/downloads), use `git --version` to test if `git` works. This document was tested with version 2.17.1.
40-
* [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.
41-
* [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.
42-
* [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.4.
43-
44-
* Azure Cloud Shell
45-
46-
The Azure Cloud Shell already has the necessary prerequisites installed.
47-
To start the Azure Cloud Shell, please go to [Overview of Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/overview).
29+
* Operating System: GNU/Linux, macOS or [WSL for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
30+
* [Git](https://git-scm.com/downloads), use `git --version` to test if `git` works. This document was tested with version 2.17.1.
31+
* [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.
32+
* [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.
33+
* [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.4.
4834

4935
##### Create Service Principal for AKS
5036

5137
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.
5238

5339
We will use a service principal to create an AKS cluster. Follow the commands below to create a new service principal.
5440

55-
If you run commands in your local environment, please run `az login` first. Skip that command if you run on the Azure Cloud Shell. Do set the subscription you want to work with. You can get a list of your subscriptions by running `az account list`.
41+
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`.
5642

5743
```bash
5844
# Login
@@ -118,24 +104,34 @@ Successful output will look like the following:
118104

119105
##### Oracle Container Registry
120106

121-
You will need an Oracle account. Follow the steps at [GET IMAGES](/weblogic-kubernetes-operator/quickstart/get-images/), accepting the license agreement for WebLogic Server in the process. Make note of your Oracle Account password and email. This sample pertains to 12.2.1.3, but other
122-
versions may work as well.
107+
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.3, but other versions may work as well.
108+
109+
1. Obtain the WebLogic Server image from the [Oracle Container Registry](https://container-registry.oracle.com/).
110+
111+
a. First time users, [follow these directions](/weblogic-kubernetes-operator/userguide/managing-domains/domain-in-image/base-images/#obtaining-standard-images-from-the-oracle-container-registry).
112+
113+
b. Find and then pull the WebLogic 12.2.1.3 install image:
114+
115+
```bash
116+
$ docker pull container-registry.oracle.com/middleware/weblogic:12.2.1.3
117+
```
123118

124119
##### Clone WebLogic Server Kubernetes Operator repository
125120

126-
Clone this repository to your machine. We will use several scripts in this repository to create a WebLogic domain. This sample was tested with v3.0.0.
121+
Clone the [Oracle WebLogic Server Kubernetes Operator repository](https://github.com/oracle/weblogic-kubernetes-operator) to your machine. We will use several scripts in this repository to create a WebLogic domain. This sample was tested with v3.0.0-wls-aks.
127122

128123
```bash
129124
$ git clone https://github.com/oracle/weblogic-kubernetes-operator.git
130-
$ git checkout v3.0.0
125+
#cd weblogic-kubernetes-operator
126+
$ git checkout v3.0.0-wls-aks
131127
```
132128

133129
{{% 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.
134130
{{% /notice %}}
135131

136132
#### Create the AKS cluster
137133

138-
This sample requires that you disable http-application-routing by default. If you want to enable http_application_routing, please follow [HTTP application routing](https://docs.microsoft.com/azure/aks/http-application-routing).
134+
This sample requires that you disable the AKS addon `http_application_routing` by default. If you want to enable `http_application_routing`, please follow [HTTP application routing](https://docs.microsoft.com/azure/aks/http-application-routing).
139135

140136
Run the following commands to create the AKS cluster instance.
141137

@@ -273,9 +269,9 @@ For example, given the service principal created above, the following values mus
273269
| `azureServicePrincipalAppId` | `nr086o75-pn59-4782-no5n-nq2op0rsr1q6` | `appId` |
274270
| `azureServicePrincipalClientSecret` | `8693089o-q190-45ps-9319-or36252s3s90` | `password` |
275271
| `azureServicePrincipalTenantId` | `72s988os-86s1-cafe-babe-2q7pq011qo47` | `tenant` |
276-
| `dockerEmail` | `yourDockerEmail` | The email address corresponding to the Docker user name |
277-
| `dockerPassword` | `yourDockerPassword`| Your Docker password in clear text |
278-
| `dockerUserName` | `yourDockerId` | Your Docker ID|
272+
| `dockerEmail` | `yourDockerEmail` | Your Oracle Single Sign-On (SSO) account email, used to pull the WebLogic Server Docker image from the Oracle Container Registry. |
273+
| `dockerPassword` | `yourDockerPassword`| Your Oracle Single Sign-On (SSO) account password in clear text. |
274+
| `dockerUserName` | `yourDockerId` | The same value as `dockerEmail`. |
279275
| `namePrefix` | `0730` | Alphanumeric value used as a disambiguation prefix for several Kubernetes resources. Make sure the value matches the value of `${NAME_PREFIX}` to keep names in step-by-step commands the same with those in configuration files. |
280276

281277
Use the following command to generate configuration files, assuming the output directory is `~/azure`. The script will overwrite any files generated by a previous invocation.
@@ -307,7 +303,7 @@ Completed
307303

308304
In order to mount the file share as a persistent volume, we have provided a configuration file `pv.yaml`. You can find it in your output directory. The following content is an example that uses the value `0730-weblogic-1597391432` as "shareName", `0730azure-secret` as "secretName", and the persistent volume name is `0730-azurefile-1597391432`.
309305

310-
We will use the initial StorageClasses `azurefile`. If you want to create a new class, follow this document [Create a storage class](https://docs.microsoft.com/en-us/azure/aks/azure-files-dynamic-pv#create-a-storage-class). For more information, see the page [Storage options for applications in Azure Kubernetes Service (AKS)](https://docs.microsoft.com/en-us/azure/aks/concepts-storage#storage-classes).
306+
We will use the storage class `azurefile`. If you want to create a new class, follow this document [Create a storage class](https://docs.microsoft.com/en-us/azure/aks/azure-files-dynamic-pv#create-a-storage-class). For more information, see the page [Storage options for applications in Azure Kubernetes Service (AKS)](https://docs.microsoft.com/en-us/azure/aks/concepts-storage#storage-classes).
311307

312308
```yaml
313309
apiVersion: v1
@@ -388,13 +384,9 @@ persistentvolumeclaim/0730-azurefile-1597391432 Bound 0730-azurefile-159739
388384

389385
The Oracle WebLogic Server Kubernetes Operator is an adapter to integrate WebLogic Server and Kubernetes, allowing Kubernetes to serve as a container infrastructure hosting WLS instances. The operator runs as a Kubernetes Pod and stands ready to perform actions related to running WLS on Kubernetes.
390386

391-
Kubernetes Operators use [Helm](https://helm.sh/) to manage Kubernetes applications. The operator’s Helm chart is located in the `kubernetes/charts/weblogic-operator` directory. Please check the Helm version first if you are using the Azure Cloud Shell, and run the corresponding command. This sample was tested with v3.0.0.
387+
Kubernetes Operators use [Helm](https://helm.sh/) to manage Kubernetes applications. The operator’s Helm chart is located in the `kubernetes/charts/weblogic-operator` directory. Please install the operator by running the corresponding command.
392388

393389
```bash
394-
# Check the helm version
395-
$ helm version
396-
397-
# For Helm 3.x, run the following:
398390
$ helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts
399391
$ helm repo update
400392
$ helm install weblogic-operator weblogic-operator/weblogic-operator --version "3.0.0"
@@ -456,13 +448,13 @@ Now that we have created the AKS cluster, installed the operator, and verified t
456448
$ export SECRET_NAME_DOCKER="${NAME_PREFIX}regcred"
457449
458450
#cd kubernetes/samples/scripts/create-kuberetes-secrets
459-
$ ./create-docker-credentials-secret.sh -s ${SECRET_NAME_DOCKER} -e <[email protected]> -p <myDockerPassword> -u <myDockerUserId> -d container-registry.oracle.com
451+
$ ./create-docker-credentials-secret.sh -s ${SECRET_NAME_DOCKER} -e <oracleSsoEmail> -p <oracleSsoPassword> -u <oracleSsoEmail> -d container-registry.oracle.com
460452
```
461453

462454
The following is an example of successful output:
463455

464456
```bash
465-
$ ./create-docker-credentials-secret.sh -s ${SECRET_NAME_DOCKER} -e [email protected] -p myDockerPassword -u myDockerUserId
457+
$ ./create-docker-credentials-secret.sh -s ${SECRET_NAME_DOCKER} -e [email protected] -p oracleSsoPassword -u [email protected]
466458
secret/0730regcred created
467459
The secret 0730regcred has been successfully created in the default namespace.
468460
```
@@ -490,9 +482,9 @@ Now that we have created the AKS cluster, installed the operator, and verified t
490482

491483
3. We will use the `kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh` script to create the WLS domain in the persistent volume we created previously.
492484

493-
First, we need to set up the domain configuration for the WebLogic domain. This step uses the configuration generated previously.
485+
We need to set up the domain configuration for the WebLogic domain. This step uses the configuration generated previously.
494486

495-
Next, validate all the resources created above using script `kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/validate.sh`.
487+
Validate all the resources created above using the script `kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/validate.sh`.
496488

497489
Use the following commands to check if the resources are ready:
498490

@@ -816,8 +808,8 @@ For input values, you can edit `kubernetes/samples/scripts/create-weblogic-domai
816808
| `azureServicePrincipalClientSecret` | `8693089o-q190-45ps-9319-or36252s3s90` | A client secret of your service principal, refer to the client secret in the [Create Service Principal](#create-service-principal-for-aks) section. |
817809
| `azureServicePrincipalTenantId` | `72s988os-86s1-cafe-babe-2q7pq011qo47` | Tenant (Directory ) ID of your service principal, refer to the client secret in the [Create Service Principal](#create-service-principal-for-aks) section. |
818810
| `dockerEmail` | `yourDockerEmail` | Oracle Single Sign-On (SSO) account email, used to pull the WebLogic Server Docker image. |
819-
| `dockerPassword` | `yourDockerPassword`| Password for Oracle SSO account password, used to pull the WebLogic Server Docker image. In clear text. |
820-
| `dockerUserName` | `yourDockerId` | The same value as `dockerEmail` |
811+
| `dockerPassword` | `yourDockerPassword`| Password for Oracle SSO account, used to pull the WebLogic Server Docker image. In clear text. |
812+
| `dockerUserName` | `yourDockerId` | The same value as `dockerEmail`. |
821813
| `namePrefix` | `0730` | Alphanumeric value used as a disambiguation prefix for several Kubernetes resources. |
822814
823815
If you don't want to change the other parameters, you can use the default values. Please make sure no extra whitespaces are added!
@@ -930,9 +922,9 @@ The logs are stored in the Azure file share. Follow these steps to access the lo
930922
Check the deploy log and find the failure details with `kubectl describe pod podname`.
931923
Please go to 1. Getting pod error details.
932924
933-
* **Process of starting the Administration Server is still running**
925+
* **Process of starting the servers is still running**
934926
935-
Check with `kubectl get svc` and if domain1-admin-server is not listed,
927+
Check with `kubectl get svc` and if domain1-admin-server, domain1-managed-server1 and domain1-managed-server2 are not listed,
936928
we need to wait some more for the Administration Server to start.
937929
938930
The following output is an example of when the Administration Server has started.
@@ -951,6 +943,55 @@ The logs are stored in the Azure file share. Follow these steps to access the lo
951943
kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 16m
952944
```
953945
946+
If services are up but the WLS Administration Console is still not available, use `kubectl describe domain` to check domain status.
947+
948+
```bash
949+
$ kubectl describe domain domain1
950+
```
951+
952+
Make sure the status of cluster-1 is `ServersReady` and `Available`. The status of admin-server, managed-server1 and managed-server2 should be `RUNNING`. Otherwise, the cluster is likely still in the process of becoming fully ready.
953+
954+
```yaml
955+
Status:
956+
Clusters:
957+
Cluster Name: cluster-1
958+
Maximum Replicas: 5
959+
Minimum Replicas: 1
960+
Ready Replicas: 2
961+
Replicas: 2
962+
Replicas Goal: 2
963+
Conditions:
964+
Last Transition Time: 2020-07-06T05:39:32.539Z
965+
Reason: ServersReady
966+
Status: True
967+
Type: Available
968+
Replicas: 2
969+
Servers:
970+
Desired State: RUNNING
971+
Node Name: aks-nodepool1-11471722-vmss000001
972+
Server Name: admin-server
973+
State: RUNNING
974+
Cluster Name: cluster-1
975+
Desired State: RUNNING
976+
Node Name: aks-nodepool1-11471722-vmss000001
977+
Server Name: managed-server1
978+
State: RUNNING
979+
Cluster Name: cluster-1
980+
Desired State: RUNNING
981+
Node Name: aks-nodepool1-11471722-vmss000001
982+
Server Name: managed-server2
983+
State: RUNNING
984+
Cluster Name: cluster-1
985+
Desired State: SHUTDOWN
986+
Server Name: managed-server3
987+
Cluster Name: cluster-1
988+
Desired State: SHUTDOWN
989+
Server Name: managed-server4
990+
Cluster Name: cluster-1
991+
Desired State: SHUTDOWN
992+
Server Name: managed-server5
993+
```
994+
954995
3. **Domain debugging**
955996
956997
Some suggestions for debugging problems with Model in Image after your Domain YAML file is deployed are found in the section on [debugging](/weblogic-kubernetes-operator/userguide/managing-domains/model-in-image/debugging/).

kubernetes/samples/scripts/common/utility.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,13 @@ function createFiles {
538538
if [ -z "${serverPodResources}" ]; then
539539
sed -i -e "/%OPTIONAL_SERVERPOD_RESOURCES%/d" ${dcrOutput}
540540
else
541-
sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
541+
if [[ $(uname) -eq "Darwin" ]]; then
542+
serverPodResources=$(echo "${serverPodResources}" | sed -e 's/\\n/%NEWLINE%/g')
543+
sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
544+
sed -i -e $'s|%NEWLINE%|\\\n|g' ${dcrOutput}
545+
else
546+
sed -i -e "s:%OPTIONAL_SERVERPOD_RESOURCES%:${serverPodResources}:g" ${dcrOutput}
547+
fi
542548
fi
543549

544550
if [ "${domainHomeInImage}" == "true" ]; then

kubernetes/samples/scripts/common/validate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ function validateDomainSecret {
337337
failIfValidationErrors
338338

339339
# Verify the secret contains a username
340-
SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}'| grep username: | wc | awk ' { print $1; }'`
340+
SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}' | tr -d '"' | grep username: | wc | awk ' { print $1; }'`
341341
if [ "${SECRET}" != "1" ]; then
342342
validationError "The domain secret ${weblogicCredentialsSecretName} in namespace ${namespace} does contain a username"
343343
fi
344344

345345
# Verify the secret contains a password
346-
SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}'| grep password: | wc | awk ' { print $1; }'`
346+
SECRET=`kubectl get secret ${weblogicCredentialsSecretName} -n ${namespace} -o jsonpath='{.data}' | tr -d '"'| grep password: | wc | awk ' { print $1; }'`
347347
if [ "${SECRET}" != "1" ]; then
348348
validationError "The domain secret ${weblogicCredentialsSecretName} in namespace ${namespace} does contain a password"
349349
fi

kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ azureServicePrincipalClientSecret: azure-service-principal-client-secret
1919
# Tenant (Directory) id of the service principal.
2020
azureServicePrincipalTenantId: azure-service-principal-tenant-id
2121

22-
# Oracle Single Sign-On (SSO) account email, used to pull the WebLogic Server Docker image
22+
# Oracle Single Sign-On (SSO) account email, used to pull the WebLogic Server Docker image.
2323
dockerEmail: docker-email
2424

25-
# Password for Oracle SSO account password, used to pull the WebLogic Server Docker image
25+
# Oracle SSO account password, used to pull the WebLogic Server Docker image.
2626
dockerPassword: docker-password
2727

28-
# The same value as dockerEmail
28+
# The same value as dockerEmail.
2929
dockerUserName: docker-user-name
3030

3131
# Specify where to create azure resource.

kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -364,20 +364,10 @@ function createFileShare {
364364
}
365365

366366
function installWebLogicOperator {
367-
# Helm
368-
helmVersion=$(echo `helm version` | grep -Po '(?<=Version:\"v)\d')
369-
if [ $helmVersion -lt 3 ]
370-
then
371-
helm init
372-
helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts
373-
helm repo update
374-
helm install weblogic-operator/weblogic-operator --name weblogic-operator --version "3.0.0"
375-
else
376-
# For Helm 3.x
377-
helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts
378-
helm repo update
379-
helm install weblogic-operator weblogic-operator/weblogic-operator --version "3.0.0"
380-
fi
367+
echo `helm version`
368+
helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts
369+
helm repo update
370+
helm install weblogic-operator weblogic-operator/weblogic-operator --version "3.0.0"
381371
}
382372

383373
function createWebLogicDomain {
@@ -409,7 +399,7 @@ function waitForJobComplete {
409399
svcState="completed"
410400
attempts=$((attempts + 1))
411401
echo Waiting for job completed...${attempts}
412-
sleep 1m
402+
sleep 120
413403

414404
# If the job is completed, there should have the following services created,
415405
# ${domainUID}-${adminServerName}, e.g. domain1-admin-server

0 commit comments

Comments
 (0)