apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: mysqld-exporter
    app.kubernetes.io/part-of: monitor
  name: mysqld-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: mysqld-exporter
  template:
    metadata:
      labels:
        app.kubernetes.io/name: mysqld-exporter
        app.kubernetes.io/part-of: monitor
    spec:
      securityContext:
        runAsUser: 65534
      containers:
        - name: mysqld-exporter
          image: prom/mysqld-exporter:v0.12.1
          args:
            - --config.my-cnf=/etc/mysqld-exporter/my.cnf
            - --log.level=info
          ports:
            - containerPort: 9104
          volumeMounts:
            - name: my-cnf
              mountPath: /etc/mysqld-exporter
          resources:
            requests:
              cpu: 50m
              memory: 50Mi
            limits:
              cpu: 50m
              memory: 50Mi
      volumes:
        - name: my-cnf
          secret:
            secretName: mysqld-exporter-my-cnf 
