# Copyright (c) 2021 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: x509-certificate-exporter
  labels:
    app: x509-certificate-exporter
spec:
  selector:
    matchLabels:
      app: x509-certificate-exporter
  replicas: 1
  template:
    metadata:
      labels:
        app: x509-certificate-exporter
    spec:
      restartPolicy: Always
      serviceAccountName: x509-certificate-exporter
      containers:
        - name: x509-certificate-exporter
          securityContext:
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            runAsGroup: 65534
            runAsUser: 65534
          resources:
            limits:
              cpu: 200m
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 20Mi
          image: docker.io/enix/x509-certificate-exporter
          imagePullPolicy: IfNotPresent
          args:
            - --watch-kube-secrets
            - --secret-type=kubernetes.io/tls:tls.crt
            - --port=9793
          ports:
            - name: metrics
              containerPort: 9793
