Skip to content

Commit 313b42c

Browse files
committed
fix and log health routes
1 parent 7786188 commit 313b42c

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

operator.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ rules:
8080
- apiGroups: [""]
8181
resources: ["configmaps"]
8282
resourceNames: ["postgres-restore-operator-config"]
83-
verbs: ["get", "watch"]
83+
verbs: ["get", "list", "watch"]
8484
---
8585
apiVersion: rbac.authorization.k8s.io/v1
8686
kind: RoleBinding
@@ -170,13 +170,13 @@ spec:
170170
protocol: TCP
171171
readinessProbe:
172172
httpGet:
173-
path: /healthz
173+
path: /readyz
174174
port: metrics
175175
initialDelaySeconds: 5
176176
periodSeconds: 10
177177
livenessProbe:
178178
httpGet:
179-
path: /healthz
179+
path: /livez
180180
port: metrics
181181
initialDelaySeconds: 15
182182
periodSeconds: 20

src/bin/operator.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,20 @@ async fn main() -> anyhow::Result<()> {
143143
}
144144
}),
145145
)
146-
.route("/healthz", get(|| async { "ok" }))
147-
.route("/readyz", get(|| async { "ok" }));
146+
.route(
147+
"/livez",
148+
get(|| async {
149+
tracing::trace!("GET /livez");
150+
"ok"
151+
}),
152+
)
153+
.route(
154+
"/readyz",
155+
get(|| async {
156+
tracing::trace!("GET /readyz");
157+
"ok"
158+
}),
159+
);
148160

149161
let listener = tokio::net::TcpListener::bind(&metrics_addr_clone)
150162
.await

0 commit comments

Comments
 (0)