From 0398fed5870052e5f8a595fb50c500d748d59633 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Thu, 25 Apr 2024 15:21:00 +0800 Subject: [PATCH] udpate add mongo-exporter --- prod-upgrade/prom/mongo-exporter.yaml | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 prod-upgrade/prom/mongo-exporter.yaml diff --git a/prod-upgrade/prom/mongo-exporter.yaml b/prod-upgrade/prom/mongo-exporter.yaml new file mode 100644 index 0000000..c640783 --- /dev/null +++ b/prod-upgrade/prom/mongo-exporter.yaml @@ -0,0 +1,59 @@ +--- +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:27107,mongo-rs0-1.mongo-rs0.base.svc:27107,mongo-rs0-2.mongo-rs0.base.svc:27107/admin," + - "--mongodb.global-conn-pool" + - "--discovering-mode" + - "--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: 9104 + targetPort: 9104 + selector: + app: mongo-exporter \ No newline at end of file