{"id":1404,"date":"2024-10-13T16:44:33","date_gmt":"2024-10-13T08:44:33","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=1404"},"modified":"2024-10-13T16:44:33","modified_gmt":"2024-10-13T08:44:33","slug":"try-k3s-on-raspberry","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=1404","title":{"rendered":"try k3s on raspberry"},"content":{"rendered":"<h2>What is k3s<\/h2>\n<blockquote>\n<p>K3s is a fully compliant Kubernetes distribution with the following enhancements:<br \/>\nK8S \u7684 mini \u7248\u672c, \u7528\u6765\u8fb9\u7f18\u8ba1\u7b97<\/p>\n<\/blockquote>\n<ul>\n<li>Distributed as a single binary or minimal container image. -- \u4ee5\u4e00\u4e2a\u8ff7\u4f60\u7684\u4e8c\u8fdb\u5236\u5305\u6216\u5bb9\u5668\u955c\u50cf\u5305\u5206\u53d1<\/li>\n<li>Lightweight datastore based on sqlite3 as the default storage backend. etcd3, MySQL, and Postgres are also available. -- \u57fa\u4e8e sqlite \u7684\u8f7b\u91cf\u7ea7\u6570\u636e\u5b58\u50a8<\/li>\n<li>Wrapped in simple launcher that handles a lot of the complexity of TLS and options.<\/li>\n<li>Secure by default with reasonable defaults for lightweight environments.<\/li>\n<li>Operation of all Kubernetes control plane components is encapsulated in a single binary and process, allowing K3s to automate and manage complex cluster operations like distributing certificates. -- \u5c06 k8s \u63a7\u5236\u5e73\u53f0\u7684\u591a\u4e2a\u7ec4\u4ef6\u5c01\u88c5\u5230\u4e00\u4e2a\u4e8c\u8fdb\u5236\u5305\u4e2d, \u4e00\u4e2a\u8fdb\u7a0b\u4e2d, k3s \u53ef\u4ee5\u81ea\u52a8\u5316\u7ba1\u7406\u590d\u6742\u7684\u96c6\u7fa4\u64cd\u4f5c, \u4f8b\u5982\u5206\u53d1\u8bc1\u4e66<\/li>\n<li>External dependencies have been minimized; the only requirements are a modern kernel and cgroup mounts. -- \u5916\u90e8\u4f9d\u8d56\u6700\u5c0f\u5316, \u552f\u4e00\u7684\u9700\u6c42\u662f\u73b0\u4ee3\u5316\u7684\u5185\u6838\u548c cgroup mounts<\/li>\n<li>Packages the required dependencies for easy &quot;batteries-included&quot; cluster creation:\n<ul>\n<li>containerd \/ cri-dockerd container runtime (CRI)<\/li>\n<li>Flannel Container Network Interface (CNI)<\/li>\n<li>CoreDNS Cluster DNS<\/li>\n<li>Traefik Ingress controller<\/li>\n<li>ServiceLB Load-Balancer controller<\/li>\n<li>Kube-router Network Policy controller<\/li>\n<li>Local-path-provisioner Persistent Volume controller<\/li>\n<li>Spegel distributed container image registry mirror<\/li>\n<li>Host utilities (iptables, socat, etc)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2024\/10\/image-1728791082799-300x170.png\" alt=\"\" \/><\/p>\n<h2>Quick start<\/h2>\n<pre><code>\ncurl -sfL https:\/\/get.k3s.io | sh -\n[INFO]  Finding release for channel stable\ncurl: (52) Empty reply from server\n[INFO]  Using v1.30.5+k3s1 as release\n[INFO]  Downloading hash https:\/\/github.com\/k3s-io\/k3s\/releases\/download\/v1.30.5+k3s1\/sha256sum-arm.txt\n[INFO]  Skipping binary downloaded, installed k3s matches hash\n[INFO]  Finding available k3s-selinux versions\nsh: 416: [: k3s-selinux-1.6-1.el9.noarch.rpm: unexpected operator\n[INFO]  Skipping \/usr\/local\/bin\/kubectl symlink to k3s, already exists\n[INFO]  Skipping \/usr\/local\/bin\/crictl symlink to k3s, already exists\n[INFO]  Skipping \/usr\/local\/bin\/ctr symlink to k3s, already exists\n[INFO]  Creating killall script \/usr\/local\/bin\/k3s-killall.sh\n[INFO]  Creating uninstall script \/usr\/local\/bin\/k3s-uninstall.sh\n[INFO]  env: Creating environment file \/etc\/systemd\/system\/k3s.service.env\n[INFO]  systemd: Creating service file \/etc\/systemd\/system\/k3s.service\n[INFO]  systemd: Enabling k3s unit\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/k3s.service \u2192 \/etc\/systemd\/system\/k3s.service.\n[INFO]  No change detected so skipping service start\n $ sudo k3s kubectl get node\nNAME          STATUS   ROLES                  AGE   VERSION\nraspberrypi   Ready    control-plane,master   91s   v1.30.5+k3s1\n``<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What is k3s K3s is a fully compliant Kubernetes distribution with the following enhancements: K8S \u7684 mini \u7248\u672c, \u7528\u6765\u8fb9\u7f18\u8ba1\u7b97 Distributed as a single binary or minimal container image. &#8212; \u4ee5\u4e00\u4e2a\u8ff7\u4f60\u7684\u4e8c\u8fdb\u5236\u5305\u6216\u5bb9\u5668\u955c\u50cf\u5305\u5206\u53d1 Lightweight datastore based on sqlite3 as the default storage backend. etcd3, MySQL, and Postgres are also available. &#8212; \u57fa\u4e8e sqlite \u7684\u8f7b\u91cf\u7ea7\u6570\u636e\u5b58\u50a8 Wrapped in simple launcher [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=1404\" title=\"Permanent Link to: try k3s on raspberry\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1404","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1404"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1404"}],"version-history":[{"count":3,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1404\/revisions"}],"predecessor-version":[{"id":1411,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1404\/revisions\/1411"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}