keptn-contrib / job-executor-service

Running customizable tasks with Keptn as Kubernetes Jobs
Apache License 2.0
19 stars 12 forks source link

Metadata aware executions #363

Open agardnerIT opened 2 years ago

agardnerIT commented 2 years ago

I know the event filtering is possible, but that's a global setting. It applies to all installed JES instances that are attached to a single control plane.

Is it possible to leverage metadata in triggered events (or some other property) to conditionally execute different JES installs in the same project + service + stage combination?

For example, imagine I have 3 clusters globally all listening for test.triggered in projectA of service1 and environment prod and I wish to only load test on the europe cluster. I might pass in some property like data.test.location and then my JES could filter for:

tasks:
  - name: "Run locust tests"
    jsonpath:
      property: "$.data.test.location"
      match: "europe"
    files:
      - locust/basic.py
      - locust/import.py
      - locust/locust.conf
    image: "locustio/locust"
    cmd:
      - locust
    args:
      - '--config'
      - /keptn/locust/locust.conf
      - '-f'
      - /keptn/locust/basic.py
      - '--host'
      - $(HOST)

image