Skip to content

Commit 97d61ee

Browse files
committed
Merge branch 'cherry-pick-d3420885' into 'release/4.1'
Cherry-pick branch 'update_automation_scripts_and_docs' into 'release/4.1' See merge request weblogic-cloud/weblogic-kubernetes-operator!4453
2 parents ad9f3c0 + 2f24c6e commit 97d61ee

File tree

12 files changed

+1165
-600
lines changed

12 files changed

+1165
-600
lines changed

documentation/site/content/developerguide/documentation.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@ update to the documentation, follow this process:
2222
```
2323

2424
3. Make your documentation updates by editing the source files in
25-
`documentation/<release-version>/content`, for example `documentation/4.0/content`.
25+
`documentation/site/content`.
2626
{{% notice note %}}
27-
Make sure you check in the changes from the `documentation/<release-version>/content` area _only_;
27+
Make sure you check in the changes from the `documentation/site/content` area _only_;
2828
do not build the site and check in the static files.
2929
{{% /notice %}}
3030

3131
4. If you wish to view your changes, you can run the site locally using
3232
these commands. The site will be available on the URL shown here:
3333

3434
```shell
35-
$ cd documentation/<release-version>
35+
$ cd documentation/site
3636
$ hugo server -b http://localhost:1313/weblogic-kubernetes-operator
3737
```
38+
39+
You can also run the `runlocal.sh` script in that directory to start the Hugo server locally.
3840

3941
5. When you are ready to submit your changes, push your branch to `origin`
4042
and submit a pull request. Remember to follow the guidelines in the

documentation/site/content/samples/azure-kubernetes-service/domain-on-pv.md

Lines changed: 171 additions & 173 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
The output from the `create-domain-on-aks.sh` script includes a statement about the Azure resources created by the script. To delete the cluster and free all related resources, simply delete the resource groups. The output will list the resource groups, such as.
22

33
```shell
4-
The following Azure resources have been created:
5-
Resource groups: ejb8191resourcegroup1597641911, MC_ejb8191resourcegroup1597641911_ejb8191akscluster1597641911_eastus
4+
The following Azure Resouces have been created:
5+
Resource groups: wlsresourcegroup6091605169, MC_wlsresourcegroup6091605169_wlsakscluster6091605169_eastus
66
```
77

88
Given the above output, the following Azure CLI commands will delete the resource groups.
99

1010
```shell
11-
$ az group delete --yes --no-wait --name ejb8191resourcegroup1597641911
12-
$ az group delete --yes --no-wait --name MC_ejb8191resourcegroup1597641911_ejb8191akscluster1597641911_eastus
13-
```
11+
$ az group delete --yes --no-wait --name wlsresourcegroup6091605169
12+
```
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
```shell
22
$ az group delete --yes --no-wait --name $AKS_PERS_RESOURCE_GROUP
3-
$ az group delete --yes --no-wait --name "MC_$AKS_PERS_RESOURCE_GROUP"_"$AKS_CLUSTER_NAME"_"$AKS_PERS_LOCATION"
43
```
54

documentation/site/content/samples/azure-kubernetes-service/includes/create-aks-cluster-body-02.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1+
12
#### Create the AKS cluster
23

34
This sample requires that you disable the AKS addon `http_application_routing` by default. If you want to enable `http_application_routing`, then follow [HTTP application routing](https://docs.microsoft.com/azure/aks/http-application-routing).
45

56
Run the following commands to create the AKS cluster instance.
67

78
```shell
8-
# Change these parameters as needed for your own environment
9-
# Specify a prefix to name resources, only allow lowercase letters and numbers, between 1 and 7 characters
10-
$ export NAME_PREFIX=wls
11-
# Used to generate resource names.
12-
$ export TIMESTAMP=`date +%s`
13-
$ export AKS_CLUSTER_NAME="${NAME_PREFIX}aks${TIMESTAMP}"
14-
$ export AKS_PERS_RESOURCE_GROUP="${NAME_PREFIX}resourcegroup${TIMESTAMP}"
15-
$ export AKS_PERS_LOCATION=eastus
16-
17-
$ az group create --name $AKS_PERS_RESOURCE_GROUP --location $AKS_PERS_LOCATION
9+
1810
$ az aks create \
1911
--resource-group $AKS_PERS_RESOURCE_GROUP \
2012
--name $AKS_CLUSTER_NAME \

documentation/site/content/samples/azure-kubernetes-service/includes/create-aks-cluster-storage.txt

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ You will dynamically create and use a persistent volume with Azure Files NFS sha
2020
| `default-action` | `Deny` | For security, we suggest that you deny access by default and choose to allow access from the AKS cluster network. |
2121

2222
```shell
23-
# Change the value as needed for your own environment
24-
$ export AKS_PERS_STORAGE_ACCOUNT_NAME="${NAME_PREFIX}storage${TIMESTAMP}"
2523

2624
$ az storage account create \
2725
--resource-group $AKS_PERS_RESOURCE_GROUP \
@@ -44,8 +42,7 @@ You will dynamically create and use a persistent volume with Azure Files NFS sha
4442
The following command creates an NFS share with 100GiB:
4543

4644
```shell
47-
# Change value as needed for your own environment
48-
$ export AKS_PERS_SHARE_NAME="${NAME_PREFIX}-weblogic-${TIMESTAMP}"
45+
4946
# Create NFS file share
5047
$ az storage share-rm create \
5148
--resource-group $AKS_PERS_RESOURCE_GROUP \
@@ -184,74 +181,53 @@ You will dynamically create and use a persistent volume with Azure Files NFS sha
184181
]
185182
```
186183

187-
##### Create Storage Class
184+
##### Create SC and PVC
188185

189-
This sample will dynamically create and use a persistent volume with Azure Files in AKS. These features are passed to Kubernetes using YAML files.
190-
191-
The script `kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh` generates the required configuration files automatically, given an input file containing the parameters.
192-
193-
A parameters file is provided at `kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.yaml`. Copy and customize this file for your needs.
194-
195-
To generate YAML files to create Storage Class in the AKS cluster, the following values must be substituted in your copy of the input file.
196-
197-
| Name in YAML file | Example value | Notes |
198-
|-------------------|---------------|-------|
199-
| `namePrefix` | `wls` | Alphanumeric value used as a disambiguation prefix for several Kubernetes resources. Make sure the value matches the value of `${NAME_PREFIX}` to keep names in step-by-step commands the same with those in configuration files. |
200-
201-
Use the following command to generate configuration files, assuming the output directory is `~/azure`. The script will overwrite any files generated by a previous invocation.
202-
203-
```shell
204-
$ cd kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service
205-
$ cp create-domain-on-aks-inputs.yaml my-create-domain-on-aks-inputs.yaml
206-
$ ./create-domain-on-aks.sh -i my-create-domain-on-aks-inputs.yaml -o ~/azure -u ${TIMESTAMP}
207-
```
208-
209-
After running the command, all needed configuration files are generated and output to `~/azure/weblogic-on-aks`:
186+
##### Generated configuration files
187+
Use the below command to generate configuration files.
210188

211189
```shell
212-
The following files were generated:
213-
/home/username/azure/weblogic-on-aks/azure-csi-nfs.yaml
214-
/home/username/azure/weblogic-on-aks/pvc.yaml
215-
/home/username/azure/weblogic-on-aks/admin-lb.yaml
216-
/home/username/azure/weblogic-on-aks/cluster-lb.yaml
217-
/home/username/azure/weblogic-on-aks/domain1.yaml
218-
219-
Completed
220-
```
221-
222-
**NOTE**: Beyond the required and default configurations generated by the command, you can modify the generated YAML files to further customize your deployment. For further information about customizing your deployment, consult the operator documentation, [AKS documentation](https://docs.microsoft.com/azure/aks/), and Kubernetes references.
223-
224-
##### Apply generated configuration files
190+
cat >azure-csi-nfs-${TIMESTAMP}.yaml <<EOF
191+
# Copyright (c) 2018, 2023, Oracle and/or its affiliates.
192+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
225193

226-
To define how an Azure file NFS share is created, we have provided a configuration file `azure-csi-nfs.yaml`. You can find it in your output directory.
227-
228-
The following command displays the YAML content of your current settings. This should be the same with content in `azure-csi-nfs.yaml`. The Storage Class name is `azurefile-csi-nfs`.
229-
230-
This sample uses Azure Files Container Storage Interface (CSI) drivers to manage the NFS file share, provisioner is `file.csi.azure.com`, see the [Azure Files CSI drivers documentation](https://docs.microsoft.com/azure/aks/azure-files-csi).
231-
232-
```shell
233-
cat <<EOF
234194
apiVersion: storage.k8s.io/v1
235195
kind: StorageClass
236196
metadata:
237197
name: azurefile-csi-nfs
238198
provisioner: file.csi.azure.com
239-
allowVolumeExpansion: true
240199
parameters:
241200
protocol: nfs
242-
mountOptions:
243-
- nconnect=4
201+
resourceGroup: ${AKS_PERS_RESOURCE_GROUP}
202+
storageAccount: ${AKS_PERS_STORAGE_ACCOUNT_NAME}
203+
shareName: ${AKS_PERS_SHARE_NAME}
204+
reclaimPolicy: Delete
205+
volumeBindingMode: Immediate
206+
allowVolumeExpansion: true
207+
208+
EOF
209+
210+
cat >pvc-${TIMESTAMP}.yaml <<EOF
211+
apiVersion: v1
212+
kind: PersistentVolumeClaim
213+
metadata:
214+
name: wls-azurefile-${TIMESTAMP}
215+
spec:
216+
accessModes:
217+
- ReadWriteMany
218+
storageClassName: azurefile-csi-nfs
219+
resources:
220+
requests:
221+
storage: 5Gi
222+
244223
EOF
245224
```
246225

247226
Use the `kubectl` command to create the Storage Class and persistent volume claim to the `default` namespace.
248227

249228
```shell
250-
$ kubectl apply -f ~/azure/weblogic-on-aks/azure-csi-nfs.yaml
251-
```
252-
253-
```
254-
persistentvolume/wls-azurefile created
229+
$ kubectl apply -f azure-csi-nfs-${TIMESTAMP}.yaml
230+
$ kubectl apply -f pvc-${TIMESTAMP}.yaml
255231
```
256232

257233
Use the following command to verify:
@@ -260,15 +236,27 @@ Use the following command to verify:
260236
$ kubectl get sc
261237
```
262238

263-
Example output:
239+
Example of `kubectl get sc` output:
264240

265241
```shell
266242
$ kubectl get sc
267243
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
268-
azurefile file.csi.azure.com Delete Immediate true 83s
269-
azurefile-csi file.csi.azure.com Delete Immediate true 83s
270-
azurefile-csi-nfs file.csi.azure.com Delete Immediate true 50s
271-
....
244+
azurefile file.csi.azure.com Delete Immediate true 30m
245+
azurefile-csi file.csi.azure.com Delete Immediate true 30m
246+
azurefile-csi-nfs file.csi.azure.com Delete Immediate true 24m
247+
azurefile-csi-premium file.csi.azure.com Delete Immediate true 30m
248+
azurefile-premium file.csi.azure.com Delete Immediate true 30m
249+
...
250+
```
251+
252+
```shell
253+
$ kubectl get pvc
272254
```
273255

274-
**NOTE**: Carefully inspect the output and verify it matches the above. `ACCESS MODES`, `CLAIM`, and `STORAGECLASS` are vital.
256+
Example of `kubectl get pvc` output:
257+
258+
```shell
259+
$ kubectl get pvc
260+
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
261+
wls-azurefile-1693900684 Bound pvc-1f615766-0f21-4c88-80e1-93c9bdabb3eb 5Gi RWX azurefile-csi-nfs 46s
262+
```

documentation/site/content/samples/azure-kubernetes-service/includes/prerequisites-01.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
This sample assumes the following prerequisite environment.
44

55
* If you don't have an [Azure subscription](https://learn.microsoft.com/en-us/azure/guides/developer/azure-developer-guide#understanding-accounts-subscriptions-and-billing), create a [free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio) before you begin.
6-
* It's recommended that the Azure identity you use to sign in and complete this article has either the [Owner](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#owner) role in the current subscription or the [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) roles in the current subscription.
6+
* It's **strongly** recommended that the Azure identity you use to sign in and complete this article has either the [Owner](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#owner) role in the current subscription or the [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) roles in the current subscription.
77
* If your identity has very limited role assignments, ensure you have the following role assignments in the AKS resource group and AKS node resource group.
88
* [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) role in the resource group that runs AKS cluster. This requires asking a privileged user to assign the roles before creating resource in the resource group.
99
* [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role in the AKS node resource group whose name starts with "MC_". This requires asking a privileged user to assign the role after the AKS instance is created.
1010
* Operating System: GNU/Linux, macOS or [WSL2 for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
11+
* Note: the Docker image creation steps will not work on a Mac with Apple Silicon.
1112
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.25.1.
1213
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.48.1.
1314
* [Docker for Desktop](https://www.docker.com/products/docker-desktop). This document was tested with `Docker version 20.10.7`
1415
* [kubectl](https://kubernetes-io-vnext-staging.netlify.com/docs/tasks/tools/install-kubectl/); use `kubectl version` to test if `kubectl` works. This document was tested with version v1.21.2.
1516
* [Helm](https://helm.sh/docs/intro/install/), version 3.1 and later; use `helm version` to check the `helm` version. This document was tested with version v3.6.2.
1617
* A Java JDK, Version 8 or 11. Azure recommends [Microsoft Build of OpenJDK](https://docs.microsoft.com/java/openjdk/download). Ensure that your `JAVA_HOME` environment variable is set correctly in the shells in which you run the commands.
17-
* A `domain creation image` with the name `wdt-domain-image:WLS-v1`. You can create it by following the [Build the domain creation image]({{< relref "/samples/domains/domain-home-on-pv/build-domain-creation-image#build-the-domain-creation-image" >}}) step.
18+
* A `domain creation image` tagged as `wdt-domain-image:WLS-v1` in your local Docker server's image cache. You can create it by following the [Build the domain creation image]({{< relref "/samples/domains/domain-home-on-pv/build-domain-creation-image#build-the-domain-creation-image" >}}) step.

documentation/site/runlocal.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@
33
# Copyright (c) 2019, 2021, Oracle and/or its affiliates.
44
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55

6+
# `./runlocal.sh <your local port> <your local ip address>` causes the
7+
# site to be available at `http://<your local ip address>:<your local
8+
# port>/weblogic-kubernetes-operator/`. This is useful when running on
9+
# a LAN. `./runlocal.sh` with no arguments continues to operate as
10+
# originally writen. That is, the site is available at
11+
# http://localhost:1313/weblogic-kubernetes-operator/.
12+
613
# 1313 is the hugo default port
714
port=${1:-1313}
15+
host=${2-localhost}
16+
17+
if [[ $host != 'localhost'* ]]; then
18+
bind="--bind $host"
19+
fi
820

9-
hugo server -b http://localhost:$port/weblogic-kubernetes-operator -D -p $port
21+
hugo server $bind --baseURL http://$host:$port/weblogic-kubernetes-operator --buildDrafts -p $port

0 commit comments

Comments
 (0)