Closed exceptorr closed 4 years ago
Ah! I get it now. I changed the advertised-port from from 9090 to 9001 but we didn't actually tell the prometheus process in the container to listen to that port thus the failed liveness and readiness probes. I don't think it's necessary for anyone to change the listen-address of prometheus ever so I'm just going to remove that option in a future PR. There are more important things to deal with lol.
So trying out this branch with:
juju config prometheus external-labels='{ "cluster": "datacenter1" }'
Results in a successful update of the prometheus config file:
$ microk8s.kubectl -n lma exec prometheus-0 -- cat /etc/prometheus/prometheus.yml
global:
external_labels: {cluster: datacenter1}
scrape_interval: 15s
scrape_configs:
- job_name: prometheus
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
Something weird is happening after running
juju config prometheus advertised-port=9001
with this code. From Juju's perspective, everything SEEMS fine as you can see via the logs and juju status below:
I've also seen this, so I filed a https://github.com/relaxdiego/charm-k8s-prometheus/issues/8 issue. However, I am not sure if we really need to change the Prometheus listening port? Although it would be nice to have, I can't imagine the scenario why it might be required in reality.
No we don't need to actually change the advertised port ever. Let's avoid doing that. I'm going to push a PR later hardcoding 9090 and not making it a configuration option. But first, I will review this PR one last time before merging as well as finish #4 before I do that.
Something weird is happening after running
juju config prometheus advertised-port=9001
with this code. From Juju's perspective, everything SEEMS fine as you can see via the logs and juju status below:BUT, when inspecting it from the k8s layer, this is what I get:
Notice that
prometheus-0
READY is 0/1 which means the pod is not ready to receive requests. Running kubectl describe yields the following:Both the Liveness and Readiness probes are failing and true enough, Prometheus is not accessible when I try to browse to it.