Home / Keptn v1 Docs / Release 0.15.x / Automated Operations / Remediation Config
The remediation config describes a remediation workflow in a declarative manner. Hence, it only defines what needs to be done and leaves all the details to other components.
The definition of a remediation sequence is done in a so-called Shipyard file.
Example: Simple shipyard file with a remediation sequence in a single stage
apiVersion: "spec.keptn.sh/0.2.3"
kind: "Shipyard"
metadata:
name: "shipyard-sockshop"
spec:
stages:
- name: "production"
sequences:
- name: "remediation"
triggeredOn:
- event: "production.remediation.finished"
selector:
match:
evaluation.result: "fail"
tasks:
- name: "get-action"
- name: "action"
- name: "evaluation"
triggeredAfter: "10m"
properties:
timeframe: "10m"
Note: Remediations can also be used in combination with multi stage delivery workflows.
Below is an example of a declarative remediation config:
Example of a remediation configuration:
apiVersion: spec.keptn.sh/0.1.4
kind: Remediation
metadata:
name: serviceXYZ-remediation
spec:
remediations:
- problemType: Response time degradation
actionsOnOpen:
- action: scaling
name: Scaling ReplicaSet by 1
description: Scaling the ReplicaSet of a Kubernetes Deployment by 1
value: "1"
A remediation is configured based on two properties:
The problem type maps a problem to a remediation by a matching problem title.
default
is supported.The below example shows a remediation configured for the problem type Response time degradation and Failure rate increase as well as any unknown problem.
apiVersion: spec.keptn.sh/0.1.4
kind: Remediation
metadata:
name: serviceXYZ-remediation
spec:
remediations:
- problemType: Response time degradation
actionsOnOpen:
- problemType: Failure rate increase
actionsOnOpen:
- problemType: default
actionsOnOpen:
If multiple actions are declared, Keptn sends out events in sequential order. Given the below example, the event for triggering scaling
is sent out before the event for featuretoggle
is fired.
---
apiVersion: spec.keptn.sh/0.1.4
kind: Remediation
metadata:
name: serviceXYZ-remediation
spec:
remediations:
- problemType: Response time degradation
actionsOnOpen:
- name: Scaling ReplicaSet by 1
description: Scaling the ReplicaSet of a Kubernetes Deployment by 1
action: scaling
value: "1"
- name: Toogle feature flag
action: featuretoggle
description: Toggle feature flag EnablePromotion from ON to OFF.
value:
EnablePromotion: off
Important: In the following command, the value of resourceUri
must be set to remediation.yaml
.
To add an remediation config to a service, use the keptn add-resource command:
keptn add-resource --project=sockshop --stage=production --service=serviceXYZ --resource=remediation.yaml --resourceUri=remediation.yaml