# Copyright 2020 Google LLC
#
# 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
#
#     http://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: apps/v1
kind: Deployment
metadata:
  name: probe-helper
  namespace: cloud-run-events-probe
  labels:
    app: probe-helper
spec:
  replicas: 1
  selector:
    matchLabels:
      app: probe-helper
  template:
    metadata:
      labels:
        app: probe-helper
    spec:
      serviceAccountName: probe-helper
      containers:
        - name: probe-helper
          image: ko://github.com/google/knative-gcp/test/test_images/probe_helper
          env:
            - name: K_SINK
              value: "http://default-brokercell-ingress.cloud-run-events.svc.cluster.local/cloud-run-events-probe/default"
            - name: CLOUDPUBSUBSOURCE_TOPIC_ID
              value: "cloudpubsubsource-topic"
            - name: CLOUDSTORAGESOURCE_BUCKET_ID
              value: "cloudstoragesource-bucket"
            - name: CLOUDSCHEDULERSOURCE_PERIOD
              value: "90s"
            - name: PROBE_PORT
              value: "8070"
            - name: RECEIVER_PORT
              value: "8080"
            - name: TIMEOUT_DURATION
              value: "30m"
            - name: HEALTH_CHECKER_PORT
              value: "8060"
            - name: MAX_STALE_DURATION
              value: "5m"
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 8060
            initialDelaySeconds: 5
            periodSeconds: 125
            successThreshold: 1
            timeoutSeconds: 10
