{"id":1963,"date":"2023-11-02T10:51:23","date_gmt":"2023-11-02T01:51:23","guid":{"rendered":"https:\/\/www.kwonline.org\/memo2\/?p=1963"},"modified":"2023-11-02T10:52:03","modified_gmt":"2023-11-02T01:52:03","slug":"use-kubectl-on-gcp-gke","status":"publish","type":"post","link":"https:\/\/www.kwonline.org\/memo2\/2023\/11\/02\/use-kubectl-on-gcp-gke\/","title":{"rendered":"GCP GKE \u3067 kubectl \u3092\u4f7f\u3046"},"content":{"rendered":"<p>&nbsp;<br \/>\nGKE \u3092\u3088\u304f\u4f7f\u3046\u306e\u3067\u30e1\u30e2\u3002\u306a\u304a Ubuntu.<\/p>\n<p>gcloud \u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3002<\/p>\n<p>kubectl \u3092\u5165\u308c\u3066\u304a\u304f\u3002<br \/>\n\u4eca\u56de\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u3067 1.27.7 \u3092\u9078\u3093\u3060\u3002<br \/>\n\u305d\u306e\u4ed6\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f <a href=\"https:\/\/kubernetes.io\/releases\/\" rel=\"noopener\" target=\"_blank\">\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8<\/a> \u3067\u78ba\u8a8d\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncurl -LO https:\/\/dl.k8s.io\/release\/v1.27.7\/bin\/linux\/amd64\/kubectl\r\nchmod +x kubectl\r\nsudo mv kubectl \/usr\/local\/bin\/\r\n<\/pre>\n<p>gke-cloud-auth-plugin \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt install google-cloud-sdk-gke-gcloud-auth-plugin\r\n<\/pre>\n<p>\u305d\u3057\u3066 GKE \u30af\u30e9\u30b9\u30bf\u30fc\u3092\u4f5c\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngcloud container clusters create mycluster-01 --zone=asia-northeast1-b\r\n<\/pre>\n<p>kubeconfig \u3092\u751f\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngcloud container clusters get-credentials mycluster-01 --zone=asia-northeast1-b\r\n<\/pre>\n<p>\u30c6\u30b9\u30c8\u3002<br \/>\nService\u306e\u72b6\u6cc1\u3092\u78ba\u8a8d\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nkubectl get svc\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; GKE \u3092\u3088\u304f\u4f7f\u3046\u306e\u3067\u30e1\u30e2\u3002\u306a\u304a Ubuntu. gcloud \u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3002 kubectl \u3092\u5165\u308c\u3066\u304a\u304f\u3002 \u4eca\u56de\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u3067 1.27.7 \u3092\u9078\u3093\u3060\u3002 \u305d\u306e\u4ed6\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f \u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,32,8],"tags":[],"class_list":["post-1963","post","type-post","status-publish","format-standard","hentry","category-gcp","category-kubernetes","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/comments?post=1963"}],"version-history":[{"count":4,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1963\/revisions"}],"predecessor-version":[{"id":1967,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1963\/revisions\/1967"}],"wp:attachment":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/media?parent=1963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/categories?post=1963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/tags?post=1963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}