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. Run the following command to see the pipeline service account:

    $ oc get serviceaccount pipeline
  6. In the OpenShift Web Console switch to the Developer perspective of the OpenShift Web Console.

  7. Select the pipelines-tutorial project from the Project drop-down menu. On the Topology view of the Developer perspective, you will be able to see the resources of your Pipeline. The deployment at this stage is not complete. The Pipeline you create in the next steps builds the simple application which has a frontend and a backend and completes the deployment.

    Application Deployed