Deploy using composites in a persistent volume or image

Learn how to deploy Oracle SOA Suite and Oracle Service Bus composite applications artifacts in a Kubernetes persistent volume or in an image to an Oracle SOA Suite environment deployed using a WebLogic Kubernetes Operator.

The deployment methods described in Deploy using JDeveloper and Deploy using Maven and Ant are manual processes. If you have the deployment artifacts (archives) already built, then you can package them either into a Kubernetes persistent volume or in an image and use this automated process to deploy the artifacts to an Oracle SOA Suite domain.

Prepare to use the deploy artifacts script

The sample scripts for deploying artifacts are available at ${WORKDIR}/create-soa-domain/domain-home-on-pv/

You must edit deploy-artifacts-inputs.yaml (or a copy of it) to provide the details of your domain and artifacts. Refer to the configuration parameters below to understand the information that you must provide in this file.

Configuration parameters

The following parameters can be provided in the inputs file.

Parameter Definition Default
adminPort Port number of the Administration Server inside the Kubernetes cluster. 7011
adminServerName Name of the Administration Server. AdminServer
domainUID Unique ID that is used to identify the domain. This ID cannot contain any characters that are not valid in a Kubernetes service name. soainfra
domainType Type of the domain. Mandatory input for Oracle SOA Suite domains. You must provide one of the supported domain type values: soa (deploys artifacts into an Oracle SOA Suite domain), osb (deploys artifacts into an Oracle Service Bus domain), or soaosb (deploys artifacts into both Oracle SOA Suite and Oracle Service Bus domains). soa
soaClusterName Name of the SOA WebLogic Server cluster instance in the domain. By default, the cluster name is soa_cluster. This configuration parameter is applicable only for soa and soaosb domain types. soa_cluster
image SOA Suite Docker image. The artifacts deployment process requires Oracle SOA Suite 12.2.1.4. Refer to Obtain the Oracle SOA Suite Docker image for details on how to obtain or create the image. soasuite:12.2.1.4
imagePullPolicy Oracle SOA Suite Docker image pull policy. Valid values are IfNotPresent, Always, Never. IfNotPresent
imagePullSecretName Name of the Kubernetes secret to access the Docker Store to pull the Oracle SOA Suite Docker image. The presence of the secret will be validated when this parameter is specified.
weblogicCredentialsSecretName Name of the Kubernetes secret for the Administration Server’s user name and password. If not specified, then the value is derived from the domainUID as <domainUID>-weblogic-credentials. soainfra-domain-credentials
namespace Kubernetes namespace in which the domain was created. soans
artifactsSourceType The deploy artifacts source type. Set to PersistentVolume for deploy artifacts available in a persistent volume and Image for deploy artifacts available as an image. Image
persistentVolumeClaimName Name of the persistent volume claim created that hosts the deployment artifacts. If not specified, the value is derived from the domainUID as <domainUID>-deploy-artifacts-pvc. soainfra-deploy-artifacts-pvc
artifactsImage Deploy artifacts image. Required if artifactsSourceType is Image. artifacts:12.2.1.4
artifactsImagePullPolicy Deploy artifacts image pull policy. Valid values are IfNotPresent, Always, Never. IfNotPresent
artifactsImagePullSecretName Name of the Kubernetes secret to access the deploy artifacts image. The presence of the secret will be validated when this parameter is specified.
deployScriptFilesDir Directory on the host machine to locate the required files to deploy artifacts to the Oracle SOA Suite domain, including the script that is specified in the deployScriptName parameter. By default, this directory is set to the relative path deploy. deploy
deployScriptsMountPath Mount path where the deploy artifacts scripts are located inside a pod. The deploy-artifacts.sh script creates a Kubernetes job to run the script (specified by the deployScriptName parameter) in a Kubernetes pod to deploy the artifacts. Files in the deployScriptFilesDir directory are mounted to this location in the pod, so that the Kubernetes pod can use the scripts and supporting files to deploy artifacts. /u01/weblogic
deployScriptName Script that the deploy artifacts script uses to deploy artifacts to the Oracle SOA Suite domain. For Oracle SOA Suite, the script placed in the soa directory is used. For Oracle Service Bus, the script placed in the osb directory is used. The deploy-artifacts.sh script creates a Kubernetes job to run this script to deploy artifacts. The script is located in the in-pod directory that is specified by the deployScriptsMountPath parameter. deploy.sh
soaArtifactsArchivePath Directory inside container where Oracle SOA Suite archives are placed. /u01/sarchives
osbArtifactsArchivePath Directory inside container where Oracle Service Bus archives are placed. /u01/sbarchives

The sample demonstrates how to deploy Oracle SOA Suite composites or Oracle Service Bus applications to an Oracle SOA Suite domain home.

Run the deploy artifacts script

Run the deploy artifacts script, specifying your inputs file and an output directory to store the generated artifacts:

$ ./deploy-artifacts.sh \
  -i deploy-artifacts-inputs.yaml \
  -o <path to output-directory>

The script performs the following steps:

  • Creates a directory for the generated Kubernetes YAML files for the artifacts deployment process if it does not already exist. The path name is <path to output-directory>/weblogic-domains/<domainUID>/<YYYYMMDD-hhmmss>. If the directory already exists, its contents must be removed before running this script.
  • Creates a Kubernetes job that starts a utility Oracle SOA Suite container and run scripts to deploy artifacts provided either in an image or in a persistent volume.
Deploy artifacts from an image
  1. Create an image with artifacts

    a. A sample Dockerfile to create the artifacts in an image is available at $WORKDIR/create-soa-domain/domain-home-on-pv/deploy-docker-file. This expects the Oracle SOA Suite related archives to be available in the soa directory and Oracle Service Bus archives to be available in the osb directory.

    b. Create the soa directory and copy the Oracle SOA Suite archives to be deployed to the directory:

    $ cd $WORKDIR/create-soa-domain/domain-home-on-pv/deploy-docker-file
    $ mkdir soa
    $ cp /path/sca_sampleBPEL.jar soa
    

    c. Create the osb directory and copy the Oracle Service Bus archives to be deployed to the directory:

    $ cd $WORKDIR/create-soa-domain/domain-home-on-pv/deploy-docker-file
    $ mkdir osb
    $ cp /path/simple_sbconfig.jar osb
    

    d. Create the image using build.sh. This script creates the image with default tag 12.2.1.4 (artifacts:12.2.1.4):

    $ cd $WORKDIR/create-soa-domain/domain-home-on-pv/deploy-docker-file
    $ ./build.sh  -h
      Usage: build.sh -t [tag]
      Builds a Docker Image with Oracle SOA/OSB artifacts
      Parameters:
         -h: view usage
         -t: tag for image, default is 12.2.1.4
    
    Click here to see sample output of script with tag 12.2.1.4-v1
  2. Update the image details in deploy-artifacts-inputs.yaml for parameter artifactsImage and invoke deploy-artifacts.sh to perform deployment of artifacts.

    Click here to see sample output of deployment for domainType of soaosb

    Note: When you are running the script for domainType soaosb, a deployment pod is created with two containers, one for Oracle SOA Suite artifacts deployments and another for Oracle Service Bus artifacts deployments. When the deployment completes for one container while other container is still running, the pod status will move from Ready to NotReady. Once both the deployments complete successfully, the status of the pod moves to Completed.

Deploy artifacts from a persistent volume
  1. Copy the artifacts for Oracle SOA Suite to the soa directory and Oracle Service Bus to the osb directory at the share location. For example, with location /share, artifacts for Oracle SOA Suite are in /share/soa and Oracle Service Bus are in /share/osb.

    $ ls /share/soa
    sca_sampleBPEL.jar
    $
    $ ls /share/osb/
    simple_sbconfig.jar
    $
    
  2. Create a PersistentVolume with the sample provided (artifacts-pv.yaml):

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: soainfra-deploy-artifacts-pv
    spec:
      storageClassName: deploy-storage-class
      capacity:
        storage: 10Gi
      accessModes:
        - ReadOnlyMany
      persistentVolumeReclaimPolicy: Retain
      hostPath:
        path: "/share"
    
    $ kubectl apply -f artifacts-pv.yaml
    
  3. Create a PersistentVolumeClaim with the sample provided (artifacts-pvc.yaml):

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: soainfra-deploy-artifacts-pvc
      namespace: soans
    spec:
      storageClassName: deploy-storage-class
      accessModes:
        - ReadOnlyMany
      resources:
        requests:
          storage: 10Gi
    
    $ kubectl apply -f artifacts-pvc.yaml
    
  4. Update the artifactsSourceType to PersistentVolume and provide the name for persistentVolumeClaimName in deploy-artifacts-inputs.yaml.

  5. Invoke deploy-artifacts.sh to deploy artifacts for artifacts present in persistentVolumeClaimName.

    Click here to see sample output of deployment for domainType of soaosb

    Note: When you are running the script for domainType of soaosb, a deployment pod is created with two containers, one for Oracle SOA Suite artifacts deployments and one for Oracle Service Bus artifacts deployments. When the deployment completes for one container while other container is still running, the pod status moves from Ready to NotReady. Once both the deployments successfully complete, the status of the pod moves to Completed.

Verify the deployment logs

To confirm the deployment of artifacts was successful, verify the output using the kubectl logs command:

Note: Replace <YYYYMMDD-hhmmss>, <domainUID> and <namespace> with values for your environment.

For Oracle SOA Suite artifacts:

$ kubectl logs job.batch/<domainUID>-deploy-artifacts-job-<YYYYMMDD-hhmmss> -n <namespace>  soa-deploy-artifacts-job

For Oracle Service Bus artifacts:

$ kubectl logs job.batch/<domainUID>-deploy-artifacts-job-<YYYYMMDD-hhmmss> -n <namespace>  osb-deploy-artifacts-job