{"id":1416,"date":"2025-05-28T05:57:46","date_gmt":"2025-05-27T20:57:46","guid":{"rendered":"https:\/\/itstudy365.com\/blog\/?p=1416"},"modified":"2025-05-28T05:57:46","modified_gmt":"2025-05-27T20:57:46","slug":"kubernetes-learning-%e7%ac%ac24%e7%ab%a0%ef%bc%9aliveness-readiness-probe-%e3%80%9cpod%e3%81%ae%e5%81%a5%e5%ba%b7%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%80%9c","status":"publish","type":"post","link":"https:\/\/itstudy365.com\/blog\/2025\/05\/28\/kubernetes-learning-%e7%ac%ac24%e7%ab%a0%ef%bc%9aliveness-readiness-probe-%e3%80%9cpod%e3%81%ae%e5%81%a5%e5%ba%b7%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%80%9c\/","title":{"rendered":"Kubernetes Learning \u7b2c24\u7ae0\uff1aLiveness \/ Readiness Probe \u301cPod\u306e\u5065\u5eb7\u30c1\u30a7\u30c3\u30af\u301c"},"content":{"rendered":"\n<button id=\"bb1\" type=\"button\" value=\"Play\" class=\"responsivevoice-button\" title=\"ResponsiveVoice Tap to Start\/Stop Speech\"><span>&#128266; Play<\/span><\/button>\n        <script>\n            bb1.onclick = function(){\n                if(responsiveVoice.isPlaying()){\n                    responsiveVoice.cancel();\n                }else{\n                    responsiveVoice.speak(\"Kubernetes\u3067\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3092\u76e3\u8996\u3057\u3066\u3001\u9069\u5207\u306b\u7ba1\u7406\u3059\u308b\u4ed5\u7d44\u307f\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u304c\u300cLiveness Probe\u300d\u3068\u300cReadiness Probe\u300d\u3067\u3059\u3002 \u3053\u306e2\u3064\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\uff1a \u30d5\u30ea\u30fc\u30ba\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3059\u308b \u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u4ed8\u3051\u308b\u304b\u3069\u3046\u304b\u5224\u65ad\u3059\u308b \u2705 \u305d\u308c\u305e\u308c\u306e\u5f79\u5272 \u9805\u76ee\u8aac\u660e\u4e3b\u306a\u4f7f\u3044\u9053Liveness Probe\u300c\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u3001\u751f\u304d\u3066\u308b\uff1f\u300d\u6b7b\u3093\u3067\u3044\u305f\u3089\u81ea\u52d5\u518d\u8d77\u52d5Readiness Probe\u300c\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u3001\u4eca\u30ea\u30af\u30a8\u30b9\u30c8\u53d7\u3051\u3089\u308c\u308b\uff1f\u300d\u53d7\u3051\u3089\u308c\u306a\u3044\u5834\u5408\u3001Service\u306e\u5bfe\u8c61\u304b\u3089\u5916\u3059 \ud83e\udde0 \u30a4\u30e1\u30fc\u30b8\u3067\u7406\u89e3\u3059\u308b \u30a2\u30d7\u30ea\u304c\u30d5\u30ea\u30fc\u30ba\uff1a\u2192 Liveness Probe\u304c\u5931\u6557 \u2192 Pod\u518d\u8d77\u52d5 \u8d77\u52d5\u76f4\u5f8c\u3067\u307e\u3060\u6e96\u5099\u4e2d\uff1a\u2192 Readiness Probe\u304c\u5931\u6557 \u2192 \u30b5\u30fc\u30d3\u30b9\u306f\u307e\u3060\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9001\u3089\u306a\u3044 \u3053\u308c\u306b\u3088\u308a\u3001\u4e0d\u5b89\u5b9a\u306aPod\u3092\u30e6\u30fc\u30b6\u30fc\u306b\u898b\u305b\u305a\u306b\u3001\u5b89\u5168\u306b\u30b5\u30fc\u30d3\u30b9\u63d0\u4f9b\u3067\u304d\u307e\u3059\u3002 \ud83d\udee0\ufe0f Probe\u306e\u7a2e\u985e Kubernetes\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3067\u72b6\u614b\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059\uff1a \u7a2e\u985e\u6982\u8981\u4f7f\u7528\u4f8bHTTP\u6307\u5b9aURL\u306bHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u5fdc\u7b54\u3092\u898b\u308b\/health \u306a\u3069TCP\u30dd\u30fc\u30c8\u304c\u958b\u3044\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3069Command\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u7d42\u4e86\u30b3\u30fc\u30c9\u3067\u5224\u65adpgrep\u3084curl\u306a\u3069 \ud83d\udd27 YAML\u8a2d\u5b9a\u306e\u4f8b\uff08Liveness + Readiness\uff09 livenessProbe: httpGet: path: \/healthz port: 8080 initialDelaySeconds: 10 periodSeconds: 5 readinessProbe: httpGet: path: \/ready port: 8080 initialDelaySeconds: 5 periodSeconds: 3 \u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u610f\u5473\uff1a initialDelaySeconds: \u8d77\u52d5\u76f4\u5f8c\u306e\u5f85\u6a5f\u6642\u9593\uff08\u30c1\u30a7\u30c3\u30af\u958b\u59cb\u307e\u3067\u5f85\u3064\uff09 periodSeconds: \u30c1\u30a7\u30c3\u30af\u306e\u983b\u5ea6 httpGet.path: \u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u306eURL\u30d1\u30b9 \ud83d\udccc \u6ce8\u610f\u70b9 Liveness Probe\u304c\u9023\u7d9a\u3067\u5931\u6557\u3059\u308b\u3068\u3001Pod\u306f\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3055\u308c\u307e\u3059 Readiness Probe\u304c\u5931\u6557\u4e2d\u306ePod\u306b\u306fService\u304b\u3089\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u6765\u307e\u305b\u3093 \u4e21\u65b9\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u4e00\u822c\u7684\uff08\u8d77\u52d5\u4e2d\u306e\u4e0d\u5b89\u5b9a\u306a\u72b6\u614b\u3082\u8003\u616e\u3067\u304d\u308b\uff09 \ud83d\udca1 \u307e\u3068\u3081 \u9805\u76ee\u5185\u5bb9Liveness Probe\u30a2\u30d7\u30ea\u304c\u30cf\u30f3\u30b0\u3057\u3066\u3044\u306a\u3044\u304b\u3092\u76e3\u8996Readiness Probe\u30a2\u30d7\u30ea\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u3089\u308c\u308b\u72b6\u614b\u304b\u76e3\u8996\u30e1\u30ea\u30c3\u30c8\u4e0d\u5b89\u5b9a\u306aPod\u306e\u81ea\u52d5\u56de\u5fa9\u3001\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5f71\u97ff\u3092\u6700\u5c0f\u5316\u8a2d\u5b9a\u65b9\u6cd5httpGet, tcpSocket, exec\u306a\u3069\u3067\u67d4\u8edf\u306b\u8a2d\u5b9a\u53ef\u80fd \ud83e\uddea \u88dc\u8db3\uff1a\u3069\u3046\u4f7f\u3044\u5206\u3051\u308b\uff1f \u72b6\u614b\u5bfe\u5fdc\u8d77\u52d5\u76f4\u5f8c\u3067\u6e96\u5099\u4e2dReadiness\u304c\u5931\u6557\uff08\u2192\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9001\u3089\u306a\u3044\uff09\u30a2\u30d7\u30ea\u304c\u30d5\u30ea\u30fc\u30baLiveness\u304c\u5931\u6557\uff08\u2192Pod\u3092\u518d\u8d77\u52d5\uff09\u4e00\u6642\u7684\u306b\u91cd\u304f\u3066\u5fdc\u7b54\u3057\u306a\u3044Readiness\u5931\u6557\u3060\u3051\u3067\u6e08\u3080\u30b1\u30fc\u30b9\u3082\u591a\u3044\uff08\u518d\u8d77\u52d5\u306f\u907f\u3051\u305f\u3044\uff09\", \"Japanese Female\");\n                }\n            };\n        <\/script>\n    <\/p>\n\n\n\n<p>Kubernetes\u3067\u306f\u3001<strong>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3092\u76e3\u8996\u3057\u3066\u3001\u9069\u5207\u306b\u7ba1\u7406\u3059\u308b\u4ed5\u7d44\u307f<\/strong>\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u304c\u300c<strong>Liveness Probe<\/strong>\u300d\u3068\u300c<strong>Readiness Probe<\/strong>\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e2\u3064\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul>\n<li>\u30d5\u30ea\u30fc\u30ba\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3059\u308b<\/li>\n\n\n\n<li>\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u4ed8\u3051\u308b\u304b\u3069\u3046\u304b\u5224\u65ad\u3059\u308b<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u305d\u308c\u305e\u308c\u306e\u5f79\u5272<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u9805\u76ee<\/th><th>\u8aac\u660e<\/th><th>\u4e3b\u306a\u4f7f\u3044\u9053<\/th><\/tr><\/thead><tbody><tr><td><strong>Liveness Probe<\/strong><\/td><td>\u300c\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u3001\u751f\u304d\u3066\u308b\uff1f\u300d<\/td><td>\u6b7b\u3093\u3067\u3044\u305f\u3089<strong>\u81ea\u52d5\u518d\u8d77\u52d5<\/strong><\/td><\/tr><tr><td><strong>Readiness Probe<\/strong><\/td><td>\u300c\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u3001\u4eca\u30ea\u30af\u30a8\u30b9\u30c8\u53d7\u3051\u3089\u308c\u308b\uff1f\u300d<\/td><td>\u53d7\u3051\u3089\u308c\u306a\u3044\u5834\u5408\u3001<strong>Service\u306e\u5bfe\u8c61\u304b\u3089\u5916\u3059<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde0 \u30a4\u30e1\u30fc\u30b8\u3067\u7406\u89e3\u3059\u308b<\/h3>\n\n\n\n<ul>\n<li>\u30a2\u30d7\u30ea\u304c\u30d5\u30ea\u30fc\u30ba\uff1a<br>\u2192 <strong>Liveness Probe\u304c\u5931\u6557 \u2192 Pod\u518d\u8d77\u52d5<\/strong><\/li>\n\n\n\n<li>\u8d77\u52d5\u76f4\u5f8c\u3067\u307e\u3060\u6e96\u5099\u4e2d\uff1a<br>\u2192 <strong>Readiness Probe\u304c\u5931\u6557 \u2192 \u30b5\u30fc\u30d3\u30b9\u306f\u307e\u3060\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9001\u3089\u306a\u3044<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u306b\u3088\u308a\u3001<strong>\u4e0d\u5b89\u5b9a\u306aPod\u3092\u30e6\u30fc\u30b6\u30fc\u306b\u898b\u305b\u305a\u306b\u3001\u5b89\u5168\u306b\u30b5\u30fc\u30d3\u30b9\u63d0\u4f9b<\/strong>\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0\ufe0f Probe\u306e\u7a2e\u985e<\/h3>\n\n\n\n<p>Kubernetes\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3067\u72b6\u614b\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u7a2e\u985e<\/th><th>\u6982\u8981<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><strong>HTTP<\/strong><\/td><td>\u6307\u5b9aURL\u306bHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u5fdc\u7b54\u3092\u898b\u308b<\/td><td><code>\/health<\/code> \u306a\u3069<\/td><\/tr><tr><td><strong>TCP<\/strong><\/td><td>\u30dd\u30fc\u30c8\u304c\u958b\u3044\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d<\/td><td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3069<\/td><\/tr><tr><td><strong>Command<\/strong><\/td><td>\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u7d42\u4e86\u30b3\u30fc\u30c9\u3067\u5224\u65ad<\/td><td><code>pgrep<\/code>\u3084<code>curl<\/code>\u306a\u3069<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 YAML\u8a2d\u5b9a\u306e\u4f8b\uff08Liveness + Readiness\uff09<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-scss\" data-lang=\"SCSS\" data-show-lang=\"0\"><code>livenessProbe:\n  httpGet:\n    path: \/healthz\n    port: 8080\n  initialDelaySeconds: 10\n  periodSeconds: 5\n\nreadinessProbe:\n  httpGet:\n    path: \/ready\n    port: 8080\n  initialDelaySeconds: 5\n  periodSeconds: 3<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u610f\u5473\uff1a<\/h4>\n\n\n\n<ul>\n<li><code>initialDelaySeconds<\/code>: \u8d77\u52d5\u76f4\u5f8c\u306e\u5f85\u6a5f\u6642\u9593\uff08\u30c1\u30a7\u30c3\u30af\u958b\u59cb\u307e\u3067\u5f85\u3064\uff09<\/li>\n\n\n\n<li><code>periodSeconds<\/code>: \u30c1\u30a7\u30c3\u30af\u306e\u983b\u5ea6<\/li>\n\n\n\n<li><code>httpGet.path<\/code>: \u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u306eURL\u30d1\u30b9<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccc \u6ce8\u610f\u70b9<\/h3>\n\n\n\n<ul>\n<li>Liveness Probe\u304c<strong>\u9023\u7d9a\u3067\u5931\u6557<\/strong>\u3059\u308b\u3068\u3001Pod\u306f\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3055\u308c\u307e\u3059<\/li>\n\n\n\n<li>Readiness Probe\u304c\u5931\u6557\u4e2d\u306ePod\u306b\u306f<strong>Service\u304b\u3089\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u6765\u307e\u305b\u3093<\/strong><\/li>\n\n\n\n<li>\u4e21\u65b9\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u4e00\u822c\u7684\uff08\u8d77\u52d5\u4e2d\u306e\u4e0d\u5b89\u5b9a\u306a\u72b6\u614b\u3082\u8003\u616e\u3067\u304d\u308b\uff09<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 \u307e\u3068\u3081<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u9805\u76ee<\/th><th>\u5185\u5bb9<\/th><\/tr><\/thead><tbody><tr><td>Liveness Probe<\/td><td>\u30a2\u30d7\u30ea\u304c\u30cf\u30f3\u30b0\u3057\u3066\u3044\u306a\u3044\u304b\u3092\u76e3\u8996<\/td><\/tr><tr><td>Readiness Probe<\/td><td>\u30a2\u30d7\u30ea\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u3089\u308c\u308b\u72b6\u614b\u304b\u76e3\u8996<\/td><\/tr><tr><td>\u30e1\u30ea\u30c3\u30c8<\/td><td>\u4e0d\u5b89\u5b9a\u306aPod\u306e\u81ea\u52d5\u56de\u5fa9\u3001\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5f71\u97ff\u3092\u6700\u5c0f\u5316<\/td><\/tr><tr><td>\u8a2d\u5b9a\u65b9\u6cd5<\/td><td><code>httpGet<\/code>, <code>tcpSocket<\/code>, <code>exec<\/code>\u306a\u3069\u3067\u67d4\u8edf\u306b\u8a2d\u5b9a\u53ef\u80fd<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddea \u88dc\u8db3\uff1a\u3069\u3046\u4f7f\u3044\u5206\u3051\u308b\uff1f<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u72b6\u614b<\/th><th>\u5bfe\u5fdc<\/th><\/tr><\/thead><tbody><tr><td>\u8d77\u52d5\u76f4\u5f8c\u3067\u6e96\u5099\u4e2d<\/td><td>Readiness\u304c\u5931\u6557\uff08\u2192\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9001\u3089\u306a\u3044\uff09<\/td><\/tr><tr><td>\u30a2\u30d7\u30ea\u304c\u30d5\u30ea\u30fc\u30ba<\/td><td>Liveness\u304c\u5931\u6557\uff08\u2192Pod\u3092\u518d\u8d77\u52d5\uff09<\/td><\/tr><tr><td>\u4e00\u6642\u7684\u306b\u91cd\u304f\u3066\u5fdc\u7b54\u3057\u306a\u3044<\/td><td>Readiness\u5931\u6557\u3060\u3051\u3067\u6e08\u3080\u30b1\u30fc\u30b9\u3082\u591a\u3044\uff08\u518d\u8d77\u52d5\u306f\u907f\u3051\u305f\u3044\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[56],"_links":{"self":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1416"}],"collection":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/comments?post=1416"}],"version-history":[{"count":1,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1416\/revisions"}],"predecessor-version":[{"id":1417,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1416\/revisions\/1417"}],"wp:attachment":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/media?parent=1416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/categories?post=1416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/tags?post=1416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}