{"id":827,"date":"2022-01-02T20:28:31","date_gmt":"2022-01-02T11:28:31","guid":{"rendered":"http:\/\/www.ranran.mydns.jp\/blog\/?p=827"},"modified":"2022-01-02T20:28:31","modified_gmt":"2022-01-02T11:28:31","slug":"k3os%e3%81%a7k3s%e7%92%b0%e5%a2%83%e3%82%92%e6%a7%8b%e7%af%89%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"http:\/\/www.ranran.mydns.jp\/blog\/?p=827","title":{"rendered":"K3os\u3067k3s\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u307f\u308b\u3002"},"content":{"rendered":"\n<p>k8s\u74b0\u5883\u3068\u3057\u3066Ubuntu + microk8s\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u30ea\u30bd\u30fc\u30b9\u6d88\u8cbb\u304c\u591a\u3044\u306e\u304c\u305f\u307e\u306b\u50b7\u3002<\/p>\n\n\n\n<p>\u304a\u307e\u3051\u306bk8s\u306e\u6a5f\u80fd\u3082\u305d\u308c\u307b\u3069\u4f7f\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u3082\u3042\u308a\u3001k3s\u74b0\u5883\u306b\u4e57\u308a\u63db\u3048\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>k3os\u3067\u69cb\u7bc9\u3057\u305f\u306e\u3067\u3059\u304c\u305d\u306e\u6642\u306e\u69cb\u7bc9\u30e1\u30e2\u3092\u6b8b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u25c6k3os\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>iso\u30a4\u30e1\u30fc\u30b8\u3067live\u8d77\u52d5\u3057\u305f\u3089rancher\/&lt;\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3057>\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u958b\u59cb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo k3os install<\/code><\/pre>\n\n\n\n<p>\u5404\u7a2e\u8a2d\u5b9a\u306f<a rel=\"noreferrer noopener\" href=\"https:\/\/tech.virtualtech.jp\/entry\/2019\/08\/28\/160032\" data-type=\"URL\" data-id=\"https:\/\/tech.virtualtech.jp\/entry\/2019\/08\/28\/160032\" target=\"_blank\">\u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8<\/a>\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u518d\u8d77\u52d5\u5f8c\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3067SSH\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo vi \/etc\/ssh\/sshd_config\n\/\/ \u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u7b87\u6240\u3092\u4fee\u6b63\n#PasswordAuthentication no\nPasswordAuthentication yes\n\/\/ \u30b5\u30fc\u30d3\u30b9\u3092\u518d\u8d77\u52d5\n$ sudo service sshd restart<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u25c6k3os\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a<\/h3>\n\n\n\n<p>\u521d\u671f\u72b6\u614b\u3067\u306fDHCP\u63a5\u7d9a\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u56fa\u5b9aIP\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u3092\u8868\u793a\n$ sudo connmanctl services\n\/\/ \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u60c5\u5831\u3092\u8868\u793a\n$ sudo connmanctl service ethernet_xxxxxxx_cable\n\/\/ IPv4\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\n$ sudo connmanctl config ethernet_xxxxxxx_cable --ipv4 manual 192.168.xx.xx 255.255.255.0 192.168.xx.xx --nameservers 192.168.xx.xx\n\/\/ \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u518d\u8d77\u52d5\n$ sudo service connman restart<\/code><\/pre>\n\n\n\n<p>\u518d\u8d77\u52d5\u5f8c\u3001ssh\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067rancher\/&lt;\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u8a2d\u5b9a\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9>\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u304b\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u25c6\u5404\u7a2e\u8a2d\u5b9a\u3092cloud-init\u3067\u8a2d\u5b9a<\/h3>\n\n\n\n<p>\u6211\u304c\u5bb6\u3067\u306f\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ec\u30b8\u30b9\u30c8\u30ea\u3067Docker\u30a4\u30e1\u30fc\u30b8\u3092\u7ba1\u7406\u3057\u3066\u3044\u308b\u306e\u3067\u305d\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\n$ sudo vi \/var\/lib\/rancher\/k3os\/config.yaml\n\nk3os:\r\n  ntp_servers:\r\n    - ntp.nict.jp\r\nwrite_files:\r\n- content: |\r\n    mirrors:\r\n      docker.io:\r\n        endpoint:\r\n          - \"https:\/\/registry.gitlab.com\"\r\n      \"192.168.xx.xx:5000\":\r\n        endpoint:\r\n          - \"http:\/\/192.168.xx.xx:5000\"\r\n  owner: root\r\n  path: \/etc\/rancher\/k3s\/registries.yaml\r\n  permissions: '0755'\r\nhostname: k3os-server\n\n\/\/ \u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\n$ sudo reboot<\/code><\/pre>\n\n\n\n<p>\u306a\u304a\u3001NTP\u306e\u8a2d\u5b9a\u3092\u3057\u306a\u3044\u3068\u306a\u305c\u304bkubectl\u30b3\u30de\u30f3\u30c9\u304c\u8a3c\u660e\u66f8\u306e\u671f\u9650\u5207\u308c\u3067\u53d7\u4ed8\u3089\u308c\u306a\u304b\u3063\u305f\u305f\u3081\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3067k3s\u74b0\u5883\u306f\u69cb\u7bc9\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>k8s\u74b0\u5883\u3068\u3057\u3066Ubuntu + microk8s\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u30ea\u30bd\u30fc\u30b9\u6d88\u8cbb\u304c\u591a\u3044\u306e\u304c\u305f\u307e\u306b\u50b7\u3002 \u304a\u307e\u3051\u306bk8s\u306e\u6a5f\u80fd\u3082\u305d\u308c\u307b\u3069\u4f7f\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u3082\u3042\u308a\u3001k3s\u74b0\u5883\u306b\u4e57\u308a\u63db\u3048\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 k3os\u3067\u69cb\u7bc9\u3057\u305f\u306e\u3067\u3059 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,54,53,52,38,30],"tags":[],"class_list":["post-827","post","type-post","status-publish","format-standard","hentry","category-k3os","category-k3s","category-k8s","category-kubernetes","category-linux","category-oss"],"_links":{"self":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=827"}],"version-history":[{"count":1,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/827\/revisions"}],"predecessor-version":[{"id":828,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/827\/revisions\/828"}],"wp:attachment":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=827"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}