apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: flagger-loadtester
  name: flagger-loadtester
  namespace: demo
spec:
  selector:
    matchLabels:
      app: flagger-loadtester
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
        # exclude ingress ports from App Mesh
        appmesh.k8s.aws/ports: "444"
      labels:
        app: flagger-loadtester
    spec:
      containers:
        - command:
            - ./loadtester
            - -port=8080
            - -log-level=info
            - -timeout=1h
          image: weaveworks/flagger-loadtester:0.13.0
          imagePullPolicy: IfNotPresent
          livenessProbe:
            exec:
              command:
                - wget
                - --quiet
                - --tries=1
                - --timeout=4
                - --spider
                - http://localhost:8080/healthz
            timeoutSeconds: 5
          name: tester
          ports:
            - containerPort: 8080
              name: http
          readinessProbe:
            exec:
              command:
                - wget
                - --quiet
                - --tries=1
                - --timeout=4
                - --spider
                - http://localhost:8080/healthz
            timeoutSeconds: 5
          resources:
            limits:
              cpu: 1000m
              memory: 512Mi
            requests:
              cpu: 10m
              memory: 32Mi
          securityContext:
            readOnlyRootFilesystem: true
            runAsUser: 10001
