---
#
# Copyright (C) 2019-2022 vdaas.org vald team <vald@vdaas.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: vald-loadtest
  labels:
    app: vald-loadtest
    app.kubernetes.io/name: vald
    app.kubernetes.io/component: loadtest
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      parallelism: 1
      backoffLimit: 10
      template:
        metadata:
          labels:
            app: vald-loadtest
            app.kubernetes.io/name: vald
            app.kubernetes.io/component: loadtest
        spec:
          containers:
            - name: vald-loadtest
              image: "vdaas/vald-loadtest:nightly"
              imagePullPolicy: Always
              resources:
                limits:
                  cpu: 300m
                  memory: 100Mi
                requests:
                  cpu: 100m
                  memory: 30Mi
              terminationMessagePath: /dev/termination-log
              terminationMessagePolicy: File
              volumeMounts:
                - name: vald-loadtest-config
                  mountPath: /etc/server/
          dnsPolicy: ClusterFirst
          restartPolicy: Never
          volumes:
            - name: vald-loadtest-config
              configMap:
                name: vald-loadtest-config
