Deploying an application to OpenShift

Prerequisites

  • You have installed OpenShift Pipelines using the OpenShift Pipeline Operator listed in the OpenShift OperatorHub. Once installed, it is applicable to the entire cluster.

  • You have installed the Tekton CLI

  • You have installed CodeReady Containers (CRC) - a recommended solution for quick deployment of OpenShift clusters locally. For more information read the documentation for CRC.

Procedure

  1. Create a local CRC virtual machine:

    $ crc start
    If you use a hosted hypervisor, see the CRC documentation.

    crc start output contains user login and password needed for logging into the cluster.

  2. Add the cached oc binary to your PATH:

    1. Run the crc oc-env command to print the command needed to add the cached oc binary to your PATH:

      $ crc oc-env
    2. Run the printed command.

  3. Log into the OpenShift cluster with the provided login and password:

    $ oc login -u <login> -p <password> https://api.crc.testing:6443
  4. Create a project for the sample application:

    $ oc new-project pipelines-tutorial
  5. Create the Kubernetes objects for deploying the PetClinic application on OpenShift:

    $ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/petclinic/manifests.yaml
  6. Navigate to HomeProjectsStatus in the OpenShift Web Console to verify the deployment. The deployment at this stage is not complete. The Pipeline you create in the next steps builds the container images for the PetClinic application and completes the deployment.

    Initiate deployment