{"id":102,"date":"2024-07-12T13:48:39","date_gmt":"2024-07-12T04:48:39","guid":{"rendered":"https:\/\/hy2t.com\/?p=102"},"modified":"2024-07-12T13:49:57","modified_gmt":"2024-07-12T04:49:57","slug":"%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e3%81%a7%e5%a4%89%e6%9b%b4%e3%81%97%e3%81%9f%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92tilt%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6kind%e3%81%aek8s%e7%92%b0%e5%a2%83%e3%81%ab","status":"publish","type":"post","link":"https:\/\/hy2t.com\/?p=102","title":{"rendered":"\u30ed\u30fc\u30ab\u30eb\u3067\u5909\u66f4\u3057\u305f\u30b3\u30fc\u30c9\u3092Tilt\u3092\u4f7f\u3063\u3066kind\u306ek8s\u74b0\u5883\u306b\u53cd\u6620\u3055\u305b\u308b"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/github.com\/tilt-dev\/tilt\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"338\" src=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/image-1024x338.png\" alt=\"TIlt logo\" class=\"wp-image-107\" style=\"width:840px;height:auto\" srcset=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/image-1024x338.png 1024w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/image-300x99.png 300w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/image-768x254.png 768w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/image-1536x508.png 1536w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/image.png 2000w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tilt\uff1f<\/h2>\n\n\n\n<p>\u30ed\u30fc\u30ab\u30eb\u3067\u958b\u767a\u3001\u30d3\u30eb\u30c9\u3057\u3066k8s\u306b\u53cd\u6620\u3057\u3066\u3001Pod\u7acb\u3066\u76f4\u3057\u3066\u3001\u3001\u3068\u3044\u3046\u624b\u9593\u3092Tilt\u3092\u4f7f\u3046\u3068\u30ed\u30fc\u30ab\u30eb\u3067\u958b\u767a\u3001\u30d3\u30eb\u30c9\u304b\u3089Pod\u306e\u7acb\u3066\u76f4\u3057\u307e\u3067\u3092\u81ea\u52d5\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3064\u307e\u308a\u30db\u30c3\u30c8\u30ea\u30ed\u30fc\u30c9\u3002<\/p>\n\n\n\n<p>\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u308b\u6642\u3068\u304b\u306e\u304a\u4f9b\u306b\u3088\u304f\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4fbf\u5229\u305d\u3046\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7d50\u679c<\/h2>\n\n\n\n<p>Web\u30b5\u30fc\u30d0\u30fc\u3092\u5efa\u3066\u3066\u5909\u66f4\u5185\u5bb9\u304c\u53cd\u6620\u3055\u308c\u308b\u3068\u3053\u308d\u307e\u3067\u78ba\u8a8d<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"233\" data-id=\"103\" src=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.11.23.png\" alt=\"Tilt\u691c\u8a3c\u306e\u5909\u66f4\u524d\" class=\"wp-image-103\" srcset=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.11.23.png 507w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.11.23-300x138.png 300w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"233\" data-id=\"104\" src=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.14.43.png\" alt=\"Tilt\u691c\u8a3c\u306e\u5909\u66f4\u5f8c\" class=\"wp-image-104\" srcset=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.14.43.png 507w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.14.43-300x138.png 300w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u516c\u5f0f\u3088\u308a\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/tilt.dev\">https:\/\/tilt.dev<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"228\" height=\"233\" src=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.08.00.png\" alt=\"\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u753b\u50cf\" class=\"wp-image-105\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tiltfile\u306e\u7528\u610f<\/h2>\n\n\n\n<p>\u52d5\u304b\u3059\u306e\u306b\u306fTitfile\u3068\u3044\u3046\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-ec6d312030927034dfbf9b909fecac71\"><code>k8s_yaml('simple-go.yaml')\n\nk8s_resource('simple-go', port_forwards='1323')\n\ncustom_build(\n  'simple-go-app',\n  'docker build -t $EXPECTED_REF . &amp;&amp; kind load docker-image $EXPECTED_REF',\n  &#91;'.'],\n)\n\n## docker\u3067\u4f7f\u3046\u5834\u5408\n# load('ext:\/\/restart_process', 'docker_build_with_restart')\n# docker_compose('docker-compose.yaml')\n# docker_build_with_restart(\n#   'example-go-image',\n#   '.',\n#   dockerfile='Dockerfile',\n#   entrypoint='\/app\/build\/tilt-example-go',\n#   live_update=&#91;\n#     sync('.', '\/app'),\n#   ],\n# )<\/code><\/pre>\n\n\n\n<p>k8s_yaml()\u3067yaml\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u5165\u308c\u308b\u3002<\/p>\n\n\n\n<p>k8s_resource()\u3067\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5165\u308c\u308b\u3089\u3057\u3044\u3002\u4eca\u56de\u306fPod\u306ename\u3092\u5165\u308c\u3066\u307f\u305f<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.tilt.dev\/api.html#api.k8s_resource\">https:\/\/docs.tilt.dev\/api.html#api.k8s_resource<\/a><\/p>\n\n\n\n<p>custom_build()\u3067\u306f\u3001Tilt\u3092\u4f7f\u3063\u3066\u30d3\u30eb\u30c9\u3059\u308b\u3068\u304d\u306e\u8a2d\u5b9a\u3092\u66f8\u3044\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.tilt.dev\/custom_build.html#the-next-way-running-your-own-image-builder\">https:\/\/docs.tilt.dev\/custom_build.html#the-next-way-running-your-own-image-builder<\/a><\/p>\n\n\n\n<p>\u3044\u308d\u3093\u306a\u30d3\u30eb\u30c9\u65b9\u6cd5\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u4eca\u56de\u306fkind\u3067\u52d5\u304b\u3059\u306e\u3067\u3001\u30d3\u30eb\u30c9\u5f8c\u306bkind\u3078\u30a4\u30e1\u30fc\u30b8\u3092\u30ed\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001custom_build\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u305d\u306e\u4ed6\u30d5\u30a1\u30a4\u30eb<\/h2>\n\n\n\n<p>Tilt\u306e\u52d5\u4f5c\u78ba\u8a8d\u3060\u3051\u306a\u306e\u3067\u3001Go\u3067\u30b7\u30f3\u30d7\u30eb\u306aWeb\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<p>main.go<\/p>\n\n\n\n<p><a href=\"https:\/\/echo.labstack.com\/docs\/quick-start#hello-world\">https:\/\/echo.labstack.com\/docs\/quick-start#hello-world<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Dockerfile<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-4cf3ab6e1c6b8d6f406858a4e5c0fd15\"><code>FROM golang:1.22-alpine\nWORKDIR \/app\nADD go.mod go.sum main.go .\/\nRUN go mod download\nRUN go build -o \/simple-go\n\nEXPOSE 1323\n\nCMD &#91; \"\/simple-go\" ]<\/code><\/pre>\n\n\n\n<p>EXPOSE\u3057\u305f\u30dd\u30fc\u30c8\u306e1323\u3068Tiltfile\u306ek8s_resource\u306eport_forwards\u306e\u5024\u306f\u540c\u3058\u306b\u3057\u3066\u3044\u307e\u3059<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>simple-go.yaml<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-d3f39a20cc7d78f4af560eba37d52e53\"><code>apiVersion: v1\nkind: Pod\nmetadata:\n  creationTimestamp: null\n  labels:\n    run: simple-go\n  name: simple-go\nspec:\n  containers:\n  - image: simple-go-app\n    name: simple-go\n    imagePullPolicy: IfNotPresent\n    resources: {}\n    ports:\n    - containerPort: 1323\n  dnsPolicy: ClusterFirst\n  restartPolicy: Always\nstatus: {}<\/code><\/pre>\n\n\n\n<p>\u666e\u901a\u306ePod\u3067\u3059\u3002imagePullPolicy\u306fIfNotPresent\u3067\u306a\u3044\u3068\u3001kind\u3067\u4f7f\u3048\u306a\u3044\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u884c\u65b9\u6cd5<\/h2>\n\n\n\n<p>Tiltfile\u304c\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066tilt\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-ed8dd208368a5e7e8f6aad3a7b78a06f\"><code>tilt up<\/code><\/pre>\n\n\n\n<p>http:\/\/localhost:10350\/\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30d3\u30eb\u30c9\u306e\u72b6\u6cc1\u306a\u3069\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"933\" height=\"685\" src=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.37.10.png\" alt=\"TIlt\u3067\u306e\u30d3\u30eb\u30c9\u72b6\u6cc1\" class=\"wp-image-106\" srcset=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.37.10.png 933w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.37.10-300x220.png 300w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/07\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2024-07-12-13.37.10-768x564.png 768w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/figure>\n\n\n\n<p>\u3042\u3068\u306fmain.go\u3092\u5909\u66f4\u3057\u3066\u30d3\u30eb\u30c9\u304c\u7d42\u308f\u308b\u306e\u3092\u5f85\u3064\u3060\u3051\uff01<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-30e517d7b10e97e05d08c095589a30c2\"><code>package main\n\nimport (\n\t\"net\/http\"\n\n\t\"github.com\/labstack\/echo\/v4\"\n)\n\nfunc main() {\n\te := echo.New()\n\te.GET(\"\/\", func(c echo.Context) error {\n\t\treturn c.String(http.StatusOK, \"\u6587\u5b57\u6587\u5b57\u6587\u5b57!\")\n\t})\n\te.Logger.Fatal(e.Start(\":1323\"))\n}\n<\/code><\/pre>\n\n\n\n<p>http:\/\/localhost:1323\/\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30ed\u30fc\u30ab\u30eb\u3067\u5909\u66f4\u3057\u305f\u5185\u5bb9\u304c\u53cd\u6620\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u7d42\u308f\u308a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tilt\uff1f \u30ed\u30fc\u30ab\u30eb\u3067\u958b\u767a\u3001\u30d3\u30eb\u30c9\u3057\u3066k8s\u306b\u53cd\u6620\u3057\u3066\u3001Pod\u7acb\u3066\u76f4\u3057\u3066\u3001\u3001\u3068\u3044\u3046\u624b\u9593\u3092Tilt\u3092\u4f7f\u3046\u3068\u30ed\u30fc\u30ab\u30eb\u3067\u958b\u767a\u3001\u30d3\u30eb\u30c9\u304b\u3089Pod\u306e\u7acb\u3066\u76f4\u3057\u307e\u3067\u3092\u81ea\u52d5\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3064\u307e\u308a\u30db\u30c3\u30c8\u30ea\u30ed\u30fc\u30c9\u3002 \u30ab\u30b9\u30bf\u30e0\u30b3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":107,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[12],"tags":[13],"class_list":["post-102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12","tag-tool"],"_links":{"self":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":1,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions\/108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/media\/107"}],"wp:attachment":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}