To prepare your Oracle WebCenter Content in Kubernetes environment, complete the following steps:
Set up the code repository to deploy Oracle WebCenter Content domain
Prepare the environment for Oracle WebCenter Content domain
a. Create a namespace for the Oracle WebCenter Content domain
b. Create a persistent storage for the Oracle WebCenter Content domain
c. Create a Kubernetes secret with domain credentials
d. Create a Kubernetes secret with the RCU credentials
e. Configure access to your database
f. Run the Repository Creation Utility to set up your database schemas
If you need help setting up a Kubernetes environment, check the cheat sheet.
The WebLogic Kubernetes Operator uses Helm to create and deploy the necessary resources and then run it in a Kubernetes cluster. For Helm installation and usage information, see here.
Obtain dependent images and add them to your local registry. Dependent images include WebLogic Kubernetes Operator, Traefik. Pull these images and add them to your local registry:
To pull an image from the Oracle Container Registry, in a web browser, navigate to https://container-registry.oracle.com
and log in using the Oracle Single Sign-On authentication service. If you do not already have SSO credentials, at the top of the page, click the Sign In link to create them.
Use the web interface to accept the Oracle Standard Terms and Restrictions for the Oracle software images that you intend to deploy. Your acceptance of these terms are stored in a database that links the software images to your Oracle Single Sign-On login credentials.
Then, pull these docker images and re-tag them:
docker login https://container-registry.oracle.com (enter your Oracle email Id and password)
This step is required once at every node to get access to the Oracle Container Registry.
WebLogic Kubernetes Operator image:
$ docker pull container-registry.oracle.com/middleware/weblogic-kubernetes-operator:3.3.0
$ docker tag container-registry.oracle.com/middleware/weblogic-kubernetes-operator:3.3.0 oracle/weblogic-kubernetes-operator:3.3.0
Pull Traefik Image
$ docker pull traefik:2.2.8
Oracle WebCenter Content domain deployment on Kubernetes leverages the WebLogic Kubernetes Operator infrastructure. To deploy an Oracle WebCenter Content domain, you must set up the deployment scripts.
Create a working directory to set up the source code:
$ export WORKDIR=$HOME/wcc_3.3.0
$ mkdir ${WORKDIR}
Download the supported version of the WebLogic Kubernetes Operator source code from WebLogic Kubernetes Operator github project. Currently the supported WebLogic Kubernetes Operator version is 3.3.0:
$ git clone https://github.com/oracle/weblogic-kubernetes-operator.git --branch v3.3.0
Download the Oracle WebCenter Content Kubernetes deployment scripts from the WCC repository and copy them to the WebLogic Kubernetes Operator samples location:
$ git clone https://github.com/oracle/fmw-kubernetes.git
$ cp -rf ${WORKDIR}/fmw-kubernetes/OracleWebCenterContent/kubernetes/create-wcc-domain ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/
$ cp -rf ${WORKDIR}/fmw-kubernetes/OracleWebCenterContent/kubernetes/ingress-per-domain ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/charts/
$ cp -rf ${WORKDIR}/fmw-kubernetes/OracleWebCenterContent/kubernetes/charts ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/
$ cp -rf ${WORKDIR}/fmw-kubernetes/OracleWebCenterContent/kubernetes/imagetool-scripts ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/
``
The Oracle WebCenter Content image with latest bundle patch and required interim patches can be obtained from My Oracle Support (MOS). This is the only image supported for production deployments. Follow the below steps to download the Oracle WebCenter Content image from My Oracle Support.
Download patch 33771196 from My Oracle Support (MOS).
Unzip the downloaded patch zip file.
For example:
$ unzip p32822360_122140_Linux-x86-64.zip
# sample output
Archive: p32822360_122140_Linux-x86-64.zip
inflating: wccontent-12.2.1.4.0-8-ol7-210507.0906.tar
inflating: README.html
Load the image archive using the docker load
command.
For example:
$ docker load < wccontent-12.2.1.4.0-8-ol7-210507.0906.tar
Run the docker inspect
command to verify that the downloaded image is the latest released image. The value of label com.oracle.weblogic.imagetool.buildid
must match to 29ff0886-a299-4860-9b13-fd6bb80ec354
.
For example:
$ docker inspect --format='{{ index .Config.Labels "com.oracle.weblogic.imagetool.buildid" }}' oracle/wccontent:12.2.1.4.0-8-ol7-210507.0906
29ff0886-a299-4860-9b13-fd6bb80ec354
Alternatively, if you want to build and use Oracle WebCenter Content Container image, using WebLogic Image Tool, with any additional bundle patch or interim patches, then follow these steps to create the image.
Note: The default Oracle WebCenter Content image name used for Oracle WebCenter Content domain deployment is
oracle/wccontent:12.2.1.4.0
. The image created must be tagged asoracle/wccontent:12.2.1.4.0
using thedocker tag
command. If you want to use a different name for the image, make sure to update the new image tag name in thecreate-domain-inputs.yaml
file and also in other instances where theoracle/wccontent:12.2.1.4.0
image name is used.
The WebLogic Kubernetes Operator supports the deployment of Oracle WebCenter Content domain in the Kubernetes environment. Follow the steps in this document to install WebLogic Kubernetes Operator.
Note: Optionally, you can execute these steps to send the contents of the operator’s logs to Elasticsearch.
In the following example commands to install the WebLogic Kubernetes Operator, opns
is the namespace and op-sa
is the service account created for WebLogic Kubernetes Operator:
$ kubectl create namespace opns
$ kubectl create serviceaccount -n opns op-sa
$ cd ${WORKDIR}/weblogic-kubernetes-operator
$ helm install weblogic-kubernetes-operator kubernetes/charts/weblogic-operator --namespace opns --set image=oracle/weblogic-kubernetes-operator:3.3.0 --set serviceAccount=op-sa --set "domainNamespaces={}" --set "javaLoggingLevel=FINE" --wait
Create a Kubernetes namespace (for example, wccns
) for the domain unless you intend to use the default namespace. Use the new namespace in the remaining steps in this section.
For details, see Prepare to run a domain.
$ kubectl create namespace wccns
$ cd ${WORKDIR}/weblogic-kubernetes-operator
$ helm upgrade --reuse-values --namespace opns --set "domainNamespaces={wccns}" --wait weblogic-kubernetes-operator kubernetes/charts/weblogic-operator
In the Kubernetes namespace you created, create the PV and PVC for the domain by running the create-pv-pvc.sh script. Follow the instructions for using the script to create a dedicated PV and PVC for the Oracle WebCenter Content domain.
Review the configuration parameters for PV creation here. Based on your requirements, update the values in the create-pv-pvc-inputs.yaml
file located at ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/
. Sample configuration parameter values for the Oracle WebCenter Content domain are:
baseName
: domaindomainUID
: wccinfranamespace
: wccnsweblogicDomainStorageType
: HOST_PATHweblogicDomainStoragePath
: /net/<your_host_name>/scratch/k8s_dir/wccEnsure that the path for the weblogicDomainStoragePath
property exists (if not, please refer subsection 4 of this document to create it first) and
has full access permissions, and that the folder is empty.
Run the create-pv-pvc.sh
script:
$ cd ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-weblogic-domain-pv-pvc
$ rm -rf output/
$ ./create-pv-pvc.sh -i create-pv-pvc-inputs.yaml -o output
The create-pv-pvc.sh
script will create a subdirectory pv-pvcs
under the given /path/to/output-directory
directory and creates two YAML configuration files for PV and PVC. Apply these two YAML files to create the PV and PVC Kubernetes resources using the kubectl create -f
command:
$ kubectl create -f output/pv-pvcs/wccinfra-domain-pv.yaml -n wccns
$ kubectl create -f output/pv-pvcs/wccinfra-domain-pvc.yaml -n wccns
Get the details of PV and PVC:
$ kubectl describe pv wccinfra-domain-pv
$ kubectl describe pvc wccinfra-domain-pvc -n wccns
Create the Kubernetes secrets username
and password
of the administrative account in the same Kubernetes namespace as the domain:
$ cd ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-weblogic-domain-credentials
$ ./create-weblogic-credentials.sh -u weblogic -p welcome1 -n wccns -d wccinfra -s wccinfra-domain-credentials
For more details, see this document.
You can check the secret with the kubectl get secret
command.
For example:
You also need to create a Kubernetes secret containing the credentials for the database schemas. When you create your domain, it will obtain the RCU credentials from this secret.
Use the provided sample script to create the secret:
$ cd ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-rcu-credentials
$ ./create-rcu-credentials.sh -u weblogic -p welcome1 -a sys -q welcome1 -d wccinfra -n wccns -s wccinfra-rcu-credentials
The parameter values are:
-u
username for schema owner (regular user), required.
-p
password for schema owner (regular user), required.
-a
username for SYSDBA user, required.
-q
password for SYSDBA user, required.
-d
domainUID. Example: wccinfra
-n
namespace. Example: wccns
-s
secretName. Example: wccinfra-rcu-credentials
You can confirm the secret was created as expected with the kubectl get secret
command.
For example:
Run a container to create rcu pod
kubectl run rcu --generator=run-pod/v1 --image oracle/wccontent:12.2.1.4 -n wccns -- sleep infinity
#check the status of rcu pod
kubectl get pods -n wccns
To create the database schemas for Oracle WebCenter Content, run the create-rcu-schema.sh
script.
For example:
# make sure rcu pod status is running before executing this
kubectl exec -n wccns -ti rcu /bin/bash
# DB details
export CONNECTION_STRING=your_db_host:1521/your_db_service
export RCUPREFIX=your_schema_prefix
echo -e welcome1"\n"welcome1> /tmp/pwd.txt
# Create schemas
/u01/oracle/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true -selectDependentsForComponents true -schemaPrefix $RCUPREFIX -component CONTENT -component MDS -component STB -component OPSS -component IAU -component IAU_APPEND -component IAU_VIEWER -component WLS -tablespace USERS -tempTablespace TEMP -f < /tmp/pwd.txt
# Drop schemas
/u01/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX -component CONTENT -component MDS -component STB -component OPSS -component IAU -component IAU_APPEND -component IAU_VIEWER -component WLS -f < /tmp/pwd.txt
#exit from the container
exit
Now that you have your Docker images and you have created your RCU schemas, you are ready to create your domain. To continue, follow the instructions in Create Oracle WebCenter Content domains.