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 a namespace for the Oracle WebCenter Content domain

  3. Create the imagePullSecrets

  4. Install the WebLogic Kubernetes Operator

  5. Prepare the environment for Oracle WebCenter Content domain

    a. Upgrade the WebLogic Kubernetes Operator with the Oracle WebCenter Content domain-namespace

    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

  6. 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:

    $ mkdir $HOME/wcc_3.4.2
    $ cd $HOME/wcc_3.4.2
    
  2. Download the WebLogic Kubernetes Operator source code and Oracle WebCenter Content Suite Kubernetes deployment scripts from the WCContent repository. Required artifacts are available at OracleWebCenterContent/kubernetes.

    $ git clone https://github.com/oracle/fmw-kubernetes.git
    $ export WORKDIR=$HOME/wcc_3.4.2/fmw-kubernetes/OracleWebCenterContent/kubernetes
    

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   

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} 
  
$ helm install weblogic-kubernetes-operator charts/weblogic-operator --namespace opns  --set image=phx.ocir.io/xxxxxxxxxxx/oracle/weblogic-kubernetes-operator:3.4.2 --set imagePullSecret=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            3               2022-02-24 06:50:29.810106777 +0000 UTC deployed        weblogic-operator-3.4.2        3.4.2

Prepare the environment for Oracle WebCenter Content domain

Upgrade the WebLogic Kubernetes Operator with the Oracle WebCenter Content domain-namespace

 $ cd ${WORKDIR}
 $ helm upgrade --reuse-values --namespace opns --set "domainNamespaces={wccns}" --wait weblogic-kubernetes-operator 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}/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}/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}/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}/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}/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 \
  --image phx.ocir.io/xxxxxxxxxxx/oracle/wccontent:x.x.x.x \
  --namespace wccns \
  --overrides='{ "apiVersion": "v1", "spec": { "imagePullSecrets": [{"name": "image-secret"}] } }'  \
  -- 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

Note: In the create and drop schema commands above, pass additional components ( -component IPM -component CAPTURE ) if IPM and CAPTURE applications are enabled resepectively.

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.