Skip to content

Commit 964253e

Browse files
authored
Merge pull request #535 from oracle/feature/OWLS-66101
OWLS-66101, Site documentation for persistent volumes
2 parents 1170351 + e6aa250 commit 964253e

File tree

2 files changed

+63
-22
lines changed

2 files changed

+63
-22
lines changed

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

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ A PV and PVC can be shared by multiple WebLogic domains or dedicated to a partic
66

77
## Prerequisites
88

9-
The following prerequisites must be handled prior to running the create script:
10-
* Create a Kubernetes namespace for the persistent volume claim unless the intention is to use the default namespace. Note that a PVC has to be in the same namespace as the domain resource that uses it.
11-
* Make sure that the host directory that will be used as the persistent volume already exists and has the appropriate file permissions set.
9+
Please read this guide before proceeding.
10+
* [Persistent Volumes](../../../../site/persistent-volumes.md)
1211

1312
## Using the scripts to create a PV and PVC
1413

@@ -66,16 +65,6 @@ By default, the `domainUID` is left empty in the inputs file so that the generat
6665

6766
For the use cases where a dedicated PV and PVC is desired for a particular domain, the `domainUID` can be set, which will cause the generated PV and PVC to be associated with the specified `domainUID`. In the per domain PV and PVC case, the names of the generated YAML files and the Kubernetes PV and PVC objects are decorated with the `domainUID`, and the PV and PVC objects are also labeled with the `domainUID`.
6867

69-
## Common problems
70-
71-
This section provides details of common problems that might occur while running the script and how to resolve them.
72-
73-
### Persistent volume provider not configured correctly
74-
75-
Possibly the most common problem experienced during testing was the incorrect configuration of the persistent volume provider. The persistent volume must be accessible to all Kubernetes nodes, and must be able to be mounted as Read/Write/Many. If this is not the case, the PV/PVC creation will fail.
76-
77-
The simplest case is where the `HOST_PATH` provider is used. This can be either with one Kubernetes node, or with the `HOST_PATH` residing in shared storage available at the same location on every node (for example, on an NFS mount). In this case, the path used for the persistent volume must have its permission bits set to 777.
78-
7968
## Verify the results
8069

8170
The create script will verify that the PV and PVC were created, and will report a failure if there was any error. However, it may be desirable to manually verify the PV and PVC, even if just to gain familiarity with the various Kubernetes objects that were created by the script.
@@ -184,15 +173,6 @@ spec:
184173

185174
### Verify the PV and PVC objects
186175

187-
To confirm that the PV and PVC were created, use these commands:
188-
189-
```
190-
kubectl describe pv
191-
kubectl describe pvc -n NAMESPACE
192-
```
193-
194-
Replace `NAMESPACE` with the namespace that the PVC was created in. The output of this command will provide details of the PV, as shown in this example:
195-
196176
```
197177
$ kubectl describe pv weblogic-sample-pv
198178
Name: weblogic-sample-pv

site/persistent-volumes.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
# Persistent Volumes
3+
4+
In this guide, we outline how to set up Kubernetes persistent volume and persistent volume claim which can be used as storage for WebLogic domain homes and log files. A persistent volume can be shared by multiple WebLogic domains or dedicated to a particular domain.
5+
6+
## Prerequisites
7+
8+
The following prerequisites must be fulfilled before proceeding with the creation of the volume.
9+
* Create a Kubernetes namespace for the persistent volume claim unless the intention is to use the default namespace. Note that a persistent volume claim has to be in the same namespace as the domain resource that uses it.
10+
* Make sure that all servers in WLS domain are able to reach the storage location.
11+
* Make sure that the host directory that will be used already exists and has the appropriate file permissions set.
12+
13+
## Storage locations
14+
Persistent volumes can point to different storage locations, for example NFS servers or a local directory path. The list of available options is listed in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).
15+
16+
Note regarding NFS:
17+
In the current GA version, the OCI Container Engine for Kubernetes supports network block storage that can be shared across nodes with access permission RWOnce (meaning that only one can write, others can read only). At this time, the WebLogic on Kubernetes domain created by the WebLogic Server Kubernetes Operator, requires a shared file system to store the WebLogic domain configuration, which MUST be accessible from all the pods across the nodes. As a workaround, you need to install an NFS server on one node and share the file system across all the nodes.
18+
19+
Currently, we recommend that you use NFS version 3.0 for running WebLogic Server on OCI Container Engine for Kubernetes. During certification, we found that when using NFS 4.0, the servers in the WebLogic domain went into a failed state intermittently. Because multiple threads use NFS (default store, diagnostics store, Node Manager, logging, and domain_home), there are issues when accessing the file store. These issues are removed by changing the NFS to version 3.0.
20+
21+
# YAML files
22+
23+
Persistent volumes and claims are described in YAML files. For each persistent volume, you should create one persistent volume YAML file and one persistent volume claim YAML file. In the example below, you will find 2 YAML templates, one for the volume and one for the claim. As stated above, they can either be dedicated to a specific domain, or shared across multiple domains. For the use cases where a volume will be dedicated to a particular domain, it is a best practice to label it with weblogic.domainUID=[domain name]. This makes it easy to search for, and clean up, resources associated with that particular domain.
24+
25+
For sample YAML templates, please refer to this example.
26+
* [Persistent Volumes example](../kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md)
27+
28+
# Kubernetes resources
29+
30+
After you have written your YAML files, please use them to create the persistent volume by creating Kubernetes resources using the `kubectl create -f` command.
31+
32+
```
33+
kubectl create -f pv.yaml
34+
kubectl create -f pvc.yaml
35+
36+
```
37+
38+
# Verify the results
39+
40+
To confirm that the persistent volume was created, use these commands:
41+
42+
```
43+
kubectl describe pv [persistent volume name]
44+
kubectl describe pvc -n NAMESPACE [persistent volume claim name]
45+
46+
```
47+
48+
# Common problems
49+
50+
This section provides details of common problems that might occur while running the script and how to resolve them.
51+
52+
### Persistent volume provider not configured correctly
53+
54+
Possibly the most common problem experienced during testing was the incorrect configuration of the persistent volume provider. The persistent volume must be accessible to all Kubernetes nodes, and must be able to be mounted as Read/Write/Many. If this is not the case, the persistent volume creation will fail.
55+
56+
The simplest case is where the `HOST_PATH` provider is used. This can be either with one Kubernetes node, or with the `HOST_PATH` residing in shared storage available at the same location on every node (for example, on an NFS mount). In this case, the path used for the persistent volume must have its permission bits set to 777.
57+
58+
# Further reading
59+
60+
* https://blogs.oracle.com/weblogicserver/how-to-run-weblogic-clusters-on-the-oracle-cloud-infrastructure-container-engine-for-kubernetes
61+

0 commit comments

Comments
 (0)