apiVersion: apps/v1
kind: Deployment
metadata:
  name: sidecar-injector-webhook-deployment
  labels:
    app: sidecar-injector
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sidecar-injector
  template:
    metadata:
      labels:
        app: sidecar-injector
    spec:
      serviceAccountName: mutator
      containers:
        - name: sidecar-injector
          image: ghcr.io/xphyr/mwhdemo:latest
          imagePullPolicy: Always
          args:
          - -sidecarCfgFile=/etc/webhook/config/sidecarconfig.yaml
          - -tlsCertFile=/etc/webhook/certs/tls.crt
          - -tlsKeyFile=/etc/webhook/certs/tls.key
          - -port=8443
          ports:
          - name: https
            containerPort: 8443
          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: sidecar-injector-webhook-configmap
