apiVersion: apps/v1
kind: Deployment
metadata:
  name: pod-mutating-webhook
  labels:
    app: pod-mutating-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pod-mutating-webhook
  template:
    metadata:
      labels:
        app: pod-mutating-webhook
    spec:
      containers:
        - name: pod-mutating-webhook
          image: dsyer/pod-mutating-webhook:v1
          imagePullPolicy: Always
          args:
            - -webhookCfgFile=/etc/webhook/config/webhookconfig.yaml
            - -tlsCertFile=/etc/webhook/certs/cert.pem
            - -tlsKeyFile=/etc/webhook/certs/key.pem
            - -alsologtostderr
            - -v=4
            - 2>&1
          volumeMounts:
            - name: webhook-certs
              mountPath: /etc/webhook/certs
              readOnly: true
            - name: webhook-config
              mountPath: /etc/webhook/config
      volumes:
        - name: webhook-certs
          secret:
            secretName: webhook-certs
        - name: webhook-config
          configMap:
            name: webhook-configmap
