The Build Service is composed of controllers that create and configure build pipelines. The main input for the Build Service is a Component CR managed by the Konflux UI or created manually via kubectl
.
The Build Service is dependent on the following services:
The Build Service contains these controllers:
Component Build Controller is managed by Component CR changes (creation or update). It’s using Component CR annotations and configuration of the PipelineRuns.
The prerequisite is to have installed GitHub App which is used by the Build Service in the user’s repository, or have gitlab/github secret created for usage via webhook (creating GitLab secrets).
Component Build Controller is working in multiple ways based on a request annotation build.appstudio.openshift.io/request
:
configure-pac
(default when request annotation isn’t set)
configure-pac-no-mr
unconfigure-pac
trigger-pac-build
All those requests first wait for .spec.containerImage
to be set, either manually or
by image-controller via
ImageRepository CR.
PaC provision:
build.appstudio.openshift.io/status
annotation with either error, or state enabled
and merge request link.pac.component.appstudio.openshift.io/finalizer
.build.appstudio.openshift.io/request
annotation.PaC provision without MR creation:
build.appstudio.openshift.io/status
annotation with either error, or state enabled
.pac.component.appstudio.openshift.io/finalizer
.build.appstudio.openshift.io/request
annotation.PaC unprovision:
pac.component.appstudio.openshift.io/finalizer
.build.appstudio.openshift.io/status
annotation with either error, or state disabled
and merge request link.build.appstudio.openshift.io/request
annotation.Trigger PaC build:
$COMPONENT_NAME-on-push
.build.appstudio.openshift.io/status
annotation when error occures.build.appstudio.openshift.io/request
annotation.Available and default pipelines are in the config map present on the cluster in controller’s namespace build pipelines config.
Build pipeline is selected based on build.appstudio.openshift.io/pipeline
annotation,
when annotation is missing, annotation with default pipeline (based on config map) will be added.
Annotation value is json in string eg. '{"name":"docker-build","bundle":"latest"}
.
Name is the name of the pipeline, and the bundle is either latest
which will use the tag from config map
or specific tag for the bundle (used mostly for testing).
When specified pipeline doesn’t exist in config map, it will result with error.
There are a few parameters that are set in PipelineRun created by the Build Service:
''
(evaluated by PaC to git url)''
(evaluated by PaC to git commit SHA)spec.containerImage
,
for push pipeline appended tag :
and for pull pipeline appended tag :on-pr-
IMAGE_TAG_ON_PR_EXPIRATION
spec.source.git.dockerfileUrl
,
default is Dockerfile
spec.source.git.context
Additionally in build pipelines config
pipelines may have specified additional-params
which will be added with default values from pipeline itself.
The purpose of the PaC PipelineRun Pruner Controller is to remove the PipelineRun CRs created for Component CR which is being deleted.
It will remove all PipelineRuns based on appstudio.openshift.io/component
label in PipelineRun.
Monitors push PipelineRuns and based on defined relationships runs renovate, which updates SHA for the image produced by PipelineRun in user’s repository.
Relationships can be set in a Component CR via spec.build-nudges-ref
(list of components to be nudged)
spec.build-nudges-ref
, it will add finalizer to it
build.appstudio.openshift.io/build-nudge-finalizer
.spec.build-nudges-ref
),
updating files with SHA of the image which was built by PipelineRun.build.appstudio.openshift.io/build-nudge-finalizer
finalizer from PipelineRun.Default files which will be nudged are: .*Dockerfile.*, .*.yaml, .*Containerfile.*
.
Users can modify list via:
build.appstudio.openshift.io/build-nudge-files
annotation in push PipelineRun definition.fileMatch
(takes precedence over annotation).