apiVersion: apps/v1
kind: Deployment
metadata:
  name: vpc-admission-webhook
  namespace: kube-system
  labels:
    app: vpc-admission-webhook
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: vpc-admission-webhook
  template:
    metadata:
      labels:
        app: vpc-admission-webhook
    spec:
      containers:
        - name: vpc-admission-webhook
          args:
            - -tlsCertFile=/etc/webhook/certs/cert.pem
            - -tlsKeyFile=/etc/webhook/certs/key.pem
            - -OSLabelSelectorOverride=windows
            - -alsologtostderr
            - -v=4
            - 2>&1
          image: '%s.dkr.ecr.%s.%s/eks/vpc-admission-webhook:v0.2.6'
          imagePullPolicy: Always
          volumeMounts:
            - name: webhook-certs
              mountPath: /etc/webhook/certs
              readOnly: true
      hostNetwork: true
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: beta.kubernetes.io/os
                operator: In
                values:
                - linux
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - amd64
            - matchExpressions:
              - key: kubernetes.io/os
                operator: In
                values:
                - linux
              - key: kubernetes.io/arch
                operator: In
                values:
                - amd64
      volumes:
        - name: webhook-certs
          secret:
            secretName: vpc-admission-webhook-certs
