Skip to content

Commit

Permalink
Upgrade to Keptn 0.8.0
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>
  • Loading branch information
christian-kreuzberger-dtx committed Mar 1, 2021
1 parent 644d449 commit 1bb526a
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 12 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This is an example project for [Keptn](https://keptn.sh) for [Tempberry](https:/

## Prerequesits

* A Kubernetes cluster (version 1.14 or 1.15)
* A working Keptn 0.6.1 installation
* A Kubernetes cluster
* A working Keptn 0.8.0 installation


## Status
Expand All @@ -32,14 +32,19 @@ keptn create project $PROJECT --shipyard=shipyard.yaml

3. Onboard postgres and tempberry-backend
```console
keptn onboard service postgres --project=$PROJECT --chart=./postgres --deployment-strategy=direct
keptn onboard service postgres --project=$PROJECT --chart=./postgres
keptn onboard service tempberry-backend --project=$PROJECT --chart=./tempberry-backend
```

4. Add SLO for hardening and tempberry-backend
```console
keptn add-resource --project=$PROJECT --stage=hardening --service=tempberry-backend --resource=slo.yaml --resourceUri=slo.yaml
```

4. And finally, send new artifacts for postgres and tempberry-backend
```console
keptn send event new-artifact --project=$PROJECT --service=postgres --image=postgres:10.4
keptn send event new-artifact --project=$PROJECT --service=tempberry-backend --image=ckreuzberger/tempberry-backend:0.1
keptn trigger delivery --project=$PROJECT --service=postgres --image=postgres:10.4 --sequence=delivery-direct
keptn trigger delivery --project=$PROJECT --service=tempberry-backend --image=ckreuzberger/tempberry-backend:0.1
```

## Cleanup
Expand Down
86 changes: 79 additions & 7 deletions shipyard.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,82 @@
stages:
apiVersion: "spec.keptn.sh/0.2.0"
kind: "Shipyard"
metadata:
name: "shipyard-tempberry"
spec:
stages:
- name: "dev"
deployment_strategy: "direct"
test_strategy: "functional"
sequences:
- name: "delivery"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "direct"
- name: "test"
properties:
teststrategy: "functional"
- name: "evaluation"
- name: "release"
- name: "delivery-direct"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "direct"
- name: "release"

- name: "hardening"
deployment_strategy: "blue_green_service"
test_strategy: "performance"
sequences:
- name: "delivery"
triggeredOn:
- event: "dev.delivery.finished"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "blue_green_service"
- name: "test"
properties:
teststrategy: "performance"
- name: "evaluation"
- name: "release"
- name: "rollback"
triggeredOn:
- event: "staging.delivery.finished"
selector:
match:
result: "fail"
tasks:
- name: "rollback"
- name: "delivery-direct"
triggeredOn:
- event: "dev.delivery-direct.finished"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "direct"
- name: "release"

- name: "production"
deployment_strategy: "blue_green_service"
remediation_strategy: "automated"
sequences:
- name: "delivery"
triggeredOn:
- event: "hardening.delivery.finished"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "blue_green_service"
- name: "release"
- name: "rollback"
triggeredOn:
- event: "production.delivery.finished"
selector:
match:
result: "fail"
tasks:
- name: "rollback"
- name: "delivery-direct"
triggeredOn:
- event: "hardening.delivery-direct.finished"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "direct"
- name: "release"
21 changes: 21 additions & 0 deletions slo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
spec_version: "1.0"
comparison:
aggregate_function: "avg"
compare_with: "single_result"
include_result_with_score: "pass"
number_of_comparison_results: 1
filter:
objectives:
- sli: "response_time_p95"
pass: # pass if (relative change <= 10% AND absolute value is < 600ms)
- criteria:
- "<=+10%" # relative values require a prefixed sign (plus or minus)
- "<600" # absolute values only require a logical operator
warning: # if the response time is below 800ms, the result should be a warning
- criteria:
- "<=800"
weight: 1
total_score:
pass: "90%"
warning: "75%"

0 comments on commit 1bb526a

Please sign in to comment.