Build and Deploy

Get a insight how the solution gets tested, built and deployed and the configuration option of the pipeline.

OpenShift Pipelines (based on tekton) is used as technology for Solution Pipelines. The k5-project-operator will deploy the Pipeline Manager and create the needed Pipeline definitions in a new envoy during creating or updating the envoy. The Pipeline Manager running in the envoy is used by the Solution Designer for creating new Solution Pipelines and trigger them. If a new Solution Pipeline is created the Pipeline Manager creates a new Pipeline and additional needed Pipeline Resources to run the Pipeline for a specific solution. The Solution Pipeline will create all needed files, docker images, helm charts to deploy, test and run a solution into the Envoy. Every Solution Pipeline is responsible for deploying one solution into its Envoy.

Types of Pipelines

There are two types of Pipelines:

Build and Deploy Pipeline

The Build and Deploy Pipeline will first compile and build the solution (docker images and helm chart) from the configured git source and then deploy the solution into the Envoy.

Deploy Pipeline

The Deploy Pipeline uses an already existing image created in an earlier stage and deploys it to its Envoy. That means that one or more Deploy Pipelines can use the result of a Build and Deploy Pipeline or an another upstream Deploy Pipeline.

Enable Deploy Pipeline to get images from an upstream Solution Envoy

For enabling a Deploy Pipeline (e.g. test-envoy) to get and use the created solution images from another Solution Envoy (e.g. dev-envoy) (project) the used service account (pipline)

for running the pipelines needs permissions for pulling imagestreams from the upstream Solution Envoy (where the Build and Deploy Pipeline is configured). The following templates can be used for that:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pipeline-get-imagestreams
  namespace: dev-envoy
rules:
- apiGroups:
  - ""
  - image.openshift.io
  resources:
  - imagestreams
  - imagestreams/layers
  verbs:
  - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: 
  name: pipeline-get-imagestreams
  namespace: dev-envoy
roleRef: 
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: pipeline-get-imagestreams
subjects: 
- kind: ServiceAccount
  name: pipeline
  namespace: test-envoy
        

General information

The creation, triggering and deletion of a new Pipeline can be done in the Solution Desinger. The creation of a new Pipeline will also trigger the first execution/run of the Pipeline. All created Pipelines can then be retriggered in the Solution Desinger manually. Use the 'Run' button in the Overview CI/CD page in the Solution Designer to start a (build and) deployment of your solution.

Important:

Please do not create, run or retrigger a Solution Pipeline using the OpenShift Console (Developer view -> Pipelines). Only the Solution Designer should be used for that.