apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: "{{ tg_namespace }}"
  name: "kiali-traffic-generator"
  labels:
    kialiScaleMesh: "true"
    app: kiali-traffic-generator
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kiali-traffic-generator
      version: v1
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "{{ tg_sidecar }}"
      labels:
        kialiScaleMesh: "true"
        app: kiali-traffic-generator
        version: v1
    spec:
      containers:
      - image: quay.io/kiali/kiali-test-mesh-traffic-generator:latest
        name: kiali-traffic-generator
        imagePullPolicy: IfNotPresent
        env:
        - name: DURATION
          valueFrom:
            configMapKeyRef:
              name: traffic-generator-config
              key: duration

        - name: ROUTE
          valueFrom:
            configMapKeyRef:
              name: traffic-generator-config
              key: route

        - name: RATE
          valueFrom:
            configMapKeyRef:
              name: traffic-generator-config
              key: rate

        - name: SILENT
          valueFrom:
            configMapKeyRef:
              name: traffic-generator-config
              key: silent
