--- apiVersion: apps/v1 kind: Deployment metadata: name: mongo-exporter spec: replicas: 1 selector: matchLabels: app: mongo-exporter template: metadata: labels: app: mongo-exporter spec: containers: - name: mongo-exporter image: percona/mongodb_exporter:0.40 imagePullPolicy: Always args: - '--mongodb.uri=mongodb://mongo_monitor:beaconfire123@mongo-rs0-0.mongo-rs0.base.svc:27017/admin,mongodb://mongo_monitor:beaconfire123@mongo-rs0-1.mongo-rs0.base.svc:27017/admin,mongodb://mongo_monitor:beaconfire123@mongo-rs0-2.mongo-rs0.base.svc:27017/admin' - '--mongodb.global-conn-pool' - '--collector.replicasetstatus' - '--collector.dbstats' - '--collector.profile' resources: requests: cpu: 0.01 memory: 128Mi limits: cpu: 0.1 memory: 512Mi affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: "app.kubernetes.io/component" operator: In values: - mongo tolerations: - key: "app.kubernetes.io/component" operator: "Equal" value: "mongo" effect: "NoSchedule" --- apiVersion: v1 kind: Service metadata: name: mongo-exporter spec: type: ClusterIP ports: - name: http protocol: TCP port: 9216 targetPort: 9216 selector: app: mongo-exporter