In this section, you will get an overview of the use-case and learn how to get started setting up a quality gate for your project.
ℹ️ If you are not familiar with the concept of a quality gate, learn more here.
Quality gate result
💡 A quality gate answers one question: Does my service meet all defined quality criteria?
Keptn quality gates help you answer this question by representing a quality gate results like this:
This visualization in the Keptn Bridge allows you to answer the following questions:
Given these requirements, this section defines the entities of a Keptn project, stage, and services using an example. Afterwards, four steps explain how to set up the quality gate, trigger it, and finally see the quality gate evaluation result.
Let’s assume you have an application that is running in an environment and composed of one or multiple services (aka. microservices). For example, you have an application called
easyBooking, which can be broken down into the
payment service. Besides, the application is running in a
quality_assurance environment (aka. stage).
In order to manage your application and services in Keptn, you need a Keptn project, stage and services.
easyBooking application, the Keptn entities of a project, stage, and service map to the example as follows:
service: booking & payment (For the sake of simplicity, a quality gate will be configured for
For defining the stage(s) a service has to go through, a Shipyard file is needed. Since a quality gate should be configured for the quality_assurance environment only, the corresponding Shipyard for the easyBooking project looks as follows:
apiVersion: "spec.keptn.sh/0.2.3" kind: "Shipyard" metadata: name: "shipyard-sockshop" spec: stages: - name: "quality-assurance"
You do not have to define any task sequence in a stage because quality gates (aka.
evaluation) are a built-in Keptn capability. Hence, there is no need to explicitly add an
evaluation sequence. However, the explicit form of the above Shipyard file would look as the following one, which behaves the same way:
apiVersion: "spec.keptn.sh/0.2.3" kind: "Shipyard" metadata: name: "shipyard-sockshop" spec: stages: - name: "quality-assurance" sequences: - name: "evaluation" tasks: - name: "evaluation"
To create the Keptn project
easyBooking, use the keptn create project command.
To create the Keptn service
booking, use the keptn create service command.
Note: It is not needed to create the stage since it is declared in the Shipyard that is applied during the project creation.
To create the Keptn project (e.g.,
easyBooking), use the keptn create project CLI command. Here the Shipyard file is needed, which declares the stages.
To create the Keptn service (e.g.,
booking), use the keptn create service CLI command.
Depending on the monitoring solution you have in place, a corresponding SLI-provider is required by Keptn. This SLI-provider gets its queries for the individual metrics from the Service-Level Indicator (SLI) config.
Familiarize yourself with the concept of an SLI and derive the set of indicators required for, e.g., the
Follow the steps of deploying an SLI-provider and uploading an SLI config as described here.
By adding an Service-Level Objective (SLO) config to your service, you activate a quality gate for that service.
bookingservice, use the keptn add-resource CLI command.
At this point, you have:
✔️ created the project e.g.
easyBooking and the service e.g.
✔️ configured Keptn to use your SLI-provider with custom SLIs
✔️ activated the quality gate for e.g.
booking by providing an SLO
To trigger a quality gate evaluation, execute the keptn trigger evaluation CLI command. This CLI command sends an event to Keptn, which acknowledges receipt of the event by returning a unique ID (
keptn-context). This unique ID is required to fetch the result of the quality gate evaluation.
ℹ️ Learn here more about working with a quality gate and integrating it into an existing pipeline.