{"id":8624,"date":"2025-12-01T21:29:16","date_gmt":"2025-12-01T12:29:16","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=8624"},"modified":"2025-12-01T21:31:06","modified_gmt":"2025-12-01T12:31:06","slug":"k8s-kubectl-run-it-bash-%e3%81%99%e3%82%8b%e3%81%a8%e7%94%bb%e9%9d%a2%e8%a1%a8%e7%a4%ba%e3%81%8c%e3%83%ad%e3%82%b0%e3%81%a8%e3%81%97%e3%81%a6%e4%bf%9d%e5%ad%98%e3%81%95%e3%82%8c%e3%82%8b","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=8624","title":{"rendered":"[k8s] kubectl run -it &#8212; bash \u3059\u308b\u3068\u753b\u9762\u8868\u793a\u304c\u30ed\u30b0\u3068\u3057\u3066\u4fdd\u5b58\u3055\u308c\u308b"},"content":{"rendered":"<p>kubectl \u306b\u306f Pod \u3068\u305d\u306e\u4e2d\u306e\u30b3\u30f3\u30c6\u30ca\u3092 ad hoc \u306b\u4f5c\u308b kubectl run \u3068\u3044\u3046\u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3067 bash \u3092\u8d77\u52d5\u3057\u3066\u305d\u306e\u4e0a\u3067\u4f55\u304b\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u3066\u3044\u308b\u3068\u3001\u753b\u9762\u8868\u793a\u304c\u30ed\u30b0\u3068\u3057\u3066\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u3053\u308c\u306f\u306a\u3093\u3067\u304b\u3068\u3044\u3046\u3068\u3001kubectl run \u3067\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u8d77\u52d5\u3057\u305f\u30d7\u30ed\u30bb\u30b9\u306e stdout \u306f\u30ce\u30fc\u30c9\u4e0a\u306b\u4fdd\u5b58\u3055\u308c\u308b\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u63a5\u7d9a\u3055\u308c\u3066\u304a\u308a\u3001-it \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u52b9\u679c\u3067 stdout \u3092\u6a2a\u304b\u3089\u8997\u304d\u898b\u308b\u5f62\u3067\u753b\u9762\u306b\u51fa\u529b\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u3067\uff08\u3088\u3046\u3059\u308b\u306b k8s \u30af\u30e9\u30b9\u30bf\u306e\u4e2d\u3067\uff09bash \u3092\u8d77\u52d5\u3057\u3066\u64cd\u4f5c\u3092\u3057\u305f\u3044\u3051\u3069\u30ed\u30b0\u306b\u4fdd\u5b58\u3055\u308c\u306a\u304f\u306a\u3044\u5834\u5408\u306f\u3001 kubectl run &#8212; pause \u304b\u4f55\u304b\u3067 Pod \u3092\u4f5c\u3063\u3066\u304b\u3089\u3001\u305d\u306e\u4e2d\u306b kubectl exec &#8212; bash \u3059\u308c\u3070\u56de\u907f\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u56f3\u306b\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2025\/12\/kubectl-run-and-exec-stdout.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2025\/12\/kubectl-run-and-exec-stdout.png\" alt=\"\" width=\"400\" height=\"640\" class=\"alignnone size-full wp-image-8625\" srcset=\"http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2025\/12\/kubectl-run-and-exec-stdout.png 800w, http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2025\/12\/kubectl-run-and-exec-stdout-188x300.png 188w, http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2025\/12\/kubectl-run-and-exec-stdout-640x1024.png 640w, http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2025\/12\/kubectl-run-and-exec-stdout-768x1229.png 768w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>\u5909\u306a\u3082\u306e\u3092\u6253\u3063\u3066\u6c38\u7d9a\u5316\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u6c17\u3092\u4ed8\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>kubectl \u306b\u306f Pod \u3068\u305d\u306e\u4e2d\u306e\u30b3\u30f3\u30c6\u30ca\u3092 ad hoc \u306b\u4f5c\u308b kubectl run \u3068\u3044\u3046\u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3067 bash \u3092\u8d77\u52d5\u3057\u3066\u305d\u306e\u4e0a\u3067\u4f55\u304b\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u3066\u3044\u308b\u3068\u3001\u753b\u9762\u8868\u793a\u304c\u30ed\u30b0\u3068\u3057\u3066\u4fdd\u5b58\u3055 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-8624","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/8624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8624"}],"version-history":[{"count":7,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/8624\/revisions"}],"predecessor-version":[{"id":8632,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/8624\/revisions\/8632"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8624"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}