Благодаря подсказке Иван Корюков
Иван Корюков
Вроде разобрался и у меня все завелось.
Если кому-то будет интересно вот мои манифесты
deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-http-deployment
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
labels:
app: http-http
spec:
replicas: 1
selector:
matchLabels:
app: http-http
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
labels:
app: http-http
release: stable
spec:
containers:
- name: http-http
image: stasbigunenko/http_http
env:
- name: PORT_HTTP
value: ":8085"
- name: GRPC
value: "grpc-service:9000"
ports:
- containerPort: 8085
service
apiVersion: v1
kind: Service
metadata:
name: http-monitor-svc
labels:
app: http-http
release: stable
annotations:
prometheus.io/scrape: "true"
prometheus.io/scheme: http
prometheus.io/path: /posts/metrics
prometheus.io/port: "8085"
namespace: default
spec:
ports:
- name: http-http
port: 8085
protocol: TCP
selector:
app: http-http
release: stable
servicemonitor
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: http-monitor
labels:
app: http-http
release: stable
namespace: default
spec:
jobLabel: myCounter
endpoints:
- port: http-http
path: posts/metrics
selector:
matchLabels:
app: http-http
release: stable
namespaceSelector:
matchNames:
- default