{"id":3792,"date":"2023-01-16T21:10:10","date_gmt":"2023-01-16T15:40:10","guid":{"rendered":"https:\/\/www.itsupportwale.com\/blog\/?p=3792"},"modified":"2023-09-21T01:35:59","modified_gmt":"2023-09-20T20:05:59","slug":"how-to-install-and-configure-metallb-on-self-managed-kubernetes","status":"publish","type":"post","link":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/","title":{"rendered":"How to install and configure MetalLB on self-managed Kubernetes"},"content":{"rendered":"\n<p>Installing and configuring <a href=\"https:\/\/metallb.universe.tf\/\">MetalLB<\/a> on a self-managed Kubernetes cluster can be a crucial step in providing load balancing for your services. MetalLB is a load-balancer implementation for bare metal Kubernetes clusters to assign external IP addresses to services in a cluster. In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.<\/p>\n\n\n\n<p>Step 1: Install MetalLB<\/p>\n\n\n\n<p>The first step in installing MetalLB is to create a namespace for it and its components.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>kubectl create namespace metallb-system<\/code><\/pre>\n\n\n\n<p>Then, use Helm to install MetalLB in the metallb-system namespace.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>helm install metallb metallb\/metallb --namespace metallb-system\n<\/code><\/pre>\n\n\n\n<p>Step 2: Configure MetalLB<\/p>\n\n\n\n<p>After installing MetalLB we configure it to use a specific IP address range for your services. This can be done by creating a configMap with the desired IP range.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apiVersion: v1\nkind: ConfigMap\nmetadata:\n  namespace: metallb-system\n  name: config\ndata:\n  config: |\n    address-pools:\n    - name: default\n      protocol: layer2\n      addresses:\n      - 192.168.1.240-192.168.1.250\n<\/code><\/pre>\n\n\n\n<p>Step 3: Assign External IPs to Services<\/p>\n\n\n\n<p>With MetalLB configured, you can now assign external IPs to your services by specifying the &#8220;loadBalancerIP&#8221; field in the service definition.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apiVersion: v1\nkind: Service\nmetadata:\n  name: my-service\nspec:\n  selector:\n    app: my-app\n  ports:\n  - name: http\n    port: 80\n    targetPort: 80\n  type: LoadBalancer\n  loadBalancerIP: 192.168.1.245\n<\/code><\/pre>\n\n\n\n<p>Step 4: Verify the Installation<\/p>\n\n\n\n<p>To verify that MetalLB is properly installed and configured, you can check the service&#8217;s external IP using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>kubectl get svc my-service\n<\/code><\/pre>\n\n\n\n<p>With these steps, you should now have MetalLB installed and configured on your self-managed Kubernetes cluster. This will allow you to assign external IPs to your services and provide load balancing for them. It&#8217;s important to note that the IP range used in this article is for demonstration purposes only, you should use an appropriate IP range for your cluster.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Also Read: <a href=\"https:\/\/oracle.itsupportwale.com\/blog\/how-to-install-docker-on-ubuntu-20-04\/\">How to Install Docker on Ubuntu 20.04 LTS<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Installing and configuring MetalLB on a self-managed Kubernetes cluster can be a crucial step in providing load balancing for your services. MetalLB is a load-balancer implementation for bare metal Kubernetes clusters to assign external IP addresses to services in a cluster. In this article, we will go over the steps to install and configure MetalLB &#8230; <a title=\"How to install and configure MetalLB on self-managed Kubernetes\" class=\"read-more\" href=\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\" aria-label=\"Read more  on How to install and configure MetalLB on self-managed Kubernetes\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":3823,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[609,607,640],"tags":[643,645,627,642,641,644,628,227],"class_list":["post-3792","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containerization","category-devops","category-kubernetes","tag-how-to-use-kubernetes-ingress","tag-how-to-use-metallb-in-kubernetes","tag-kubernetes","tag-kubernetes-ingress","tag-kubernetes-ingress-controller","tag-kubernetes-tutorial","tag-metallb","tag-nginx"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to install and configure MetalLB on self-managed Kubernetes - ITSupportWale<\/title>\n<meta name=\"description\" content=\"In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install and configure MetalLB on self-managed Kubernetes - ITSupportWale\" \/>\n<meta property=\"og:description\" content=\"In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\" \/>\n<meta property=\"og:site_name\" content=\"ITSupportWale\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Itsupportwale-298547177495978\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-16T15:40:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-20T20:05:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"864\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Techie\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Techie\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\"},\"author\":{\"name\":\"Techie\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d\"},\"headline\":\"How to install and configure MetalLB on self-managed Kubernetes\",\"datePublished\":\"2023-01-16T15:40:10+00:00\",\"dateModified\":\"2023-09-20T20:05:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\"},\"wordCount\":251,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg\",\"keywords\":[\"how to use kubernetes ingress\",\"how to use metallb in kubernetes\",\"kubernetes\",\"kubernetes ingress\",\"kubernetes ingress controller\",\"kubernetes tutorial\",\"metallb\",\"nginx\"],\"articleSection\":[\"containerization\",\"DevOps\",\"Kubernetes\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\",\"url\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\",\"name\":\"How to install and configure MetalLB on self-managed Kubernetes - ITSupportWale\",\"isPartOf\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg\",\"datePublished\":\"2023-01-16T15:40:10+00:00\",\"dateModified\":\"2023-09-20T20:05:59+00:00\",\"description\":\"In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.\",\"breadcrumb\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage\",\"url\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg\",\"contentUrl\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg\",\"width\":864,\"height\":450,\"caption\":\"how-to-install-and-configure-metallb-on-self-managed-kubernetes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/itsupportwale.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install and configure MetalLB on self-managed Kubernetes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#website\",\"url\":\"https:\/\/itsupportwale.com\/blog\/\",\"name\":\"ITSupportWale\",\"description\":\"Tips, Tricks, Fixed-Errors, Tutorials &amp; Guides\",\"publisher\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/itsupportwale.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#organization\",\"name\":\"itsupportwale\",\"url\":\"https:\/\/itsupportwale.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png\",\"contentUrl\":\"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png\",\"width\":1119,\"height\":144,\"caption\":\"itsupportwale\"},\"image\":{\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Itsupportwale-298547177495978\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d\",\"name\":\"Techie\",\"sameAs\":[\"https:\/\/itsupportwale.com\",\"iswblogadmin\"],\"url\":\"https:\/\/itsupportwale.com\/blog\/author\/iswblogadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install and configure MetalLB on self-managed Kubernetes - ITSupportWale","description":"In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/","og_locale":"en_US","og_type":"article","og_title":"How to install and configure MetalLB on self-managed Kubernetes - ITSupportWale","og_description":"In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.","og_url":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/","og_site_name":"ITSupportWale","article_publisher":"https:\/\/www.facebook.com\/Itsupportwale-298547177495978","article_published_time":"2023-01-16T15:40:10+00:00","article_modified_time":"2023-09-20T20:05:59+00:00","og_image":[{"width":864,"height":450,"url":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg","type":"image\/jpeg"}],"author":"Techie","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Techie","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#article","isPartOf":{"@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/"},"author":{"name":"Techie","@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d"},"headline":"How to install and configure MetalLB on self-managed Kubernetes","datePublished":"2023-01-16T15:40:10+00:00","dateModified":"2023-09-20T20:05:59+00:00","mainEntityOfPage":{"@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/"},"wordCount":251,"commentCount":0,"publisher":{"@id":"https:\/\/itsupportwale.com\/blog\/#organization"},"image":{"@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage"},"thumbnailUrl":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg","keywords":["how to use kubernetes ingress","how to use metallb in kubernetes","kubernetes","kubernetes ingress","kubernetes ingress controller","kubernetes tutorial","metallb","nginx"],"articleSection":["containerization","DevOps","Kubernetes"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/","url":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/","name":"How to install and configure MetalLB on self-managed Kubernetes - ITSupportWale","isPartOf":{"@id":"https:\/\/itsupportwale.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage"},"image":{"@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage"},"thumbnailUrl":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg","datePublished":"2023-01-16T15:40:10+00:00","dateModified":"2023-09-20T20:05:59+00:00","description":"In this article, we will go over the steps to install and configure MetalLB on a Kubernetes cluster.","breadcrumb":{"@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#primaryimage","url":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg","contentUrl":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/01\/how-to-install-and-configure-metallb-on-self-managed-kubernetes-min.jpg","width":864,"height":450,"caption":"how-to-install-and-configure-metallb-on-self-managed-kubernetes"},{"@type":"BreadcrumbList","@id":"https:\/\/itsupportwale.com\/blog\/how-to-install-and-configure-metallb-on-self-managed-kubernetes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itsupportwale.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to install and configure MetalLB on self-managed Kubernetes"}]},{"@type":"WebSite","@id":"https:\/\/itsupportwale.com\/blog\/#website","url":"https:\/\/itsupportwale.com\/blog\/","name":"ITSupportWale","description":"Tips, Tricks, Fixed-Errors, Tutorials &amp; Guides","publisher":{"@id":"https:\/\/itsupportwale.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsupportwale.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/itsupportwale.com\/blog\/#organization","name":"itsupportwale","url":"https:\/\/itsupportwale.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png","contentUrl":"https:\/\/itsupportwale.com\/blog\/wp-content\/uploads\/2023\/09\/cropped-Logo-trans-without-slogan.png","width":1119,"height":144,"caption":"itsupportwale"},"image":{"@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Itsupportwale-298547177495978"]},{"@type":"Person","@id":"https:\/\/itsupportwale.com\/blog\/#\/schema\/person\/8c5a2b3d36396e0a8fd91ec8242fd46d","name":"Techie","sameAs":["https:\/\/itsupportwale.com","iswblogadmin"],"url":"https:\/\/itsupportwale.com\/blog\/author\/iswblogadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/posts\/3792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/comments?post=3792"}],"version-history":[{"count":0,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/posts\/3792\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/media\/3823"}],"wp:attachment":[{"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/media?parent=3792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/categories?post=3792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsupportwale.com\/blog\/wp-json\/wp\/v2\/tags?post=3792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}