apiVersion: v1
kind: ConfigMap
metadata:
  name: foobar 
  namespace: default 
data:
  config.yaml: |
    apiVersion: v2
    actions:
      - name: "Run hey"
        events:
          - name: "sh.keptn.event.test.triggered"
        tasks:
          - name: "Run hey load tests"
            image: "azureorkestra/hey"
            cmd: ["hey"]
            args: ["-z", "5m", "http://app.webserver.svc.cluster.local:80/hello"]
            maxPollDuration: 10000
  keptn-config.json: |-
    {
      "url": "http://52.177.239.129/api",
      "namespace": "orkestra",
      "timeframe": "5m",
      "token": {
        "secretRef":  {
          "name": "keptn-api-token",
          "namespace": "orkestra"
        }
      }
    }
  shipyard.yaml: |-
    apiVersion: "spec.keptn.sh/0.2.2"
    kind: "Shipyard"
    metadata:
      name: "shipyard-webserver"
    spec:
      stages:
        - name: "dev"
          sequences:
            - name: "evaluation"
              tasks:
              - name: "test"
                properties:
                  teststrategy: "functional"
              - name: "evaluation"
  sli.yaml: |
    spec_version: "1.0"
    indicators:
      error_percentage: "(sum(rate(webserver_errors{}[$DURATION_SECONDS])) / sum(rate(webserver_requests{}[$DURATION_SECONDS])) * 100) > 0 or on() vector(0)"
      response_time_p99: "histogram_quantile(0.99, rate(webserver_request_duration_seconds_bucket{}[$DURATION_SECONDS])) > 0.02 and rate(webserver_request_duration_seconds_count{}[$DURATION_SECONDS]) > 1 or on() vector(0)"
  slo.yaml: |-
    spec_version: '1.0'
    comparison:
      compare_with: "single_result"
      include_result_with_score: "pass"
      aggregate_function: avg
    objectives:
      - sli: response_time_p99
        pass:
          - criteria:
              - "<0.15"
        warning:
          - criteria:
              - "<=0.05"
      - sli: error_percentage
        pass:
          - criteria:
            - "<10"
        warning:
          - criteria:
            - "<=5"
    total_score:
      pass: "100%"
      warning: "75%"

