私は kubernetesプローブ spring bootアクチュエータから使用しようとしていますが、機能していません。
Application.propertiesに次のように設定しました。
management.endpoints.web.path-mapping.health=probes
management.endpoint.health.group.ping.include=ping
management.endpoint.health.group.liveness.include=livenessState
management.endpoint.health.group.readiness.include=readinessState
グループは期待どおりに記載されています。
$ curl http://localhost:8080/actuator/probes
{"status":"UP","groups":["liveness","ping","readiness"]}
そしてping
が期待どおりに機能します。
$ curl http://localhost:8080/actuator/probes/ping
{"status":"UP"}
ただしとliveness
readiness
Status Code: 404
とContent-Length: 0
を返します。
spring-boot-starter-parent
バージョン2.3.1.RELEASE
を使用しています。
私が望むプローブは 自動設定されたHealthIndicators のリストに記載されています。
この機能は、 https://spring.io/blog/2020/03/25/light-and-readiness-probes-with-spring-boot /.
効果がなく、livenessState
(ブログ投稿にある)を照らすlivenessProbe
のいくつかの綴りを試しました。
これは関連した答えですが、それは私の問題に直接取り組むことはありません: kubernetes - 活性と準備プローブの実装
どのビットの設定がありませんか?
リンクされたサイトに潜在的な手がかりを示すいくつかの言語があります...
Kubernetes環境に展開されている場合、アクチュエータは「活性」と「準備」の情報を集めるでしょう...
多分これは、kubernetes環境に展開されていればプローブonly work _ _ _ _ _ _ _} _ _ _ _ _ _} _ _ _ _ _} _ _ _ _} _ _ _ _ _ _ _} _ _ _ _ _ _ _} _ _ _} _ _ _ _ _ _} _ _ _ _ _ _ _ _ _ _ _ _ _ _} _ _.
include=livenessState
またはinclude=readinessState
を使用するのは正しいです。例 ここ (include=livenessProbe
を示す)が間違っています。
Kubernetes環境で実行されている間の結果を試行錯誤で識別しました。
management.endpoint.health.group.exploratory.include=livenessState,readinessState,ping
management.endpoint.health.group.exploratory.show-details=always
魔法、と明白な理由のない、標準のローカルランを実行すると、これらのインジケータは利用できず、利用可能な保健グループの場合は404
が入手できます。
参考のために: