{"id":380,"date":"2025-01-26T00:00:58","date_gmt":"2025-01-26T00:00:58","guid":{"rendered":"https:\/\/harrisonjonesit.co.uk\/?p=380"},"modified":"2025-03-26T09:07:29","modified_gmt":"2025-03-26T09:07:29","slug":"elementor-380","status":"publish","type":"post","link":"https:\/\/harrisonjonesit.co.uk\/?p=380","title":{"rendered":"Kubernetes App With Load Balancer Creation"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"380\" class=\"elementor elementor-380\">\n\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-31b37a9 e-flex e-con-boxed e-con e-parent\" data-id=\"31b37a9\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3841c33 elementor-widget elementor-widget-heading\" data-id=\"3841c33\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.18.0 - 20-12-2023 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h2 class=\"elementor-heading-title elementor-size-default\">Kubernetes Cluster Creation With Load balancer <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-9e7e217 e-flex e-con-boxed e-con e-parent\" data-id=\"9e7e217\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3b7ab7e elementor-widget elementor-widget-text-editor\" data-id=\"3b7ab7e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.18.0 - 20-12-2023 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>During my Cloud studies I learned about what Kubernetes clusters is and what it is used for, however recently through following senior professionals I have realised the best way to learn is to make these environments yourself so that&#8217;s what I attempted this weekend.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d0e79ce e-flex e-con-boxed e-con e-parent\" data-id=\"d0e79ce\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6958670 elementor-widget elementor-widget-text-editor\" data-id=\"6958670\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Firstly, What is Kubernetes? Kubernetes <span>also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications. Their capabilities and theory behind them can get quite advanced and complicated. For this test I just created a simple example of how they can be put into practice.<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2dea592 elementor-widget elementor-widget-image\" data-id=\"2dea592\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.18.0 - 20-12-2023 *\/\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"750\" height=\"579\" src=\"https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/cluster-dfiagram-1024x791.png\" class=\"attachment-large size-large wp-image-384\" alt=\"\" srcset=\"https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/cluster-dfiagram-1024x791.png 1024w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/cluster-dfiagram-300x232.png 300w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/cluster-dfiagram-768x593.png 768w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/cluster-dfiagram.png 1343w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\"><\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-a0e2003 e-flex e-con-boxed e-con e-parent\" data-id=\"a0e2003\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1e28ada elementor-widget elementor-widget-text-editor\" data-id=\"1e28ada\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To Start. I configured a Kubernetes cluster on Linode which created a set of 3, 2GB nodes in a cluster, basically 3 &#8216;worker&#8217; computers that link to the master node. The master node is what you interact with to configure. We do this through the KubeCTL application which I installed on my local Kali Linux VM. When creating a cluster on a cloud provider, it can generate a YAML file for you to connect straight to your instance through that KubeCTL app. For this demonstration it will just be hosting a test image i found on the web.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-46262fb e-flex e-con-boxed e-con e-parent\" data-id=\"46262fb\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2d5c263 elementor-widget elementor-widget-image\" data-id=\"2d5c263\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"655\" height=\"442\" src=\"https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/3-pod-creation-1.png\" class=\"attachment-large size-large wp-image-385\" alt=\"\" srcset=\"https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/3-pod-creation-1.png 655w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/3-pod-creation-1-300x202.png 300w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\"><\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d14db38 e-flex e-con-boxed e-con e-parent\" data-id=\"d14db38\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b0b626e elementor-widget elementor-widget-text-editor\" data-id=\"b0b626e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>As we can see above the YAML file was created and confirmed our pods are connected. I then created another YAML file based off an online template to configure load balancing for any nodes hosted on the &#8216;testapp&#8217; see code below.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3cf25a6 elementor-widget elementor-widget-text-editor\" data-id=\"3cf25a6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code><span>apiVersion<\/span><span>:<\/span><span> v1\n<\/span><span><\/span><span>kind<\/span><span>:<\/span><span> Service\n<\/span><span><\/span><span>metadata<\/span><span>:<\/span><span>\n<\/span><span>  <\/span><span>name<\/span><span>:<\/span><span> webapp<\/span><span>-<\/span><span>service\n<\/span><span><\/span><span>spec<\/span><span>:<\/span><span>\n<\/span><span>  <\/span><span>type<\/span><span>:<\/span><span> LoadBalancer\n<\/span><span>  <\/span><span>selector<\/span><span>:<\/span><span>\n<\/span><span>    <\/span><span>app<\/span><span>:<\/span><span> Harrisontest\n<\/span><span>  <\/span><span>ports<\/span><span>:<\/span><span>\n<\/span><span>  <\/span><span>-<\/span><span> <\/span><span>protocol<\/span><span>:<\/span><span> TCP\n<\/span><span>    <\/span><span>port<\/span><span>:<\/span><span> <\/span><span>80<\/span><span>\n<\/span><span>    <\/span><span>targetPort<\/span><span>:<\/span><span> <\/span><span>8080<\/span><\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-4bfddcf e-flex e-con-boxed e-con e-parent\" data-id=\"4bfddcf\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-86f96b2 elementor-widget elementor-widget-text-editor\" data-id=\"86f96b2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Finally, to confirm the load balancer was running, I went onto Linode to see that it was up in their load balancer section.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-95f103d e-flex e-con-boxed e-con e-parent\" data-id=\"95f103d\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2ca7d21 elementor-widget elementor-widget-image\" data-id=\"2ca7d21\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"750\" height=\"357\" src=\"https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/nodebalance2-1024x488.png\" class=\"attachment-large size-large wp-image-394\" alt=\"\" srcset=\"https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/nodebalance2-1024x488.png 1024w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/nodebalance2-300x143.png 300w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/nodebalance2-768x366.png 768w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/nodebalance2-1536x733.png 1536w, https:\/\/harrisonjonesit.co.uk\/wp-content\/uploads\/2024\/01\/nodebalance2.png 1698w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-65a82e6 e-flex e-con-boxed e-con e-parent\" data-id=\"65a82e6\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3607a7a elementor-widget__width-initial elementor-widget elementor-widget-text-editor\" data-id=\"3607a7a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Now I can see the load balancer is up this confirms the Load Balancer is up and the site is accessible.\u00a0<\/p>\n<p>-To summarize. I created a Kubernetes cluster in Linode, before installing KubeCTL on Kali in order to connect to the master node that was created to host the test image, then configure it to load balance that image across the 3 nodes.<\/p>\n<p>This was a very basic K8 project but a great introduction to containers, load balancing and availability.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Kubernetes Cluster Creation With Load balancer During my Cloud studies I learned about what Kubernetes clusters is and what it is used for, however recently through following senior professionals I have realised the best way to learn is to make these environments yourself so that&#8217;s what I attempted this weekend. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/380"}],"collection":[{"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=380"}],"version-history":[{"count":14,"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/380\/revisions"}],"predecessor-version":[{"id":402,"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/380\/revisions\/402"}],"wp:attachment":[{"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harrisonjonesit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}