apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubernetes-sidecar-injector-deployment
spec:
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: kubernetes-sidecar-injector
  replicas: 1
  template:
    metadata:
      labels:
        app: kubernetes-sidecar-injector
    spec:
      containers:
        - name: kubernetes-sidecar-injector
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: IfNotPresent
          args:
            - -port=8443
            - -certFile=/opt/kubernetes-sidecar-injector/certs/cert.pem
            - -keyFile=/opt/kubernetes-sidecar-injector/certs/key.pem
            - -sideCar=/opt/kubernetes-sidecar-injector/sidecarconfig.yaml
            - -logtostderr
            - 2>&1
          volumeMounts:
            - name: kubernetes-sidecar-injector-certs
              mountPath: /opt/kubernetes-sidecar-injector/certs
              readOnly: true
            - name: kubernetes-sidecars-configmap
              mountPath: /opt/kubernetes-sidecar-injector
      volumes:
        - name: kubernetes-sidecar-injector-certs
          secret:
            secretName: kubernetes-sidecar-injector-certs
        - name: kubernetes-sidecars-configmap
          configMap:
            name: kubernetes-sidecars-configmap
