apiVersion: apps/v1
kind: Deployment
metadata:
  name: fluentd-sidecar-injector
  labels:
    app: fluentd-sidecar-injector
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fluentd-sidecar-injector
  template:
    metadata:
      labels:
        app: fluentd-sidecar-injector
    spec:
      containers:
        - name: fluentd-sidecar-injector
          image: h3poteto/fluentd-sidecar-injector:latest
          imagePullPolicy: Always
          args:
            - ./fluentd-sidecar-injector
            - server
            - --tls-cert-file=/etc/webhook/certs/cert.pem
            - --tls-key-file=/etc/webhook/certs/key.pem
          env:
          # These parameters can be overrided by Pod's annotations.
            - name: FLUENTD_DOCKER_IMAGE
              value: h3poteto/fluentd-forward:latest
          volumeMounts:
            - name: webhook-certs
              mountPath: /etc/webhook/certs
              readOnly: true
          resources:
            requests:
              memory: 200Mi
              cpu: 100m
            limits:
              memory: 1000Mi
      volumes:
        - name: webhook-certs
          secret:
            secretName: fluentd-sidecar-injector-certs
