About Updating a Domain

Learn about updating a domain with Oracle WebLogic Server for OKE.

Jenkins Pipeline

Oracle WebLogic Server for OKE deploys Jenkins to the Kubernetes cluster along with your domain, and uses Jenkins Pipeline to deploy applications, patches, and update the domain images.

Jenkins Pipeline, also referred to as Pipeline, is a suite of plugins that supports implementation and integration of continuous delivery (CI/CD) pipelines into Jenkins. The definition of the Pipeline is written in a Jenkinsfile, a text file that can be committed to a project's source control repository.

The CI/CD Pipeline uses Oracle WebLogic Deploy Tooling (WDT) and Oracle WebLogic Image Tool (WIT) to update the domain to deploy applications, libraries, and resources; apply JDK and WebLogic Server patches; and update an existing image.

See Oracle WebLogic Server Deploy Tooling and Oracle WebLogic Image Tool.

The images are pushed and pulled within the same regions as deployments using Oracle Cloud Infrastructure Registry (OCIR) service. See Overview of Registry.

The features of Pipeline are:
  • Pipelines can be implemented in code and version controlled.

  • Pipelines can be paused at any stage for user inputs or approval.

  • Pipelines support complex CD requirements that enables forking or joining, looping and executing stages in parallel.

  • Pipelines support domain-specific language (DSL) extension.

Topics:

Pipeline Jobs

Oracle WebLogic Server for OKE has a set of preconfigured jobs to deploy applications and patches.

Table 3-1 Preconfigured Jobs

Job Type Job Name Description
Main update-domain Deploys and undeploys applications, shared libraries and resources such as Java Messaging Service (JMS) and datasources to a domain.
Main sample-app Deploys and undeploys applications and the correponding module Yaml using sample-app.war that is bundled with the Oracle WebLogic Server for OKE solution.
Main jdk-patch Applies a new JDK on the source image.
Main opatch-update Applies OPatches on the source image.
Main rebase-full-install Creates new image from Fusion Middleware installer, JDK installer, and JDK patches. This job reduces the image size but takes long time to execute as it builds the image from scratch and copies to the existing domain over the new image.
Child backup-and-deploy-domain-job

This job is applicable only for Model in Image.

Creates a backup of the Yaml file of the running domain and deploys the changes on the running domain. This job is used by other pipeline jobs and cannot be activated manually.
Child test-and-deploy-domain-job

This job is applicable only for Domain in Image.

Uses the new domain image from OCIR to create a test domain and validates if all pods are in running state, and then deploys the new domain image to the currently running domain. This job is used by other pipeline jobs and cannot be activated manually.

Pipeline Job Stages in Model in Image

The Pipeline jobs go through different stages during build creation. These stages are distinct set of substeps that are performed through the Pipeline. The following section describes the stages of the Pipeline jobs when you are using Model in Image.

To identify a version that uses the Model in Image source type, see the Supported Image column in Patches Included in Oracle WebLogic Server for OKE.

Table 3-2 Stages in Pipeline

Stage Description Applicable to Job Type
PRE-CHECK
  • Checks if the domain is in running state.

  • Checks the status of the introspector pods.

  • Reads the model domain Yaml file and gets the replica count that are created from the running domain.

  • Checks if the pods (replica count +1) are in Ready status.

  • update-domain
  • sample-app
  • jdk-update
  • opatch-update
  • rebase-full-install
BUILD_DOMAIN
  • Runs the Oracle WebLogic Deploy Tooling (WDT) updateDomain.sh command and updates the domain with applications, libraries, and resources.

  • Creates a temporary docker build.

  • Copies the WDT archive zip file, the WDT domain model Yaml file, and Oracle WebLogic Image tool (WIT) to the temp directory.

  • Logs in to OCIR and uses docker build to create a new image.

  • update-domain
  • sample-app
  • jdk-update
  • opatch-update
  • rebase-full-install
OCIR_UPLOAD

Pushes the updated domain image to OCIR.

  • update-domain
  • sample-app
  • jdk-update
  • opatch-update
  • rebase-full-install
APPLY_JDK
  • Uses docker script to apply new patch on top of the existing image.

  • In the first stage, copies JDK bundle to jdk tmp directory and extracts the contents of the jdk tar.gz bundle.

  • In the second stage, it removes contents of existing image from jdk directory, creates a new jdk directory, and copies jdk contents from first stage to jdk directory in second stage.

  • Logs in to OCIR and uses docker build to create a new image.

  • jdk-update
APPLY_WLS_OPATCHES
  • Uses WIT update command to apply WLS OPatch on domain image.

  • Reads the multiple WLS patches provided by user and runs imagetool update command to apply patches.

  • opatch-update

REBASE_FULL_INSTALL
  • Uses the WIT create command to create new image with Fusion Middleware installer, JDK installer, JDK patches, WLS OPatches, and the domain copied from source image.

  • Uses the docker build command to copy the artifacts from the existing image to the new Model in Image.

  • rebase-full-install

DEPLOY_DOMAIN
  • Reads the model domain Yaml file of the running domain and creates a timestamp directory in shared file system under domain directory for backups.

  • Copies the model domain Yaml file of the running domain as prev-domain.yaml.

  • Deletes the running domain and updates the domain Yaml image of the running domain with the new image tag.

  • Copies the new domain Yaml to the backup directory as domain.yaml and applies the new domain image to the currently running domain.

If deployment to the running domain fails or the pods do not come up, then the job rollbacks to the previous working image.

  • backup-and-deploy-domain-job

DOMAIN_VALIDATION
  • Checks if the domain is in running state.

  • Checks the status of the introspector pods.

  • Reads the model domain Yaml file and gets the replica count created for the running domain.

  • Checks if the pods (replica count +1) are in Ready status.

If deployment to the running domain fails or the pods do not come up, then the job rollbacks to the previous working image.

  • backup-and-deploy-domain-job

Pipeline Job Stages in Domain in Image

The Pipeline jobs go through different stages during build creation. These stages are distinct set of substeps that are performed through the Pipeline. The following section describes the stages of the Pipeline jobs when you are using Domain in Image.

To identify a version uses the Domain in Image source type, see the Supported Image column in Patches Included in Oracle WebLogic Server for OKE.

Important:

From Oracle WebLogic Server for OKE release 21.2.2 onwards, Domain in Image is deprecated.

Table 3-3 Stages in Pipeline

Stage Description Appicable to Job Type
PRE-CHECK
  • Checks if the domain is in running state.

  • Reads the model domain Yaml file and gets the replica count that are created from the running domain.

  • Checks if the pods (replica count +1) are in Ready status.

  • update-domain
  • sample-app
  • jdk-update
  • opatch-update
  • rebase-full-install
BUILD_DOMAIN
  • Runs the Oracle WebLogic Deploy Tooling (WDT) updateDomain.sh command and updates the domain with applications, libraries, and resources.

  • Creates a temporary docker build.

  • Copies the WDT archive zip file, the WDT domain model Yaml file, and Oracle WebLogic Image tool (WIT) to the temp directory.

  • Logs in to OCIR and uses docker build to create a new image.

  • update-domain
  • sample-app
  • jdk-update
  • opatch-update
  • rebase-full-install
REBASE

Uses WIT to reduce the image size.

  • update-domain
  • sample-app
OCIR_UPLOAD

Pushes the updated domain image to OCIR.

  • update-domain
  • sample-app
  • jdk-update
  • opatch-update
  • rebase-full-install
APPLY_JDK
  • Uses docker script to apply new patch on top of the existing image.

  • In the first stage, copies JDK bundle to jdk tmp directory and extracts the contents of the jdk tar.gz bundle.

  • In the second stage, it removes contents of existing image from jdk directory, creates a new jdk directory, and copies jdk contents from first stage to jdk directory in second stage.

  • Logs in to OCIR and uses docker build to create a new image.

  • jdk-update

APPLY_WLS_OPATCHES
  • Uses WIT update command to apply WLS OPatch on domain image.

  • Reads the multiple WLS patches provided by user and runs imagetool update command to apply patches.

  • opatch-update

REBASE_FULL_INSTALL

Uses WIT rebase command to create new image with Fusion Middleware installer, JDK installer, JDK patches, WLS OPatches, and the domain copied from source image.

  • rebase-full-install

TEST_DOMAIN

Creates new test domain Yaml and applies the test domain Yaml to the running domain.

  • test-and-deploy-domain

TEST_DOMAIN_VALIDATION

  • Checks if the domain is in running state.

  • Reads the model domain Yaml file of the test domain and gets the replica count that are created from the running domain Yaml.

  • Checks if the pods (replica count +1) are in Ready status.

  • test-and-deploy-domain

DEPLOY_DOMAIN
  • Reads the model domain Yaml file of the running domain and creates a timestamp directory in shared file system under domain directory for backups.

  • Copies the model domain Yaml file of the running domain as prev-domain.yaml.

  • Deletes the running domain and updates the domain Yaml image of the running domain with the new image tag.

  • Copies the new domain Yaml to the backup directory as domain.yaml and applies the new domain image to the currently running domain.

If deployment to the running domain fails or the pods do not come up, then the job rollbacks to the previous working image.

  • test-and-deploy-domain

DOMAIN_VALIDATION
  • Checks if the domain is in running state.

  • Reads the model domain Yaml file and gets the replica count created for the running domain.

  • Checks if the pods (replica count +1) are in Ready status.

If deployment to the running domain fails or the pods do not come up, then the job rollbacks to the previous working image.

  • test-and-deploy-domain

Project Components

Learn about the different tools and files that you can use to build Jenkins projects for your domain.

Oracle WebLogic Server for OKE creates a private load balancer for your domain, which you use to access the Jenkins console running on the Kubernetes cluster. An NGINX ingress controller is used to route traffic from the private load balancer to Jenkins.

All Jenkins files are found on the shared file system.

  • /u01/shared/var/jenkins_home - The Jenkins controller server configuration
  • /u01/shared/scripts/pipeline - The resources used to run the sample Jenkins job, including scripts and metadata files
  • /u01/shared/scripts/pipeline/samples - Sample domain metadata files for deploying applications, applying patches, and so on.

To access or modify these files, use the administration compute instance for your domain. This compute instance also includes the following software:

  • kubectl - Deploy and manage pods in the Kubernetes cluster for this domain.
  • docker - Download, modify and update Docker images in Oracle Cloud Infrastructure Registry. Use the login command to connect to the registry.
  • oci - View, create and update resources in Oracle Cloud Infrastructure.