# Copyright (c) 2018 Intel Corporation
#
# 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: net-attach-def-admission-controller-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: net-attach-def-admission-controller
  template:
    metadata:
      labels:
        app: net-attach-def-admission-controller
    spec:
      containers:
      - name: net-attach-def-admission-controller
        image: nfvpe/net-attach-def-admission-controller:snapshot
        command:
        - ./bin/webhook
        args:
        - -bind-address=0.0.0.0
        - -port=443
        - -tls-private-key-file=/etc/webhook/key.pem
        - -tls-cert-file=/etc/webhook/cert.pem
        - -alsologtostderr=true
        - -metrics-listen-address=0.0.0.0:9091
        volumeMounts:
        - name: webhook-certs
          mountPath: /etc/webhook
          readOnly: True
        imagePullPolicy: IfNotPresent
      serviceAccountName: net-attach-def-admission-controller-sa
      volumes:
      - name: webhook-certs
        secret:
          secretName: net-attach-def-admission-controller-secret
