{"id":798,"date":"2022-06-06T22:21:00","date_gmt":"2022-06-06T22:21:00","guid":{"rendered":"https:\/\/www.darmain.co.uk\/darmainworld\/?p=798"},"modified":"2022-06-06T22:21:03","modified_gmt":"2022-06-06T22:21:03","slug":"home-lab-cloud-kubernetes-install","status":"publish","type":"post","link":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/2022\/06\/06\/home-lab-cloud-kubernetes-install\/","title":{"rendered":"Home Lab Cloud &#8211; Kubernetes install"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Part 1<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This subject has proven rather heavy.  There are plenty of places on the net to describe what Kubernetes is.  I get that. Now if I go to the home of Kubernetes at <a rel=\"noreferrer noopener\" href=\"https:\/\/kubernetes.io\/\" target=\"_blank\">https:\/\/kubernetes.io\/<\/a> then I have an absolute load of information about installing, managing and,,,, well, I didn&#8217;t really get off of the installation part.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why?  The advice I&#8217;ve been given is to work from &#8220;bottom up&#8221;.  The installation of Kubernetes starts with the engine that runs the containers, or the K8s speak, that&#8217;ll be &#8220;Pods&#8221;.  The engine is called &#8220;kubelet&#8221;.  Now this actually downloads a Docker image, rather ironically.  But there is no information on how to build the container.  You will undoubtedly have to expose ports, but I have no idea which ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So then I follow on to find two more components. &#8220;Kubectl&#8221;  runs on every node on the cluster and manages the &#8220;kubelets&#8221;.  Then &#8220;Kubeadm&#8221; runs on the Master machine and manages the cluster.  I hear words such as &#8220;Control Plane&#8221; and I&#8217;m drowning in confusion.  However, in the instructions for installing &#8220;Kubeadm&#8221; it goes on to install &#8220;Kubeadm&#8221; natively to the node.  Its all going down the pan as I can get nothing to work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SO!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I blat the two VMs and clone fresh ones (Great idea using Proxmox).  Then I find this chap on YouTube who guides us through the build of a two node cluster, and on Ubuntu specifically.  Hell, let&#8217;s link him in here.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"[ Kube 1.1 ] Setup Kubernetes Cluster using Kubeadm on Ubuntu 20.04\" width=\"640\" height=\"360\" data-src=\"https:\/\/www.youtube.com\/embed\/mMmxMoprxiY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So, following this and adjusting because he is using 20.04 and I am on 22.04.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It all went wrong.  The Kubelet would not start.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-vivid-purple-background-color has-text-color has-background has-small-font-size\"><code>\u25cf kubelet.service - kubelet: The Kubernetes Node Agent\n     Loaded: loaded (\/lib\/systemd\/system\/kubelet.service; enabled; vendor preset: enabled)\n    Drop-In: \/etc\/systemd\/system\/kubelet.service.d\n             \u2514\u250010-kubeadm.conf\n     Active: activating (auto-restart) (Result: exit-code) since Sun 2022-06-05 21:04:23 UTC; 6s ago\n       Docs: https:\/\/kubernetes.io\/docs\/home\/\n    Process: 1189 ExecStart=\/usr\/bin\/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=1\/<strong>FAILURE<\/strong>)\n   Main PID: 1189 (code=exited, status=1\/FAILURE)\n        CPU: 285ms\n\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:                 Insecure values: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --tls-min-version string                                   Minimum TLS version supported. Possible values: VersionTLS10, VersionTLS11, Version&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --tls-private-key-file string                              File containing x509 private key matching --tls-cert-file. (DEPRECATED: This parame&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --topology-manager-policy string                           Topology Manager policy to use. Possible values: 'none', 'best-effort', 'restricted&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --topology-manager-scope string                            Scope to which topology hints applied. Topology Manager collects hints from Hint Pr&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:   -v, --v Level                                                  number for the log level verbosity\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --version version&#91;=true]                                   Print version information and quit\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --vmodule pattern=N,...                                    comma-separated list of pattern=N settings for file-filtered logging (only works fo&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --volume-plugin-dir string                                 The full path of the directory in which to search for additional third party volume&gt;\nJun 05 21:04:23 jarvis-node1 kubelet&#91;1189]:       --volume-stats-agg-period duration                         Specifies interval for kubelet to calculate and cache the volume disk usage for all&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, so why?  Well, one of the aspects that is of concern is that Kubernetes isn&#8217;t yet supported on 22.04 and the instructions are to use the 20.04 repository.  Why does this sound dodgy?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solution is to build me two 20.04 VMs.  Done!  Much better success.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing that is immediately apparent now is that the Server that sits behind me and is running Proxmox and hosting these two VM&#8217;s, is now spooling its fans up and its getting quite warm in here.  Interesting!.  The server CPU load as gone up from 0,5% to 3% as a result of these VMs running, and as a result of running K8s.  So I shutdown both VMs and the CPU load returns to 0.5%.  I start up the Master Node only and I get 2.5%.  That seems to be the root cause, so theoretically, adding more Worker nodes shouldn&#8217;t work the platform harder.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So this is the next evening and the work yesterday ended with much frustration.  The presences of Kubelet seemed to knobble the network connectivity of my VMs.   I scratched my head, searched the net, experimented, but no joy.  So I called it a night.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This evening I blatted the nodes and started again, very carefully, very diligently.  Quietly but surely I found SUCCESS!  I have a Master node and a Worker node.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So based on this success I added three more VMs and set them up as worker nodes, finally joining the cluster.  It ran out with more success.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img decoding=\"async\" width=\"435\" height=\"198\" data-src=\"https:\/\/www.darmain.co.uk\/darmainworld\/wp-content\/uploads\/2022\/06\/Screenshot-from-2022-06-06-22-55-50.png\" alt=\"\" class=\"wp-image-800 lazyload\" data-srcset=\"https:\/\/www.darmain.co.uk\/darmainworld\/wp-content\/uploads\/2022\/06\/Screenshot-from-2022-06-06-22-55-50.png 435w, https:\/\/www.darmain.co.uk\/darmainworld\/wp-content\/uploads\/2022\/06\/Screenshot-from-2022-06-06-22-55-50-300x137.png 300w\" data-sizes=\"(max-width: 435px) 100vw, 435px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 435px; --smush-placeholder-aspect-ratio: 435\/198;\" \/><figcaption>So I have five nodes, five virtual servers, all running.  One is master and four are workers.  At this time they have no tasks to run, which is very interesting, because remembering that 0.5% processor load from last night.  Now Proxmox is reporting a constant 7% load, just to host the idling cluster.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The work nodes report 7% each and the Master node report 15%.  There is another node running but not built with K8s, which is reporting 1.2%.  My lab is getting nice and toasty.  Not very green, is it?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So my next task is to clone all this machines, so I don&#8217;t lose the initial state.  Then attempt to task the cluster.  That&#8217;ll be for another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 1 This subject has proven rather heavy. There are plenty of places on the net to describe what Kubernetes is. I get that. Now if I go to the home of Kubernetes at https:\/\/kubernetes.io\/ then I have an absolute load of information about installing, managing and,,,, well, I didn&#8217;t really get off of the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":735,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-798","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-cloud-servers"],"_links":{"self":[{"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/posts\/798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/comments?post=798"}],"version-history":[{"count":2,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/posts\/798\/revisions"}],"predecessor-version":[{"id":801,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/posts\/798\/revisions\/801"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/media\/735"}],"wp:attachment":[{"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/media?parent=798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/categories?post=798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.darmain.co.uk\/darmainworld\/index.php\/wp-json\/wp\/v2\/tags?post=798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}