Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPrometheus does not reload certificates on config reload #4155
Comments
This comment has been minimized.
This comment has been minimized.
|
Would you mind checking this on master? The code has changed recently. |
This comment has been minimized.
This comment has been minimized.
|
I can not reproduce this |
roidelapluie
closed this
Jun 12, 2018
This comment has been minimized.
This comment has been minimized.
|
(even in 2.0.0 and 2.2.1). I dont know what happened |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the followup. |
brian-brazil
reopened this
Jun 12, 2018
roidelapluie
closed this
Jun 12, 2018
This comment has been minimized.
This comment has been minimized.
|
This is driving me crazy.
|
This comment has been minimized.
This comment has been minimized.
|
Could you be bind mounting files rather than directories? |
roidelapluie
reopened this
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
|
Nope, here it is: When the target is in a static_config in the prometheus.yml, SIGHUP is sufficient. When the target is in a sd_file config, then restart is needed. Reproducible. |
This comment has been minimized.
This comment has been minimized.
|
Now I will try with 2.3.0 |
This comment has been minimized.
This comment has been minimized.
|
Still the case. It looks like we do not re-read the certificates when there is just file_sd in the job. When I add a static_config and a file_sd, certificate is reloaded. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil Could you be bind mounting files rather than directories? What do you mean? We are using plain files, on xfs or ext4 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
No, you want to bind mount directories. Bind mounts are tied to inodes, so if you replace the file with a new one any bind mounts won't get updated. |
This comment has been minimized.
This comment has been minimized.
|
well we do not mount anything really. and we use wildcards for file discovery. |
This comment has been minimized.
This comment has been minimized.
|
When you are changing the files, are you changing the filenames in the config file - or just the ca/keys on disk but with the same filenames? |
This comment has been minimized.
This comment has been minimized.
|
We have that either when we change the CA "in place" OR when we change the CA "in place" and add a new target. |
This comment has been minimized.
This comment has been minimized.
tls_sql-agent_1.yml
|
This comment has been minimized.
This comment has been minimized.
|
So I think this is an interaction with #4214. It only works for static_configs due to a bug in static_configs, which is now fixed by #4245. The code as it stands does not ever reload tls files, they're only loaded when a new target is created. So as it stands if you want to change the CA or cert, you need to change the filename in the config. |
This comment has been minimized.
This comment has been minimized.
|
Thank you @brian-brazil !!! Renaming the CA seems to be a workaround. |
brian-brazil
added
the
not-as-easy-as-it-looks
label
Jun 15, 2018
This comment has been minimized.
This comment has been minimized.
|
NB: we have 100's of jobs who uses the same CA. Might matter for the implementation of the fix. |
This comment has been minimized.
This comment has been minimized.
|
This is more a feature request, and I'm not sure how practical it'll be to implement it as this is unlikely to interact well with reusing http connections across scrapes nor with us avoiding recreating scrape loops on a HUP unless the config file changes. Either it'll end up just working, or you'll always need to change the filename and then HUP. |

roidelapluie commentedMay 11, 2018
Proposal
When rolling out now SSL private keys or keychain, a SIGHUP in not enough to make Prometheus rename the new ones.
Bug Report
What did you do?
Change private key or key chain and SIGHUP prometheus
What did you expect to see?
Prometheus updates private key/keychain
What did you see instead? Under which circumstances?
Prometheus uses the old keys/keychain
Prometheus version:
2.2.1