Skip to content

Commit 3789710

Browse files
committed
OWLS-66101, Site documentation for persistent volumes
1 parent e6995e5 commit 3789710

File tree

2 files changed

+61
-22
lines changed

2 files changed

+61
-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: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
# Persistent Volumes
3+
4+
This guide outlines how to set up a Kubernetes persistent volume (PV) and persistent volume claim (PVC), which can then be used in a domain custom resource as a persistent storage for the WebLogic domain home or log files. A PV and PVC 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 persistent volume.
9+
* 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.
10+
* Make sure that the host directory that will be used as the persistent volume already exists and has the appropriate file permissions set.
11+
12+
# Persistent volume YAML files
13+
14+
For sample YAML templates, please refer to this example.
15+
* [Persistent Volumes example](../kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md)
16+
17+
## Naming conventions
18+
19+
Persistent volumes and claims and their properties are described in YAML files. For each PV, you should create one PV YAML file and one PVC YAML file. In the example above, you will find 2 YAML templates, one for the PV and one for the PVC. The example suggest that you name the PV and PVC [domainUID]-[baseName]-pv and [domainUID]-[baseName]-pvc respectively, where domainUID is the ID of the domain resource to which the generated PV and PVC will be dedicated, and baseName is the base name of the PV and PVC.
20+
21+
## Storage locations
22+
PVs can point to different storage locations, for example NFS server storage or local path. Please read the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) regarding on how to configure this.
23+
24+
# Kubernetes resources
25+
26+
After you have written your YAML files, please use them to create the PV by creating Kubernetes resources using the `kubectl create -f` command.
27+
28+
```
29+
kubectl create -f pv.yaml
30+
kubectl create -f pvc.yaml
31+
32+
```
33+
34+
## Shared versus dedicated PVC
35+
36+
By default, the `domainUID` is left empty in the inputs file so that the generated PV and PVC can be shared by multiple domain resources in the same Kubernetes namespaces.
37+
38+
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`.
39+
40+
# Common problems
41+
42+
This section provides details of common problems that might occur while running the script and how to resolve them.
43+
44+
### Persistent volume provider not configured correctly
45+
46+
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.
47+
48+
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.
49+
50+
# Verify the results
51+
52+
To confirm that the PV and PVC were created, use these commands:
53+
54+
```
55+
kubectl describe pv [PV name]
56+
kubectl describe pvc -n NAMESPACE [PVC name]
57+
```
58+
59+
Replace `NAMESPACE` with the namespace that the PVC was created in.

0 commit comments

Comments
 (0)