From db043c5834547e889c5b69b879925b71a380af21 Mon Sep 17 00:00:00 2001 From: Tobias Kurzydym Date: Mon, 13 May 2024 18:07:08 +0200 Subject: [PATCH] feat(deployment): traffic gen as k8s pod --- .../base/observability/create-traffic-pod.yml | 27 +++++++++++++++++++ .../base/observability/kustomization.yaml | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 deployment/base/observability/create-traffic-pod.yml diff --git a/deployment/base/observability/create-traffic-pod.yml b/deployment/base/observability/create-traffic-pod.yml new file mode 100644 index 0000000..183e819 --- /dev/null +++ b/deployment/base/observability/create-traffic-pod.yml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Pod +metadata: + name: traffic-generator + namespace: production +spec: + containers: + - name: traffic-generator + image: curlimages/curl:8.7.1 + command: + - "/bin/sh" + - "-c" + - > + while true; do + curl -sS --location --request PUT 'customer-service:8080/customers/0815/delivery-address' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "city": "26121 Oldenburg (Oldenburg)", + "recipient": "Max Mustermann", + "street": { + "name": "Poststraße", + "number": "1" + } + }' + echo 'PUT request for delivery address finished.' + sleep 0.5 + done \ No newline at end of file diff --git a/deployment/base/observability/kustomization.yaml b/deployment/base/observability/kustomization.yaml index 5f972c6..0e8d2e1 100644 --- a/deployment/base/observability/kustomization.yaml +++ b/deployment/base/observability/kustomization.yaml @@ -5,4 +5,5 @@ resources: - dashboard.yaml - jaeger.yml - opentelemetry-collector.yml - - podmonitor.yaml \ No newline at end of file + - podmonitor.yaml + - create-traffic-pod.yml \ No newline at end of file