【发布时间】:2020-12-16 01:33:35
【问题描述】:
我有一个简单的 livenessProbe http 检查:
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 20
timeoutSeconds: 30
failureThreshold: 3
successThreshold: 3
在我的日志中,有大量状态为 200 OK 的 /health 检查,这使日志变得非常大,因此非常昂贵。有没有办法只在状态为 NOT 200 时记录?
我试图寻找答案,但还没有成功。
有人可以帮我吗?谢谢
#UPDATE
我认为日志是通过 nginx 生成的:
nginx的配置:
server {
listen 8080;
root /www/data/;
index index.html;
access_log off;
location /health {
return 200 '{\"status\": \"ok\"}';
default_type application/json;
}
location / {
gzip on;
try_files $uri /index.html;
}
}
【问题讨论】:
-
您是否设置了任何日志架构,或者您是否使用默认的 OpenShift 设置?
标签: kubernetes openshift livenessprobe