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
-
Create a local CRC virtual machine:
$ crc start
If you use a hosted hypervisor, see the CRC documentation. crc startoutput contains user login and password needed for logging into the cluster. -
Add the cached
ocbinary to your PATH:-
Run the crc oc-env command to print the command needed to add the cached oc binary to your PATH:
$ crc oc-env
-
Run the printed command.
-
-
Log into the OpenShift cluster with the provided login and password:
$ oc login -u <login> -p <password> https://api.crc.testing:6443
-
Create a project for the sample application:
$ oc new-project pipelines-tutorial
-
Run the following command to see the
pipelineservice account:$ oc get serviceaccount pipeline
-
In the OpenShift Web Console switch to the Developer perspective of the OpenShift Web Console.
-
Select the
pipelines-tutorialproject 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. ThePipelineyou create in the next steps builds the simple application which has a frontend and a backend and completes the deployment.