Prepare environment for WCC domain

To create your Oracle WebCenter Content domain in Kubernetes OKE environment, complete the following steps:

Contents

  1. Set up the code repository to deploy Oracle WebCenter Content domain

  2. Create the imagePullSecrets

  3. Install the WebLogic Kubernetes Operator

  4. 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. Install and start the Database

    f. Configure access to your database

    g. Run the Repository Creation Utility to set up your database schemas

  5. Create Oracle WebCenter Content domain

Set up the code repository to deploy Oracle WebCenter Content domain

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.

  1. Create a working directory to set up the source code:

    $ export WORKDIR=$HOME/wcc_3.2.5
    $ mkdir ${WORKDIR}
    
  2. Download the supported version of the WebLogic Kubernetes Operator source code from the WebLogic Kubernetes Operator github project. Currently the supported WebLogic Kubernetes Operator version is 3.2.5:

    $ cd ${WORKDIR}
    $ git clone https://github.com/oracle/weblogic-kubernetes-operator.git --branch v3.2.5
    
  3. 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/
    

    ``

Create the imagePullSecrets

Create the imagePullSecrets (in wccns namespace) so that Kubernetes Deployment can pull the image automatically from OCIR.

Note: Create the imagePullSecret as per your environement using a sample command like this -

$ kubectl create secret docker-registry image-secret -n wccns --docker-server=phx.ocir.io  --docker-username=axxxxxxxxxxx/oracleidentitycloudservice/<your_user_name> --docker-password='vUv+xxxxxxxxxxx<KN7z'  --docker-email=me@oracle.com  

The parameter values are:

OCI Region is phoenix phx.ocir.io OCI Tenancy Name axxxxxxxxxxx ImagePullSecret Name image-secret Username and email address me@oracle.com Auth Token Password vUv+xxxxxxxxxxx<KN7z

Install the WebLogic Kubernetes Operator

The WebLogic Kubernetes Operator supports the deployment of Oracle WebCenter Content domain in the Kubernetes environment.

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 WebLogic Kubernetes Operator:

Creating namespace and service account for WebLogic Kubernetes Operator

$ kubectl create namespace opns
$ kubectl create serviceaccount -n opns  op-sa  

Install WebLogic Kubernetes Operator

$ cd ${WORKDIR}/weblogic-kubernetes-operator    
  
$ helm install weblogic-kubernetes-operator kubernetes/charts/weblogic-operator  --namespace opns  --set image=phx.ocir.io/xxxxxxxxxxx/oracle/weblogic-kubernetes-operator:3.2.5 -s image-secret --set serviceAccount=op-sa --set "domainNamespaces={}" --set "javaLoggingLevel=FINE" --wait

Verify the WebLogic Kubernetes Operator pod

$ kubectl get pods -n opns

NAME                                 READY   STATUS    RESTARTS   AGE
weblogic-operator-779965b66c-d8265   1/1     Running   0          11d

# Verify the Operator helm Charts
$ helm list -n opns

NAME                            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                          APP VERSION
weblogic-kubernetes-operator    opns            2               2021-07-30 05:53:47.397122595 +0000 UTC deployed        weblogic-operator-3.2.5        3.2.5

Prepare the environment for Oracle WebCenter Content domain

Create a namespace for the Oracle WebCenter Content domain

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    

Create a persistent storage for the Oracle WebCenter Content domain

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.

Here we will use the NFS Server and mount path, created on this page.

  • 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: domain
    • domainUID: wccinfra
    • namespace: wccns
    • weblogicDomainStorageType:: NFS
    • weblogicDomainStorageNFSServer:: <your_nfs_server_ip>
    • weblogicDomainStoragePath: /<your_dir_name>

    Note: Make sure to update the “weblogicDomainStorageNFSServer:” with the NFS Server IP as per your Environment

  • Ensure that the path for the weblogicDomainStoragePath property exists (if not, please refer subsection 4 of this document to create it first) and has correct 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 a Kubernetes secret with domain credentials

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:

Click here to see the sample secret description.

Create a Kubernetes secret with the RCU credentials

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:

Click here to see the sample secret description.

Install and start the Database

This step is required only when standalone database was not already setup and the user wanted to use the database in a container. The Oracle Database Docker images are supported only for non-production use. For more details, see My Oracle Support note: Oracle Support for Database Running on Docker (Doc ID 2216342.1). For production usecase it is suggested to use a standalone db. Sample provides steps to create the database in a container.

The database in a container can be created with a PV attached for persisting the data or without attaching the PV. In this setup we will be creating database in a container without PV attached.

$ cd ${WORKDIR}/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-oracle-db-service

$ ./start-db-service.sh -i phx.ocir.io/xxxxxxxxxxxx/oracle/database/enterprise:x.x.x.x -s image-secret -n wccns
Click here to see the Sample Output

Once database is created successfully, you can use the database connection string, as an rcuDatabaseURL parameter in the create-domain-inputs.yaml file.

Configure access to your database

Run a container to create rcu pod

kubectl run rcu --generator=run-pod/v1 -p image-secret --image phx.ocir.io/xxxxxxxxxxx/oracle/wccontent:x.x.x.x -s image-secret -n wccns  -- sleep infinity
   
# Check the status of rcu pod
kubectl get pods -n wccns

Run the Repository Creation Utility to set up your database schemas

Create or Drop schemas

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

Create Oracle WebCenter Content domain

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 Step-3 and Step-4.