timescale / helm-charts

Configuration and Documentation to run TimescaleDB in your Kubernetes cluster
Apache License 2.0
264 stars 223 forks source link

podmointor in timescaledb-single doesn't match the pods from the statefulset #446

Closed michael-odell closed 1 year ago

michael-odell commented 2 years ago

What happened? The most recent release (0.16.1) moved from serviceMonitor to podMonitors. I know at least with my simple config, it doens't work at all. My simple config had worked when the chart used serviceMonitor -- the only relevant config option I had set was podMonitor.enabled to true.

What I see now is that the postgres exporter that I believe should be seen and noticed by prometheus is not.

Did you expect to see something different?

I expect timescale's postgres exporter to be recognized via the podmonitor by prometheus.

How to reproduce it (as minimally and precisely as possible):

  1. Deploy current version of the chart with podMonitor.enabled set to true in a cluster with kube-prometheus-stack.2.
  2. Look at prometheus / targets and see that the podMonitor is not matching anything, meaning prometheus won't collect metrics. Environment

timescaledb-single

# ref: https://github.com/timescale/timescaledb-kubernetes/blob/master/charts/timescaledb-single/values.yaml

replicaCount: 1

image:
  tag: pg14-latest

prometheus:
  enabled: true

podMonitor:
  enabled: true

# Recommended at https://github.com/timescale/timescaledb-kubernetes/blob/ef8206d6226e008ddc3e96632594dfc4672a97dc/charts/timescaledb-single/values.yaml#L566
podManagementPolicy: Parallel
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.1", GitCommit:"3ddd0f45aa91e2f30c70734b175631bec5b5825a", GitTreeState:"clean", BuildDate:"2022-05-24T12:17:11Z", GoVersion:"go1.18.2", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:15:38Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/arm64"}

microk8s

Anything else we need to know?:

I have a PR that fixes it for me that I'll share shortly.

michael-odell commented 1 year ago

@nhudson I forgot that this bug was open. It's certainly working for me now. Should I close it or leave that to someone from timescale?

nhudson commented 1 year ago

@michael-odell I will close. Thanks!