# Copyright 2019 The Knative 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
#
#     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: v1
kind: Service
metadata:
  name: apicoverage-webhook
  namespace: knative-serving
  labels:
    name: apicoverage-webhook
spec:
  type: LoadBalancer
  ports:
  - name: webhook
    protocol: TCP
    port: 443
    targetPort: 443
  selector:
    name: apicoverage-webhook
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: apicoverage-webhook
  namespace: knative-serving
  labels:
    name: apicoverage-webhook
spec:
  replicas: 1
  template:
    metadata:
      name: apicoverage-webhook
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        name: apicoverage-webhook
    spec:
      serviceAccountName: apicoverage-webhook
      containers:
        - name: apicoverage-webhook
          image: knative.dev/serving/test/apicoverage/image
          env:
          - name: SYSTEM_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          resources:
            limits:
              memory: 200Mi
              cpu: 200m
            requests:
              memory: 20Mi
              cpu: 20m
          volumeMounts:
          - name: config-logging
            mountPath: /etc/config-logging
      volumes:
      - name: config-logging
        configMap:
          name: config-logging
