apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: url-validator
spec:
  schedule: "*/1 * * * *"
  # Do not allow concurrent runs
  concurrencyPolicy: "Forbid"
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccount: bpg-controller-sa
          serviceAccountName: bpg-controller-sa
          restartPolicy: OnFailure
          containers:
          -
            name: url-validator-controller
            imagePullPolicy: Always
            image: gcr.io/${BPG_GCP_PROJECT_ID}/controller:v0.1-20180425-1754
            env:
            -
              name: BPG_REDIS_WRITE_HOST
              value: "redis-master"
            -
              name: BPG_REDIS_WRITE_PORT
              value: "6379"
            -
              name: BPG_REDIS_READ_HOST
              value: "redis-slave"
            -
              name: BPG_REDIS_READ_PORT
              value: "6379"
            -
              name: DB_HOST
              value: "mysql-server"
            -
              name: DB_PORT
              value: "3306"
            -
              name: BPG_NAMESPACE
              value: "ballerina-playground"
            -
              name: BPG_LAUNCHER_IMAGE_NAME
              value: "gcr.io/${BPG_GCP_PROJECT_ID}/launcher:v0.1-20181210-1757"
            -
              name: BPG_MIN_CONCURRENT_USERS
              value: "10"
            -
              name: BPG_MAX_CONCURRENT_USERS
              value: "40"
            -
              name: BPG_SCALING_STEP_UP
              value: "2"
            -
              name: BPG_SCALING_STEP_DOWN
              value: "1"
            -
              name: BPG_SCALING_FREE_BUFFER
              value: "2"
            -
              name: BGP_NFS_SERVER_IP
              value: "10.142.0.5"
            -
              name: BPG_CONTROLLER_INTERNAL_URL
              value: "bpg-controller-internal"
            -
              name: ROOT_DOMAIN_NAME
              value: "playground.preprod.ballerina.io"
            -
              name: BPG_LAUNCHER_HTTPS_PORT
              value: "8443"
            -
              name: BPG_CONTROLLER_ROLE
              value: "URL_VALIDATOR"
