Prepare your environment

To prepare your Oracle WebCenter Content in Kubernetes environment, complete the following steps:

  1. Set up your Kubernetes cluster

  2. Install Helm

  3. Pull dependent images

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

  5. Obtain the Oracle WebCenter Content Docker image

  6. Install the WebLogic Kubernetes Operator

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

  8. Create Oracle WebCenter Content domain

Set up your Kubernetes cluster

If you need help setting up a Kubernetes environment, check the cheat sheet.

Install Helm

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.

Pull dependent images

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:

  1. Pull these docker images and re-tag them as shown:

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.4.2
$ docker tag container-registry.oracle.com/middleware/weblogic-kubernetes-operator:3.4.2 oracle/weblogic-kubernetes-operator:3.4.2

Pull Traefik Image

$ docker pull traefik:2.6.0

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 WebCenter Content 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
    

Obtain the Oracle WebCenter Content Docker image

Obtain the Oracle WebCenter Content image using any one of the options.

1 Get Oracle WebCenter Content image from My Oracle Support (MOS)

2 Get Oracle WebCenter Content image from Oracle Container Registry (OCR)

3 Build Oracle WebCenter Content Container image

1. Get Oracle WebCenter Content image from My Oracle Support (MOS):

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.

  1. Download patch 34409720 from My Oracle Support (MOS).

  2. Unzip the downloaded patch zip file.

    For example:

    $ unzip p34409720_122140_Linux-x86-64.zip
    # sample output
    Archive:  p34409720_122140_Linux-x86-64.zip
    inflating: wccontent-12.2.1.4-jdk8-ol7-220721.1014.tar
    inflating: README.html
    
  3. Load the image archive using the docker load command.

    For example:

    $ docker load < wccontent-12.2.1.4-jdk8-ol7-220721.1014.tar
    
    Click here to see sample output
  4. 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 38be8314-7315-4cc8-95a1-0b4970b2b92c.

    For example:

    $ docker inspect --format='{{ index .Config.Labels "com.oracle.weblogic.imagetool.buildid" }}'  oracle/wccontent:12.2.1.4-jdk8-ol7-220721.1014
    38be8314-7315-4cc8-95a1-0b4970b2b92c
    

2. Get Oracle WebCenter Content image from the Oracle Container Registry (OCR):

For first time users, to pull an image from the Oracle Container Registry, navigate to https://container-registry.oracle.com and log in using the Oracle Single Sign-On (SSO) authentication service. If you do not already have SSO credentials, you can create an Oracle Account using: https://profile.oracle.com/myprofile/account/create-account.jspx.

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.

To obtain the image, log in to the Oracle Container Registry:

$ docker login container-registry.oracle.com

Find and then pull the prebuilt Oracle WebCenter Content Suite image 12.2.1.4:

$ docker pull container-registry.oracle.com/middleware/webcenter-content_cpu:12.2.1.4-jdk8-ol7-220721

3. Build Oracle WebCenter Content Container image :

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 as oracle/wccontent:12.2.1.4.0 using the docker tag command. If you want to use a different name for the image, make sure to update the new image tag name in the create-domain-inputs.yaml file and also in other instances where the oracle/wccontent:12.2.1.4.0 image name is used.

Install the WebLogic Kubernetes Operator

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:

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=oracle/weblogic-kubernetes-operator:3.4.2 --set serviceAccount=op-sa --set "domainNamespaces={}" --set "javaLoggingLevel=FINE" --wait  

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}
 $ 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.

  • 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: HOST_PATH
    • weblogicDomainStoragePath: /net/<your_host_name>/scratch/k8s_dir/wcc

    Note: Alternatively, you can use NFS as the value of weblogicDomainStorageType if you choose to use an NFS server for the persistent storage.

  • Ensure that the path for the weblogicDomainStoragePath property exists and have the ownership for 1000:0. If not, you need to create it as follows:

    $ sudo mkdir /scratch/k8s_dir/wcc
    $ sudo chown -R 1000:0 /scratch/k8s_dir/wcc
    
    
  • 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.

Configure access to your database

Run a container to create rcu pod

$ kubectl run rcu --image oracle/wccontent:12.2.1.4 -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
   

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

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 instructions in Create Oracle WebCenter Content domains.