apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhook
  namespace: webhook
  labels:
    app: webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webhook
  template:
    metadata:
      labels:
        app: webhook
    spec:
      nodeSelector:
        kubernetes.io/hostname: ${HOST_NAME}
      tolerations:
        - key: "master"
          operator: "Exists"
          effect: "NoSchedule"
      containers:
      - name: webhook
        image: 100.64.176.12:80/webhook:latest
        ports:
        - containerPort: 5000
        command:
          - /bin/bash
          - -c
          - source ./env/bin/activate && python wca/admission_controller/main.py -c /etc/admission-controller/config.yaml && deactivate
        imagePullPolicy: Always
      volumes:
        - name: certs
          secret:
            secretName: webhook-secret
