# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
{{- include "stress-test-addons.deploy-job-template.from-pod" (list . "stress.deploy-example") -}}
{{- define "stress.deploy-example" -}}
metadata:
  labels:
    chaos: "{{ default false .Stress.chaos }}"
spec:
  shareProcessNamespace: true
  containers:
    - name: otel-collector
      image: azsdkengsys.azurecr.io/stress/otelcollector:0.94.0
      imagePullPolicy: Always
      resources:
        limits:
          memory: 500Mi
          cpu: "0.5"
      {{- include "stress-test-addons.container-env" . | nindent 6 }}
    - name: main
      image: {{ .Stress.imageTag }}
      imagePullPolicy: Always
      command: ['bash', '-c']
      args:
        - |
          set -a;
          source $ENV_FILE;
          ./azure-messaging-eventhubs-stress-test batchstresstest --send 10000 -v --useSasCredential;
#          sleep 30;
#          kill `pidof otelcol-contrib`;
      {{- include "stress-test-addons.container-env" . | nindent 6 }}
      resources:
        limits:
          memory: {{.Stress.memory }}
          cpu: "1"
{{- end -}}
