Skip to content

Commit 1c9a49a

Browse files
committed
Merge remote-tracking branch 'origin/add_troubleshooting_verbage_to_samples' into release/2.0.1
2 parents eddc452 + 3ed7ab1 commit 1c9a49a

File tree

4 files changed

+148
-46
lines changed

4 files changed

+148
-46
lines changed

integration-tests/README.md

Lines changed: 60 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
11
# Integration Tests for Oracle WebLogic Server Kubernetes Operator
22

3-
This documentation describes the functional use cases that are covered in integration testing for the Oracle WebLogic Server Kubernetes Operator. The tests are written in Java (JUnit tests) and driven by Maven profile.
3+
This documentation describes the functional use cases that are covered in integration testing for the Oracle WebLogic Server Kubernetes Operator. The tests are written in Java (JUnit tests) and driven by Maven profile.
44

55
# Environments
66

7-
The tests currently run in three modes: "Wercker", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the WERCKER and JENKINS environment variables described below. The default is "standalone".
7+
The tests currently run in three modes: "Wercker", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the `WERCKER` and `JENKINS` environment variables described below. The default is "standalone".
88

9-
* "Standalone" Oracle Linux, i.e, run the tests manually with mvn command.
10-
* Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - integration-test-java is the pipeline name
11-
* Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/ - Jenkins Run is restricted to Oracle Internal development Process
9+
* "Standalone" Oracle Linux, i.e, run the tests manually with the `mvn` command.
10+
* Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - `integration-test-java` is the pipeline name.
11+
* Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/ - Jenkins Run is restricted to Oracle Internal development process.
1212

13-
Wercker runs only Quick test use cases, Jenkins run both Quick and Full test use cases.
13+
Wercker runs only Quick test use cases, Jenkins runs both Quick and Full test use cases.
1414

1515
# Use Cases
1616

1717
Java integration tests cover the below use cases:
1818

19-
Quick test use cases -
19+
Quick test use cases
2020

2121
| | |
2222
| --- | --- |
23-
| Operator Configuration | operator1 deployed in weblogic-operator1 namespace and manages domains in default and test1 namespaces |
24-
| Domain Configuration | Domain on PV using WLST, traefik load balancer |
23+
| Operator Configuration | operator1 deployed in `weblogic-operator1` namespace and manages domains in `default` and `test1` namespaces |
24+
| Domain Configuration | Domain on PV using WLST, Traefik load balancer |
2525

2626
Basic Use Cases
2727

28-
1. create operator operator1 which manages default and test1 namespaces, verify its deployed successfully, pod created, operator Ready and verify external REST service if configured
29-
2. create domain domain1 in default namespace and verify the pods, services are created and servers are in Ready
30-
3. verify admin external service by accessing admin REST endpoint with nodeport in URL
31-
4. verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST
32-
5. verify web app load balancing by accessing the webapp using loadBalancerWebPort
28+
1. Create operator `operator1` which manages `default` and `test1` namespaces, verify it's deployed successfully, pods created, operator ready and verify external REST service, if configured.
29+
2. Create domain `domain1` in `default` namespace and verify the pods, services are created and servers are in ready state.
30+
3. Verify the admin external service by accessing the admin REST endpoint with `nodeport` in URL.
31+
4. Verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST.
32+
5. Verify web app load balancing by accessing the webapp using `loadBalancerWebPort`.
3333

3434
Advanced Use Cases
3535

36-
6. verify domain life cycle(destroy and create) should not any impact on Operator managing the domain and web app load balancing and admin external service
37-
7. cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly.
38-
8. Operator life cycle(destroy and create) should not impact the running domain
36+
6. Verify domain life cycle (destroy and create) should not have any impact on operator managing the domain and web app load balancing and admin external service.
37+
7. Cluster scale up/down using operator REST endpoint, webapp load balancing should adjust accordingly.
38+
8. Operator life cycle (destroy and create) should not impact the running domain.
3939

40-
Also the below use cases are covered for Quick test
40+
Also the below use cases are covered for Quick test:
4141

42-
9. verify liveness probe by killing managed server 1 process 3 times to kick pod auto-restart
43-
10. shutdown the domain by changing domain serverStartPolicy to NEVER
42+
9. Verify the liveness probe by killing managed server 1 process 3 times to kick pod auto-restart.
43+
10. Shutdown the domain by changing domain `serverStartPolicy` to `NEVER`.
4444

45-
Full test use cases -
45+
Full test use cases
4646

4747
| | |
4848
| --- | --- |
49-
| Operator Configuration | operator2 deployed in weblogic-operator2 namespace and manages domains test2 namespace |
50-
| Domain Configuration | Domain on PV using WDT, Domain with serverStartPolicy ADMIN_ONLY, Domain with auto and custom situational configuration, Two domains managed by two operators, Domain with Recycle weblogicDomainStorageReclaimPolicy, Domain with default sample values |
49+
| Operator Configuration | operator2 deployed in `weblogic-operator2` namespace and manages domains `test2` namespace. |
50+
| Domain Configuration | Domain on PV using WDT; domain with `serverStartPolicy` `ADMIN_ONLY`; domain with auto and custom situational configuration; two domains managed by two operators; domain with recycle `weblogicDomainStorageReclaimPolicy`; domain with default sample values. |
5151

5252

5353
Basic Use Cases described above are verified in all the domain configurations. Also the below use cases are covered:
5454

5555
| Domain | Use Case |
5656
| --- | --- |
5757
| Domain on PV using WDT | WLDF scaling |
58-
| Domain with ADMIN_ONLY | making sure only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
59-
| Domain with situational config | create domain with listen address not set for admin server and t3 channel/NAP and incorrect file for admin server log location. Introspector should override these with sit-config automatically. Also, with some junk value for t3 channel public address and using custom situational config override replace with valid public address using secret. Also, on Jenkins this domain uses NFS instead of HOSTPATH PV storage |
60-
| Two domains managed by two operators | verify scaling and restart of one domain doesn't impact another domain. Delete domain resources using delete script from samples. |
61-
| Domain with Recycle policy | create domain with pvReclaimPolicy="Recycle" Verify that the PV is deleted once the domain and PVC are deleted |
62-
| Domain with default sample values | create domain using mostly default values for inputs |
63-
58+
| Domain with ADMIN_ONLY | Making sure only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
59+
| Domain with situational config | Create domain with listen address not set for admin server and t3 channel/NAP and incorrect file for admin server log location. Introspector should override these with sit-config automatically. Also, with some junk value for t3 channel public address and using custom situational config override replace with valid public address using secret. Also, on Jenkins this domain uses NFS instead of HOSTPATH PV storage. |
60+
| Two domains managed by two operators | Verify scaling and restart of one domain doesn't impact another domain. Delete domain resources using delete script from samples. |
61+
| Domain with Recycle policy | Create domain with pvReclaimPolicy="Recycle" Verify that the PV is deleted once the domain and PVC are deleted. |
62+
| Domain with default sample values | Create domain using mostly default values for inputs. |
63+
6464

6565
# Directory Configuration and Structure
6666

6767
Directory structure of source code:
6868

69-
A new module "integration-tests" is added to the Maven project weblogic-kubernetes-operator.
69+
A new module "integration-tests" is added to the Maven project `weblogic-kubernetes-operator`.
7070

71-
weblogic-kubernetes-operator/integration-tests - location of module pom.xml
72-
weblogic-kubernetes-operator/integration-tests/src/test/java - integration test(JUnit) classes and utility classes
73-
weblogic-kubernetes-operator/integration-tests/src/test/resources - properties, yaml files(see Configuration Files section) and other scripts
71+
`weblogic-kubernetes-operator/integration-tests` - location of module pom.xml
72+
`weblogic-kubernetes-operator/integration-tests/src/test/java` - integration test(JUnit) classes and utility classes
73+
`weblogic-kubernetes-operator/integration-tests/src/test/resources` - properties, YAML files (see Configuration Files section) and other scripts.
7474

7575
Directory structure used for the test run:
7676

77-
Main external env vars:
77+
Main external `env vars`:
7878

7979
| Variable | Description |
8080
| --- | --- |
8181
| RESULT_ROOT | Root path for local test files. |
8282
| PV_ROOT | Root NFS path behind PV/C directories. This must have permissions suitable for WL pods to add files |
8383

84-
Defaults for RESULT_ROOT & PV_ROOT:
84+
Defaults for `RESULT_ROOT` & `PV_ROOT`:
8585

8686
| Test Mode | RESULT_ROOT | PV_ROOT | Where initialized |
8787
| --- | --- | --- | --- |
@@ -173,7 +173,7 @@ Integration test classes:
173173

174174
When the integration test class ITOperator is executed, staticPrepare() method is called once before any of the test methods in the class and staticUnPrepare() method once at the end.
175175

176-
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
176+
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
177177

178178
staticUnPrepare() - releases the cluster lease on wercker env.
179179

@@ -232,7 +232,7 @@ WERCKER=true:
232232
Successful run will have the output like below:
233233
```
234234
[INFO] Reactor Summary:
235-
[INFO]
235+
[INFO]
236236
[INFO] weblogic-kubernetes-operator ....................... SUCCESS [ 0.305 s]
237237
[INFO] operator-model ..................................... SUCCESS [ 10.274 s]
238238
[INFO] operator-swagger ................................... SUCCESS [ 0.436 s]
@@ -250,19 +250,19 @@ Successful run will have the output like below:
250250
Failed run will have the output like
251251
```
252252
253-
[INFO]
253+
[INFO]
254254
[INFO] Results:
255-
[INFO]
256-
[ERROR] Errors:
255+
[INFO]
256+
[ERROR] Errors:
257257
[ERROR] ITOperator.testDomainOnPVUsingWLST:145 ? Runtime FAILURE: Couldn't create serv...
258-
[INFO]
258+
[INFO]
259259
[ERROR] Tests run: 9, Failures: 0, Errors: 1, Skipped: 0
260-
[INFO]
261-
[INFO]
260+
[INFO]
261+
[INFO]
262262
[INFO] --- maven-failsafe-plugin:2.20.1:verify (integration-tests) @ operator-integration-tests ---
263263
[INFO] ------------------------------------------------------------------------
264264
[INFO] Reactor Summary:
265-
[INFO]
265+
[INFO]
266266
[INFO] Build Tools ........................................ SUCCESS [ 1.193 s]
267267
[INFO] weblogic-kubernetes-operator ....................... SUCCESS [ 2.671 s]
268268
[INFO] json-schema ........................................ SUCCESS [ 14.917 s]
@@ -305,7 +305,7 @@ $RESULT_ROOT/acceptance_test_tmp is archived under $RESULT_ROOT/acceptance_test_
305305

306306
$PV_ROOT/acceptance_test_pv is archived under $PV_ROOT/acceptance_test_pv_archive
307307

308-
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
308+
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
309309

310310
# How to add a new test
311311

@@ -318,3 +318,18 @@ ITOperator.java - take a look at this test for reference
318318
# Future enhancement
319319

320320
Add functional tests
321+
322+
## Troubleshooting
323+
324+
The integration tests are not completely independent of the environment.
325+
326+
You may run into one or more of the following errors when you attempt to execute the command:
327+
```
328+
mvn clean verify -P java-integration-tests 2>&1 | tee log.txt
329+
```
330+
1. `[ERROR] No permision to create directory /scratch/...`
331+
332+
There are a couple ways to resolve this issue:
333+
334+
* Create a world writable directory named `/scratch`.
335+
* Create some other world writable directory and then define the environment variables `RESULT_ROOT` and `PV_ROOT` to point to that directory. If you want, you can create two directories to keep things separated. See [Directory Configuration and Structure](#directory-configuration-and-structure) for more details.

kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,16 @@ Access Modes: RWX
213213
Events: <none>
214214
215215
```
216+
217+
## Troubleshooting
218+
219+
* Message: `[ERROR] The weblogicDomainStoragePath parameter in kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml is missing, null or empty`
220+
Edit the file and set the value of the field. This value must be a directory that is world writable.
221+
Optionally, follow these steps to tighten permissions on the named directory after you run the sample the first time:
222+
223+
* Become the root user.
224+
* `ls -nd $value-of-weblogicDomainStoragePath`
225+
* Note the values of the third and fourth field of the output.
226+
* `chown $third-field:$fourth-field $value-of-weblogicDomainStoragePath`
227+
* `chmod 755 $value-of-weblogicDomainStoragePath`
228+
* Return to your normal user ID.

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,51 @@ Sometimes in production, but most likely in testing environments, you might want
384384
$ kubectl create -f delete-domain-job.yaml
385385
386386
```
387+
## Troubleshooting
388+
389+
1. Message: `status on iteration 20 of 20
390+
pod domain1-create-weblogic-sample-domain-job-4qwt2 status is Pending
391+
The create domain job is not showing status completed after waiting 300 seconds.`
392+
The most likely cause is related to the value of `persistentVolumeClaimName`, defined in `domain-home-on-pv/create-domain-inputs.yaml`. To determine if this is the problem:
393+
394+
* Execute `kubectl get all --all-namespaces` to find the name of the `create-weblogic-sample-domain-job`.
395+
* Execute `kubectl describe pod <name-of-create-weblogic-sample-domain-job>` to see if there is an event that has text similar to `persistentvolumeclaim "domain1-weblogic-sample-pvc" not found`.
396+
* Find the name of the PVC that was created by executing [create-pv-pvc.sh](../../create-weblogic-domain-pv-pvc/README.md), using `kubectl describe pvc`. It is likely to be `weblogic-sample-pvc`.
397+
* Change the value of `persistentVolumeClaimName` to match the name created when you executed [create-pv-pvc.sh](../../create-weblogic-domain-pv-pvc/README.md).
398+
* Rerun the `create-domain.sh` script with the same arguments as you did before.
399+
* Verify that the operator is deployed. Use the command:
400+
```
401+
kubectl get all --all-namespaces
402+
```
403+
Look for lines similar to:
404+
```
405+
weblogic-operator1 pod/weblogic-operator-
406+
```
407+
If you do not find something similar in the output, the WebLogic Operator for Kubernetes may not have been installed completely. Review the operator [installation instructions](../../../../../site/install.md).
408+
409+
410+
2. Message: `ERROR: Unable to create folder /shared/domains`
411+
The most common cause is a poor choice of value for `weblogicDomainStoragePath` in the input file used when you executed:
412+
```
413+
create-pv-pvc.sh
414+
```
415+
You should [delete the resources for your sample domain](../../delete-domain/README.md), correct the value in that file, and rerun the commands to create the PV/PVC and the credential before you attempt to rerun:
416+
```
417+
create-domain.sh
418+
```
419+
A correct value for `weblogicDomainStoragePath` will meet the following requirements:
420+
421+
* Must be the name of a directory.
422+
* The directory must be world writable.
423+
424+
Optionally, follow these steps to tighten permissions on the named directory after you run the sample the first time:
425+
426+
* Become the root user.
427+
* `ls -nd $value-of-weblogicDomainStoragePath`
428+
* Note the values of the third and fourth field of the output.
429+
* `chown $third-field:$fourth-field $value-of-weblogicDomainStoragePath`
430+
* `chmod 755 $value-of-weblogicDomainStoragePath`
431+
* Return to your normal user ID.
432+
433+
3. Message: `ERROR: The create domain job will not overwrite an existing domain. The domain folder /shared/domains/domain1 already exists`
434+
You will see this message if the directory `domains/domain1` exists in the directory named as the value of `weblogicDomainStoragePath` in `create-pv-pvc-inputs.yaml`. For example, if the value of `weblogicDomainStoragePath` is `/tmp/wls-op-4-k8s`, you would need to remove (or move) `/tmp/wls-op-4-k8s/domains/domain1`.
Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
**TODO** write me
1+
# Deleting domain resources created while executing the samples
2+
3+
After running the sample, you will need to release domain resources that
4+
can then be used for other purposes. The script in this sample demonstrates one approach to releasing
5+
domain resources.
6+
7+
## Using the script to delete domain resources
8+
9+
```
10+
$ ./delete-weblogic-domain-resources.sh \
11+
-d domain-uid[,domain-uid...] \
12+
[-s max-seconds] \
13+
[-t]
14+
```
15+
The required option `-d` takes `domain-uid` values (separated
16+
by commas and no spaces) to identify the domain resources that should be deleted.
17+
18+
To limit the amount of time spent on attempting to delete domain resources, use `-s`.
19+
The option must be followed by an integer that represents the total number of seconds
20+
that will be spent attempting to delete resources. The default number of seconds is 120.
21+
22+
The optional option `-t` shows what the script will delete without executing the deletion.
23+
24+
To see the help associated with the script:
25+
```
26+
$ ./delete-weblogic-domain-resources.sh -h
27+
```

0 commit comments

Comments
 (0)