# Copyright 2022 The Kubeflow Authors.
#
# 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: kfp-conformance
  namespace: kf-conformance
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kfp-conformance
  template:
    metadata:
      labels:
        app: kfp-conformance
      annotations:
        proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }'
    spec:
      terminationGracePeriodSeconds: 0
      serviceAccountName: kf-conformance
      containers:
      - name: kfp-conformance
      # TODO: update the image version to 1.0
        image: gcr.io/ml-pipeline/kfp-conformance:0.1
        resources:
          limits:
            memory: "128Mi"
            cpu: "1"
          requests:
            memory: "64Mi"
            cpu: "0.5"
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /var/run/secrets/kubeflow/pipelines
          name: volume-kf-pipeline-token
          readOnly: true
        env:
        - name: KF_PIPELINES_SA_TOKEN_PATH
          value: /var/run/secrets/kubeflow/pipelines/token
        # To enable debug mode, uncomment the env variable ADDITIONAL_FLAGS.
        # - name: ADDITIONAL_FLAGS
        #   value: "-isDebugMode"
      volumes:
      - name: volume-kf-pipeline-token
        projected:
          sources:
            - serviceAccountToken:
                path: token
                expirationSeconds: 7200
                audience: pipelines.kubeflow.org