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 start
output contains user login and password needed for logging into the cluster. -
Add the cached
oc
binary 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
-
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
-
Navigate to Home → Projects → Status 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.