You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/site/content/managing-domains/domain-on-pv/usage.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -405,7 +405,7 @@ in the directory specified in `domain.spec.domainHome`, and the application dire
405
405
406
406
1. If the underlying storage volume is dynamically allocated, then delete the PVC with `ReclaimPolcy: delete` and recreate the PVC.
407
407
2. Attach a pod to the shared volume and then access the pod to remove the contents. See the sample script,
408
-
[Domain on PV helper script](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/kubernetes/samples/scripts/domain-lifecycle/domain-on-pv-helper.sh).
408
+
[PV and PVC helper script](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/kubernetes/samples/scripts/domain-lifecycle/pv-pvc-helper.sh).
Copy file name to clipboardExpand all lines: documentation/site/content/managing-domains/persistent-storage/oci-fss-pv.md
+48-70Lines changed: 48 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,90 +11,68 @@ an update to properly initialize the file ownership on the persistent volume
11
11
when the domain is initially created."
12
12
---
13
13
14
+
Refer to the OCI documentation for [setting up storage for kubernetes clusters](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingpersistentvolumeclaim.htm) for details.
15
+
16
+
For provisioning PVCs on the OCI File Storage Service, refer to the documentation [here](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingpersistentvolumeclaim_Provisioning_PVCs_on_FSS.htm#Provisioning_Persistent_Volume_Claims_on_the_FileStorageService).
17
+
14
18
If you are running your Kubernetes cluster on Oracle Container Engine
15
19
for Kubernetes (commonly known as OKE), and you use Oracle Cloud Infrastructure File Storage (FSS)
16
-
for persistent volumes to store the WebLogic domain home, then the file system
17
-
handling, as demonstrated in the operator persistent volume sample, will require
18
-
an update to properly initialize the file ownership on the persistent volume
19
-
when the domain is initially created.
20
+
for persistent volumes to store the WebLogic domain home or log files, then the file system
21
+
handling will require an update to properly initialize the file ownership on the persistent volume
22
+
when the domain is initially created.
20
23
21
24
{{% notice note %}}
22
25
File permission handling on persistent volumes can differ between
23
26
cloud providers and even with the underlying storage handling on
24
-
Linux based systems. These instructions provide one option to
25
-
update file ownership used by the standard Oracle images where
26
-
UID `1000` and GID `1000` typically represent the `oracle` or `opc` user.
27
-
For more information on persistent volume handling,
28
-
see [Persistent storage]({{< relref "/managing-domains/persistent-storage/_index.md" >}}).
27
+
Linux based systems.
28
+
The operator will create directories on the PV under the shared mount path.
29
+
These instructions provide one option to update the file ownership and permissions.
29
30
{{% /notice %}}
30
31
31
32
32
-
#### Failure during domain creation with persistent volume sample
33
+
#### Updating the permissions of shared directory on Persistent storage
34
+
The operator provides a utility script `pv-pvc-helper.sh` as part of the lifecycle scripts to change the ownership and permissions of the shared directory on Persistent storage.
33
35
34
-
The existing sample for [creation of a domain home on persistent volume](https://github.com/oracle/weblogic-kubernetes-operator/tree/{{< latestMinorVersion >}}/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv)
35
-
uses a Kubernetes Job to create the domain. The sample uses an
36
-
`initContainers` section to change the file ownership which will
37
-
fail for Oracle Cloud Infrastructure FSS created volumes used with an OKE cluster.
36
+
This script launches a Pod and mounts the specified PVC in the Pod containers at the specified mount path. You can then exec in the Pod and manually change the permissions or ownership.
37
+
38
+
For more details, see the `Examine, change permissions or delete PV contents` section in the [README](https://github.com/oracle/weblogic-kubernetes-operator/tree/{{< latestMinorVersion >}}/kubernetes/samples/scripts/domain-lifecycle/README.md) file for the `pv-pvc-helper.sh` script details.
39
+
40
+
For example, run the following command to create the pod.
38
41
39
-
The Oracle Cloud Infrastructure FSS volume contains some files that are not modifiable thus
40
-
causing the Kubernetes Job to fail. The failure is seen in the
41
-
description of the Kubernetes Job pod:
42
-
```shell
43
-
$ kubectl describe -n domain1-ns pod domain1-create-weblogic-sample-domain-job-wdkvs
**NOTE**: As of December, 2022, Oracle will continue support of WebLogic Server 12.2.1.3, for six months _only_, for PSUs and security patches. CPU images for WebLogic Server 12.2.1.3 will be published in the January, 2023, and April, 2023, CPU cycles.
67
45
68
-
#### Updating the domain on persistent volume sample
69
-
In the following snippet of the [create-domain-job-template.yaml](https://github.com/oracle/weblogic-kubernetes-operator/blob/{{< latestMinorVersion >}}/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-job-template.yaml),
70
-
you can see the updated `command` for the init container:
71
-
```yaml
72
-
apiVersion: batch/v1
73
-
kind: Job
46
+
This will create a pod with following specifications.
After you get a shell to the running pod container, change the directory to `/shared` and you can change the ownership or permissions using appropriate `chown` or `chmod` commands. For example,
title = "Persistent Volumes and Persistent Volume Claims"
3
3
date = 2019-02-23T16:45:09-05:00
4
4
weight = 1
5
5
description = "Use a Kubernetes PersistentVolume (PV) and PersistentVolumeClaim (PVC) to store WebLogic domain homes and log files."
@@ -15,52 +15,18 @@ The following prerequisites must be fulfilled before proceeding with the creatio
15
15
* Make sure that all the servers in the WebLogic domain are able to reach the storage location.
16
16
* Make sure that the host directory that will be used, already exists and has the appropriate file permissions set.
17
17
18
-
### Storage locations
18
+
### Persistent Volume Storage locations
19
19
PersistentVolumes can point to different storage locations, for example NFS servers or a local directory path. For a list of available options, see the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).
20
20
21
21
**Note regarding HostPath**: In a single-node Kubernetes cluster, such as may be used for testing or proof of concept activities, `HOST_PATH` provides the simplest configuration. In a multinode Kubernetes cluster, a `HOST_PATH` that is located on shared storage mounted by all nodes in the Kubernetes cluster is the simplest configuration. If nodes do not have shared storage, then NFS is probably the most widely available option. There are other options listed in the referenced table.
22
22
23
-
The PersistentVolume for the domainmust be created using the appropriate tools before running the script to create the domain. In the simplest case, namely the `HOST_PATH` provider, this means creating a directory on the Kubernetes master and ensuring that it has the correct permissions:
23
+
The operator provides a sample script to create the PersistentVolume and PersistentVolumeClaim for the domain. this script must be executed before creating the domain. Beginning with Operator 4.1.0, for Domain on PV [domain home source type]({{< relref "/managing-domains/choosing-a-model/_index.md" >}}), the operator provides options to create the PV and PVC. See [Domain on PV documentation]({{< relref "/managing-domains/domain-on-pv/_index.md" >}}) for more details.
**Note regarding NFS**: In the current GA version, the Oracle 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 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.
30
-
31
-
#### PersistentVolume GID annotation
32
-
33
-
The `HOST_PATH` directory permissions can be made more secure by using a Kubernetes annotation on the
34
-
PersistentVolume that provides the group identifier (GID) which will be added to pods using the PersistentVolume.
35
-
36
-
For example, if the GID of the directory is `6789`, then the directory can be updated to remove permissions
37
-
other than for the user and group along with the PersistentVolume being annotated with the specified GID:
After the domain is created and servers are running, the group ownership of the PersistentVolume files
47
-
can be updated to the specified GID which will provide read access to the group members. Typically,
48
-
files created from a pod onto the PersistentVolume will have UID `1000` and GID `1000` which is the
49
-
`oracle` user from the WebLogic Server image.
50
-
51
-
An example of updating the group ownership on the PersistentVolume would be as follows:
25
+
#### Persistent Volumes using HostPath approach
26
+
The `HOST_PATH` provider is the simplest case for creating a Persistent Volume. It requires creating a directory on the Kubernetes master and ensuring that it has the correct permissions:
@@ -69,16 +35,7 @@ Persistent volumes and claims are described in YAML files. For each PersistentVo
69
35
70
36
For sample YAML templates, refer to the [PersistentVolumes example]({{< relref "/samples/storage/_index.md" >}}).
71
37
72
-
### Kubernetes resources
73
-
74
-
After you have written your YAML files, use them to create the PersistentVolume by creating Kubernetes resources using the `kubectl create -f` command:
75
-
76
-
```shell
77
-
$ kubectl create -f pv.yaml
78
-
```
79
-
```shell
80
-
$ kubectl create -f pvc.yaml
81
-
```
38
+
For more details, refer to [Kubernetes examples](https://github.com/kubernetes/examples/), and the PV/PVC examples [here](https://github.com/kubernetes/examples/tree/master/staging/volumes).
82
39
83
40
#### Verify the results
84
41
@@ -97,10 +54,7 @@ This section provides details of common problems that might occur while running
97
54
98
55
#### PersistentVolume provider not configured correctly
99
56
100
-
Possibly the most common problem experienced during testing was the incorrect configuration of the PersistentVolume provider. The PersistentVolume 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 PersistentVolume creation will fail.
57
+
Possibly the most common problem experienced during testing was the incorrect configuration of the PersistentVolume provider. The PersistentVolume 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 PersistentVolume creation will fail.
101
58
102
59
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 PersistentVolume must have its permission bits set to 777.
103
60
104
-
#### Further reading
105
-
106
-
* See the blog, [How to run WebLogic clusters on the Oracle Cloud Infrastructure Container Engine for Kubernetes](https://blogs.oracle.com/weblogicserver/how-to-run-weblogic-clusters-on-the-oracle-cloud-infrastructure-container-engine-for-kubernetes).
`kubernetes/samples/scripts/domain-lifecycle/opss-wallet.sh` | Utility script for exporting or importing a JRF domain OPSS wallet file. |
38
38
`kubernetes/samples/scripts/domain-lifecycle/waitForDomain.sh` | Utility script that optionally waits for the pods in a domain to reach their expected `Completed`, `image`, and `ready` state. |
39
-
`kubernetes/samples/scripts/domain-lifecycle/domain-on-pv-helper.sh` | Utility script to examine or clean up the contents of shared directories on the persistent volume. |
39
+
`kubernetes/samples/scripts/domain-lifecycle/pv-pvc-helper.sh` | Utility script to examine or clean up the contents of shared directories on the persistent volume. |
40
40
41
41
#### Ensuring your Kubernetes cluster can access images
Copy file name to clipboardExpand all lines: documentation/site/content/samples/domains/domain-home-on-pv/sample.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -447,14 +447,14 @@ Now that all the sample resources have been deployed, you can invoke the sample
447
447
Follow the cleanup instructions [here]({{< relref "samples/domains/domain-home-on-pv/cleanup.md" >}}) to remove the domain, cluster and other associated resources.
448
448
449
449
Sometimes in production, but most likely in testing environments, you might also want to remove the Domain on PV contents that are generated using this sample.
450
-
You can use the `domain-on-pv-helper.sh` helper script in the domain lifecycle directory for this.
450
+
You can use the `pv-pvc-helper.sh` helper script in the domain lifecycle directory for this.
451
451
The script launches a Kubernetes pod named `pvhelper` using the provided persistent volume claim name and the mount path.
452
452
You can run `kubectl exec` to get a shell to the running pod container and run commands to examine or clean up the
453
453
contents of shared directories on the persistent volume.
454
454
For example:
455
455
```shell
456
456
$ cd /tmp/weblogic-kubernetes-operator/kubernetes/samples/scripts/domain-lifecycle
Use this helper script for examining, changing permissions or deleting the contents of persistent volume (such as domain files or logs) for a WebLogic Domain on PV or Model in Image domain.
285
+
The script launches a a Kubernetes pod named as 'pvhelper' using the provided persistent volume claim name and the mount path.
286
+
You can run the 'kubectl exec' to get a shell to the running pod container and run commands to examine or clean up the contents of shared directories on persistent volume.
287
+
Use 'kubectl delete pvhelper -n <namespace>' command to delete the pod after it's no longer needed.
288
+
289
+
Use the following command for script usage:
290
+
291
+
```
292
+
$ domain-on-pv-helper.sh -h
293
+
```
294
+
295
+
Following is an example command to launch the helper pod with PVC name `sample-domain1-weblogic-sample-pvc` and mount path `/shared`.
0 commit comments