---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: operator
  namespace: system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: $(OPERATOR_NAME)
  template:
    metadata:
      labels:
        app: $(OPERATOR_NAME)
    spec:
      serviceAccountName: operator
      containers:
      - image: operator
        name: events-operator
        args:
          - --config-reloader-image=jimmidyson/configmap-reload:v0.3.0
        env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        resources: {}
#          limits:
#            cpu: 200m
#            memory: 200Mi
#          requests:
#            cpu: 20m
#            memory: 20Mi
        ports:
          - containerPort: 9443
            name: webhook-server
            protocol: TCP
        volumeMounts:
          - mountPath: /tmp/k8s-webhook-server/serving-certs
            name: cert
            readOnly: true
          - mountPath: /etc/localtime
            name: host-time
            readOnly: true
      volumes:
        - name: cert
          secret:
            secretName: admission
        - hostPath:
            path: /etc/localtime
          name: host-time