{"id":3294,"date":"2024-07-09T11:45:30","date_gmt":"2024-07-09T15:45:30","guid":{"rendered":"https:\/\/arielantigua.com\/weblog\/?p=3294"},"modified":"2024-07-15T08:43:38","modified_gmt":"2024-07-15T12:43:38","slug":"cilium-bgp-lab-locally","status":"publish","type":"post","link":"https:\/\/arielantigua.com\/weblog\/2024\/07\/cilium-bgp-lab-locally\/","title":{"rendered":"Cilium BGP Lab, locally!"},"content":{"rendered":"<p>Maybe you already know about Cilium, You don\u2019t?<br \/>\nGo read <a href=\"https:\/\/docs.cilium.io\/en\/stable\/overview\/intro\/\">https:\/\/docs.cilium.io\/en\/stable\/overview\/intro\/<\/a> and come back !!<\/p>\n<p>Hello again!<br \/>\nSo now you want to learn about Cilium BGP functionality, for me this is one of the most exciting features of Cilium, maybe the reason is the addiction that I already have for BGP, who knows (<a href=\"https:\/\/bgp.he.net\/AS207036\">AS207036<\/a>). Back to the point, with Cilium you can establish a BGP session with your routers (Tor, border, or core, you decide.) and announce PodCIDR or LoadBalance for services.<\/p>\n<p>For this learning exercise, we will use Kind and other tools to run a K8s cluster locally on any Linux (Windows or MacOS) machine. There is a lot of info on the internet on how to get Kind up and running and even how to install Cilium, I decided to build a collection of Cilium Labs (<a href=\"https:\/\/github.com\/aredan\/ciliumlabs\">ciliumlabs<\/a>) to speed up the process of getting a Cilium testing environment up and running.<\/p>\n<p>First, go and clone the repo, all the information is on the README of each lab type, in this case, <a href=\"https:\/\/github.com\/aredan\/ciliumlabs\/blob\/main\/bgp\/README.md\">bgp\/README.md<\/a> is the one with the steps to get this ready, but we first need to install the prereqs. The prerequisites are listed in the main <a href=\"https:\/\/github.com\/aredan\/ciliumlabs\/blob\/main\/README.md\">README<\/a> file. In my environment, all this is met so I can proceed with the lab creation.<\/p>\n<p><!--more--><\/p>\n<p>Clone the repo to your local machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"204\" class=\"wp-image-3295\" src=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut.png\" alt=\"A computer screen with white text Description automatically generated\" srcset=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut.png 715w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-300x86.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"94\" class=\"wp-image-3296\" src=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/word-image-3294-2.png\" srcset=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/word-image-3294-2.png 791w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/word-image-3294-2-300x36.png 300w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/word-image-3294-2-768x91.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/p>\n<p>We are doing the BGP Lab, these are the files in that specific directory.<\/p>\n<p><strong>cilium-bgp-peering-policies.yaml<\/strong> \u2013 YAML file with the configuration needed to start the BGP session with Tor0 and Tor1 from the k8s workers.<\/p>\n<p><strong>cluster.yaml<\/strong> \u2013 configuration file for Kind cluster.<\/p>\n<p><strong>topo.yaml<\/strong> &#8211; configuration file for containerlab.<\/p>\n<p>There is a <strong>Makefile<\/strong>, an easy way to run tasks, you can read this file to understand the workflow to start the Lab, the fastest way is just to run <strong>make<\/strong>.<\/p>\n<p><a href=\"https:\/\/asciinema.org\/a\/3Rh6hi4nnMCiBDyif0h0gbbci\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/asciinema.org\/a\/3Rh6hi4nnMCiBDyif0h0gbbci.svg\" \/><\/a><\/p>\n<p>Let\u2019s see what we have here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1218\" height=\"329\" class=\"wp-image-3297\" src=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-1.png\" alt=\"A computer screen with white text Description automatically generated\" srcset=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-1.png 1218w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-1-300x81.png 300w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-1-1024x277.png 1024w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-1-768x207.png 768w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-computer-screen-with-white-text-description-aut-1-1200x324.png 1200w\" sizes=\"auto, (max-width: 1218px) 100vw, 1218px\" \/><\/p>\n<p>Looking at router0, we can see that both tor0 and tor1 established the BGP peering and router0 is receiving prefixes from those tor routers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1456\" height=\"329\" class=\"wp-image-3298\" src=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screenshot-of-a-computer-description-automatica.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screenshot-of-a-computer-description-automatica.png 1456w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screenshot-of-a-computer-description-automatica-300x68.png 300w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screenshot-of-a-computer-description-automatica-1024x231.png 1024w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screenshot-of-a-computer-description-automatica-768x174.png 768w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screenshot-of-a-computer-description-automatica-1200x271.png 1200w\" sizes=\"auto, (max-width: 1456px) 100vw, 1456px\" \/><\/p>\n<p>In this Lab topology tor0 is part of the Rack0 segmentation, in this rack is the participation of the control-plane node and a worker (you can see this in the yaml files for kind and containerlab). They are establishing BGP peering and exporting routes!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1414\" height=\"327\" class=\"wp-image-3299\" src=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screen-shot-of-a-computer-description-automatic.png\" alt=\"A screen shot of a computer Description automatically generated\" srcset=\"https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screen-shot-of-a-computer-description-automatic.png 1414w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screen-shot-of-a-computer-description-automatic-300x69.png 300w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screen-shot-of-a-computer-description-automatic-1024x237.png 1024w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screen-shot-of-a-computer-description-automatic-768x178.png 768w, https:\/\/arielantigua.com\/weblog\/wp-content\/uploads\/2024\/07\/a-screen-shot-of-a-computer-description-automatic-1200x278.png 1200w\" sizes=\"auto, (max-width: 1414px) 100vw, 1414px\" \/><\/p>\n<p>Same for tor1, here the segmentation is called Rack1, and worker2 and worker3 are establishing BGP session!!<\/p>\n<p>Now what?<br \/>\nFrom here you can go to the official Cilium Labs and earn a badge for Cilium with BGP!<\/p>\n<p><a href=\"https:\/\/isovalent.com\/labs\/cilium-bgp\/\">https:\/\/isovalent.com\/labs\/cilium-bgp\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maybe you already know about Cilium, You don\u2019t? Go read https:\/\/docs.cilium.io\/en\/stable\/overview\/intro\/ and come back !! Hello again! So now you want to learn about Cilium BGP functionality, for me this is one of the most exciting features of Cilium, maybe the reason is the addiction that I already have for BGP, who knows (AS207036). Back [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,128,34],"tags":[142,158,159,139],"class_list":["post-3294","post","type-post","status-publish","format-standard","hentry","category-general","category-kubernetes","category-networking","tag-bgp","tag-cilium","tag-ebpf","tag-kubernetes"],"_links":{"self":[{"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/posts\/3294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/comments?post=3294"}],"version-history":[{"count":3,"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/posts\/3294\/revisions"}],"predecessor-version":[{"id":3330,"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/posts\/3294\/revisions\/3330"}],"wp:attachment":[{"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/media?parent=3294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/categories?post=3294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arielantigua.com\/weblog\/wp-json\/wp\/v2\/tags?post=3294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}