apiVersion: apps/v1
kind: Deployment
metadata:
  name: snmp-exporter
  namespace: monitoring
  labels:
    app.kubernetes.io/name: snmp-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: snmp-exporter
  template:
    metadata:
      labels:
        app.kubernetes.io/name: snmp-exporter
    spec:
      containers:
        - name: snmp-exporter
          image: "prom/snmp-exporter:v0.17.0"
          securityContext:
            runAsNonRoot: true
            runAsUser: 1000
          args:
            - "--config.file=/config/snmp.yml"
          securityContext:
            readOnlyRootFilesystem: true
          resources:
            limits:
              cpu: 250m
              memory: 64Mi
            requests:
              cpu: 50m
              memory: 64Mi
          ports:
            - containerPort: 9116
              name: http
          livenessProbe:
            httpGet:
              path: /health
              port: http
          readinessProbe:
            httpGet:
              path: /health
              port: http
          volumeMounts:
            - mountPath: /config
              name: snmp-exporter-config
        - name: configmap-reload
          image: "jimmidyson/configmap-reload:v0.3.0"
          args:
            - --volume-dir=/etc/config
            - --webhook-url=http://localhost:9116/-/reload
          resources:
            limits:
              cpu: 100m
              memory: 16Mi
            requests:
              cpu: 10m
              memory: 16Mi
          volumeMounts:
            - mountPath: /etc/config
              name: snmp-exporter-config
              readOnly: true
      volumes:
        - name: snmp-exporter-config
          configMap:
            name: snmp-exporter-config
