-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add postgres exporter sidecar and metrics service #117
Conversation
be9eb76
to
3c93e2b
Compare
debug!("Did not find primary pod is ready"); | ||
let primary_pod = primary_pod.unwrap(); | ||
|
||
if !is_postgres_ready().matches_object(Some(&primary_pod)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we wait just for postgres to be ready, not the whole pod, before creating the postgres exporter role
@@ -45,7 +45,7 @@ impl PsqlCommand { | |||
|
|||
pub async fn execute(&self) -> Result<PsqlOutput, kube::Error> { | |||
let attach_params = AttachParams { | |||
container: None, | |||
container: Some("postgres".to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now we have two containers in the pod, so add the container name to psql into with kube exec
@@ -53,6 +56,74 @@ pub fn stateful_set_from_cdb(cdb: &CoreDB) -> StatefulSet { | |||
..VolumeMount::default() | |||
}, | |||
]); | |||
let mut containers = vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move containers into separate variable in order to enable conditionally appending the sidecar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjmiller609 LGTM! Thoughts on following up with a simple 'scrape metrics' test? We could argue this is not the operator's responsibility, but I think it's good to test the metrics are served as expected.
…ent (#117) * move postgres-exporter out of statefulset and into deployment * fmt * fix clippy warnings, add correct connection string * change policy creation to be async * fix fmt * set postgres-exporter password as secret, refactor envvars, set role pass * remove local debug line * fixing tests * add more tests to assert deployments and secrets * adjust PolicyRule for postgres-exporter * fmt * fix possible naming collisions * move test to not have a race condition * more race condition fixes
No description provided.