--- apiVersion: apps/v1 kind: Deployment metadata: labels: name: blackbox-exporter name: blackbox-exporter namespace: monitoring spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 7 selector: matchLabels: app: blackbox-exporter strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: metadata: labels: app: blackbox-exporter spec: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - preference: matchExpressions: - key: prometheus operator: In values: - '1' weight: 100 - preference: matchExpressions: - key: kubernetes.io/os operator: In values: - linux weight: 10 requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: prometheus operator: In values: - '1' - matchExpressions: - key: kubernetes.io/os operator: In values: - linux containers: - name: blackbox-exporter image: registry.cn-hangzhou.aliyuncs.com/zhengyu1992/blackbox-exporter:v0.19.0 #image: harbor.uenpay.com/base/blackbox-exporter:v0.19.0 imagePullPolicy: IfNotPresent ports: - containerPort: 9115 protocol: TCP resources: limits: cpu: '1' memory: 1Gi requests: cpu: 100m memory: 100Mi volumeMounts: - mountPath: /etc/blackbox_exporter name: config readOnly: true restartPolicy: Always securityContext: runAsUser: 0 serviceAccount: prometheus serviceAccountName: prometheus terminationGracePeriodSeconds: 30 volumes: - configMap: defaultMode: 420 name: blackbox-exporter-config name: config tolerations: - key: prometheus effect: NoSchedule operator: Exists --- apiVersion: v1 kind: Service metadata: name: blackbox-exporter namespace: monitoring spec: ports: - port: 9115 protocol: TCP targetPort: 9115 selector: app: blackbox-exporter type: ClusterIP