apiVersion: apps/v1
kind: Deployment
metadata:
  name: p8s-elastic-exporter
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  selector:
    matchLabels:
        app: p8s-elastic-exporter
  template:
    metadata:
      labels:
        app: p8s-elastic-exporter
    spec:
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
      containers:
      - command:
        - /bin/elasticsearch_exporter
        - -es.uri=http://elasticsearch:9200
        - -es.all=true
        - -web.listen-address=:9114
        image: justwatch/elasticsearch_exporter:1.0.2
        securityContext:
          capabilities:
            drop:
            - SETPCAP
            - MKNOD
            - AUDIT_WRITE
            - CHOWN
            - NET_RAW
            - DAC_OVERRIDE
            - FOWNER
            - FSETID
            - KILL
            - SETGID
            - SETUID
            - NET_BIND_SERVICE
            - SYS_CHROOT
            - SETFCAP
          readOnlyRootFilesystem: true
        livenessProbe:
          httpGet:
            path: /health
            port: 9114
          initialDelaySeconds: 30
          timeoutSeconds: 10
        name: p8s-elastic-exporter
        ports:
        - containerPort: 9114
        readinessProbe:
          httpGet:
            path: /health
            port: 9114
          initialDelaySeconds: 10
          timeoutSeconds: 10
        resources:
          limits:
            cpu: 100m
            memory: 128Mi
          requests:
            cpu: 25m
            memory: 64Mi
      restartPolicy: Always
