Skip to content

Commit 713bceb

Browse files
authored
Merge pull request #363 from oracle/add-doc-for-update-domain
Add doc for updating a domain
2 parents a060ae5 + 5b1eb3a commit 713bceb

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,45 @@ The script will remove only domain-related resources which are labeled with the
167167
kubectl -n <Namespace> label <ResourceType> <ResourceName> domainUID=<domainUID>
168168
```
169169

170-
To manually remove the persistent volume claim and the persistent volume, use these commands:
170+
By default, the domain's persistent volume claim and the persistent volume are created by the [Create WebLogic domain](kubernetes/create-weblogic-domain.sh) script, and are removed by the [Delete WebLogic domain resources](kubernetes/delete-weblogic-domain-resources.sh) script. To manually remove the persistent volume claim and the persistent volume, use these commands:
171171

172172
```
173173
kubectl delete pvc PVC-NAME -n NAMESPACE
174174
kubectl delete pv PV-NAME
175175
```
176176

177-
Find the names of the persistent volume claim (represented above as `PVC-NAME`) and the persistent volume (represented as `PV-NAME`) in the domain custom resource YAML file, or if it is not available, check for the `domainUID` in the metadata on the persistent volumes. Replace `NAMESPACE` with the namespace that the operator is running in.
177+
Find the names of the persistent volume claim (represented above as `PVC-NAME`) and the persistent volume (represented as `PV-NAME`) in the domain custom resource YAML file, or if it is not available, check for the `domainUID` in the metadata on the persistent volumes. Replace `NAMESPACE` with the namespace that the domain is running in.
178178

179179
To permanently delete the actual WebLogic domain configuration and domain home, delete the physical volume using the appropriate tools. For example, if the persistent volume used the `HostPath` provider, then delete the corresponding directory on the Kubernetes master.
180180

181+
## Updating a domain
182+
There are times when a running domain needs to be updated with modified properties.
183+
This can be achieved by following the steps below. For convenience of discussion, we assume that the domain is originally created by the following example command, where `/path/to/weblogic-operator-output-directory` is a directory that is created in advance to store the files that are generated by the operator.
184+
185+
```
186+
./create-weblogic-domain.sh \
187+
-i create-domain-job-inputs.yaml \
188+
-o /path/to/weblogic-operator-output-directory
189+
```
190+
191+
* Delete the domain using the [Delete WebLogic domain resources](kubernetes/delete-weblogic-domain-resources.sh) script.
192+
193+
```
194+
./delete-weblogic-domain-resources.sh -d <domainUID>
195+
196+
````
197+
* Delete the contents of the physical volume using the appropriate tools. See the descriptions in the previous section for removing a domain.
198+
* Delete the contents in the `weblogic-domains/<domainUID>` directory under the output directory that is specified when the domain is originally created, which is `/path/to/weblogic-operator-output-directory` in our example.
199+
* Update the create WebLogic domain inputs file `create-domain-job-inputs.yaml`.
200+
* Recreate all resources that are labeled with the `domainUID`, but are not created by the [Create WebLogic domain](kubernetes/create-weblogic-domain.sh) script. One example of such resources is the `secret` for the domain credentials, which often is created manually and may be labeled with `domainUID`. Any resources that are not labeled with the `domainUID` are not affected because they are not deleted by the [Delete WebLogic domain resources](kubernetes/delete-weblogic-domain-resources.sh) script.
201+
* Recreate the domain using the [Create WebLogic domain](kubectles/create-weblogic-domain.sh) script with the updated create WebLogic domain inputs file.
202+
203+
If for some reason the last step fails, then repeat the steps above after deleting the failed create WebLogic domain job, using the following command. The `<output-dir>` is the directory that is specified to the create WebLogic domain script via the `-o` option, which is `/path/to/weblogic-operator-output-directory` in our example if the same command is used to recreate the domain.
204+
205+
```
206+
kubectl delete -f <output-dir>/weblogic-domains/<domainUID>/create-weblogic-domain-job.yaml
207+
```
208+
181209
## Removing the operator
182210
183211
To remove the operator from a Kubernetes cluster, issue the following commands:

0 commit comments

Comments
 (0)