Prometheus supports multiple roles in its Kubernetes SD config
I'm confused about whether I should use a Pod config or a endpoints role for my Deployment + Service.
The service I am monitoring is a Deployment
apiVersion: apps/v1
kind: Deployment
spec:
replicas: ~10
strategy:
rollingUpdate:
maxSurge: 5
maxUnavailable: 0
type: RollingUpdate
template:
containers:
- name: web-app
ports:
- containerPort: 3182
name: http
- containerPort: 6060
name: metrics
apiVersion: v1
kind: Service
metadata:
name: web-app
spec:
ports:
- name: http
port: 3182
targetPort: http
selector:
app: web-app
type: ClusterIP
The number of pods can vary in the deployment. The deployment is continuously being updated with new images.
I can add annotations or labels as needed to either of these YAML files.
Is there a reason to prefer either a Pod role or an Endpoints role?