Skip to content

Commit

Permalink
should work
Browse files Browse the repository at this point in the history
Signed-off-by: see-quick <[email protected]>
  • Loading branch information
see-quick committed Feb 12, 2024
1 parent edbe354 commit 1c30111
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
---
- name: Deploy chaos engineering resources for Tekton
- name: Deploy chaos engineering resources for Tekton from Jinja2 templates
kubernetes.core.k8s:
kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}"
namespace: "{{ infra_ci_namespace }}"
state: present
definition: "{{ lookup('file', item) }}"
definition: "{{ lookup('template', item) }}"
verify_ssl: no
apply: true
loop:
- chaos/chaos-trigger.yaml.j2
- chaos/chaos-cron-job.yaml
with_fileglob:
- "templates/tekton/pipelines/chaos/*.j2" # Only match Jinja2 template files
tags:
- chaos

- name: Deploy non-template chaos engineering cron-jobs for Tekton
kubernetes.core.k8s:
kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}"
namespace: "{{ infra_ci_namespace }}"
state: present
definition: "{{ lookup('file', item) }}" # No Jinja2 processing needed
verify_ssl: no
apply: true
with_fileglob:
- "templates/tekton/pipelines/chaos/cron-jobs/*.yaml"
tags:
- chaos
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ spec:
value: "{{ infra_console_url }}/k8s/ns/{{ infra_ci_namespace }}/tekton.dev~v1~PipelineRun/$(context.pipelineRun.name)"
- name: button_text
value: "Pipeline :tekton:"

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
Expand All @@ -117,6 +118,7 @@ spec:
params:
- name: chaosCommand
value: $(body.chaosCommand) # Assuming the payload has a field named 'chaosCommand'

---
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ spec:
- >
curl -X POST
-H 'Content-Type: application/json'
-d '{"chaosCommand": "--pod-chaos anubis-kafka-kill-random-pod --enable-probes"}'
-d '{"chaosCommand": "--pod-chaos "kafka-3-pods-failure" --sut-namespace strimzi-kafka --metrics-selector "anubis-kafka-.*""}'
http://el-chaos-event-listener.tealc-pipelines.svc.cluster.local
restartPolicy: OnFailure

0 comments on commit 1c30111

Please sign in to comment.