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 operator uses Helm to create and deploy the necessary resources and then run the operator 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.1.1
$ docker tag container-registry.oracle.com/middleware/weblogic-kubernetes-operator:3.1.1 oracle/weblogic-kubernetes-operator:3.1.1
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.1.1
$ mkdir ${WORKDIR}
Download the supported version of the WebLogic Kubernetes operator source code from the operator github project. Currently the supported operator version is 3.1.1:
$ git clone https://github.com/oracle/weblogic-kubernetes-operator.git --branch release/3.1.1
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 --branch release/21.1.2
$ 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/imagetool-scripts ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/
``
Build Oracle WebCenter Content 12.2.1.4 Image by following step 4 from this document.
If you want to build and use Oracle WebCenter Content Docker image 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 the 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 the 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.1.1 --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, you need to create it),
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.