{"id":584,"date":"2023-12-14T19:38:27","date_gmt":"2023-12-14T19:38:27","guid":{"rendered":"http:\/\/virtuality.pt\/?p=584"},"modified":"2023-12-14T22:22:15","modified_gmt":"2023-12-14T22:22:15","slug":"deploying-a-kubernetes-cluster-with-kubeadm-on-top-of-vagrant-boxes-on-vmware-fusion","status":"publish","type":"post","link":"https:\/\/virtuality.pt\/?p=584","title":{"rendered":"Deploying a Kubernetes cluster with kubeadm on top of Vagrant Boxes on VMware Fusion"},"content":{"rendered":"\n<p>Yesterday, I utilized Vagrant to deploy three VMs on my laptop through VMware Fusion. Now, I&#8217;m gearing up to configure a Kubernetes cluster for testing and study purposes\u2014ideal for when I&#8217;m on the move or when my primary lab isn&#8217;t accessible.<\/p>\n\n\n\n<p>With these VMs in place, I&#8217;ll designate one as the master node and the remaining two as workers. Following standard Kubernetes setup procedures, I&#8217;ll initialize the master node, join the workers, and it will be ready to begin deploying and testing applications within this simulated cluster environment.<\/p>\n\n\n\n<p>Vagrant&#8217;s convenience lies in its ability to swiftly recreate these VMs and experiment with diverse configurations without impacting my primary setup. This flexibility proves invaluable for testing and learning experiences.<\/p>\n\n\n\n<p>Before starting the configuration it&#8217;s advised to always check the requisites:<\/p>\n\n\n\n<p><a href=\"https:\/\/kubernetes.io\/docs\/setup\/production-environment\/tools\/kubeadm\/install-kubeadm\/\">https:\/\/kubernetes.io\/docs\/setup\/production-environment\/tools\/kubeadm\/install-kubeadm\/<\/a><\/p>\n\n\n\n<p>Important disable swap on all nodes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>## note that this is temporary and when you reboot the machine it will use swap again\n\nswapoff -a\n\n# in my case i know that the swap in \/etc\/fstab starts with \/swap.img\n\nsudo sed -i 's|\\(^\/swap\\)|#\\1|' \/etc\/fstab\n \n# i run this sed to add a # before the \/swap you can allways\n\nsudo vi \/etc\/fstab <\/code><\/pre>\n\n\n\n<p>and disable swap mount on boot<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"394\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-102-1024x394.png\" alt=\"\" class=\"wp-image-604\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-102-1024x394.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-102-300x115.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-102-768x295.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-102.png 1171w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After validating the requisites, let&#8217;s deploy the container runtime with more detailed info in:<\/p>\n\n\n\n<p><a href=\"https:\/\/kubernetes.io\/docs\/setup\/production-environment\/container-runtimes\">https:\/\/kubernetes.io\/docs\/setup\/production-environment\/container-runtimes<\/a><\/p>\n\n\n\n<p>In my case, I will deploy containerd but there are more container runtimes you can choose check the link above if you don&#8217;t want to use containerd.<\/p>\n\n\n\n<p><strong>ON ALL NODES !!!<\/strong><\/p>\n\n\n\n<p>Modules and filters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &lt;&lt;EOF | sudo tee \/etc\/modules-load.d\/k8s.conf\noverlay\nbr_netfilter\nEOF\n\nsudo modprobe overlay\nsudo modprobe br_netfilter\n\n# sysctl params required by setup, params persist across reboots\n\ncat &lt;&lt;EOF | sudo tee \/etc\/sysctl.d\/k8s.conf\nnet.bridge.bridge-nf-call-iptables  = 1\nnet.bridge.bridge-nf-call-ip6tables = 1\nnet.ipv4.ip_forward                 = 1\nEOF\n\n# Apply sysctl params without reboot\nsudo sysctl --system<\/code><\/pre>\n\n\n\n<p>check if modules are loaded:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsmod |grep br_netfilter<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"477\" height=\"97\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-85.png\" alt=\"\" class=\"wp-image-585\" style=\"width:840px;height:auto\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-85.png 477w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-85-300x61.png 300w\" sizes=\"auto, (max-width: 477px) 100vw, 477px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s also check if the filters are set to 1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward\n\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"84\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-86-1024x84.png\" alt=\"\" class=\"wp-image-586\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-86-1024x84.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-86-300x25.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-86-768x63.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-86.png 1088w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Install containerd from docker Repo:<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/\">https:\/\/docs.docker.com\/engine\/install\/ubuntu\/<\/a><\/p>\n\n\n\n<p><strong>ON ALL NODES !!!<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get install ca-certificates curl gnupg\nsudo install -m 0755 -d \/etc\/apt\/keyrings\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/docker.gpg\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.gpg\n\n# Add the repository to Apt sources:\necho \\\n  \"deb &#91;arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.gpg] https:\/\/download.docker.com\/linux\/ubuntu \\\n  $(. \/etc\/os-release &amp;&amp; echo \"$VERSION_CODENAME\") stable\" | \\\n  sudo tee \/etc\/apt\/sources.list.d\/docker.list > \/dev\/null\nsudo apt-get update<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1006\" height=\"863\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-87.png\" alt=\"\" class=\"wp-image-587\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-87.png 1006w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-87-300x257.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-87-768x659.png 768w\" sizes=\"auto, (max-width: 1006px) 100vw, 1006px\" \/><\/figure>\n\n\n\n<p>now install containerd (on all nodes :))<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install containerd.io<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"580\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-88.png\" alt=\"\" class=\"wp-image-588\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-88.png 1003w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-88-300x173.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-88-768x444.png 768w\" sizes=\"auto, (max-width: 1003px) 100vw, 1003px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s check if it&#8217;s running and installed<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status containerd<\/code><\/pre>\n\n\n\n<p><strong>Guess what? ON ALL NODES \ud83d\ude42<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"260\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-89.png\" alt=\"\" class=\"wp-image-589\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-89.png 897w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-89-300x87.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-89-768x223.png 768w\" sizes=\"auto, (max-width: 897px) 100vw, 897px\" \/><\/figure>\n\n\n\n<p>we are using Ubuntu and if you run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps -p 1<\/code><\/pre>\n\n\n\n<p>You will see that Ubuntu is running Systemd<\/p>\n\n\n\n<p>When&nbsp;<a href=\"https:\/\/www.freedesktop.org\/wiki\/Software\/systemd\/\">systemd<\/a>&nbsp;is chosen as the init system for a Linux distribution, the init process generates and consumes a root control group (<code>cgroup<\/code>) and acts as a cgroup manager.<\/p>\n\n\n\n<p>systemd has a tight integration with cgroups and allocates a cgroup per systemd unit. As a result, if you use&nbsp;<code>systemd<\/code>&nbsp;as the init system with the&nbsp;<code>cgroupfs<\/code>&nbsp;driver, the system gets two different cgroup managers.<\/p>\n\n\n\n<p>Two cgroup managers result in two views of the available and in-use resources in the system. In some cases, nodes that are configured to use\u00a0<code>cgroupfs<\/code>\u00a0for the kubelet and container runtime, but use\u00a0<code>systemd<\/code>\u00a0for the rest of the processes become unstable under resource pressure.<\/p>\n\n\n\n<p>To play safe just run this on all nodes<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo containerd config default | sudo tee \/etc\/containerd\/config.toml\n\nsudo sudo sed -i 's\/SystemdCgroup \\= false\/SystemdCgroup \\= true\/g' \/etc\/containerd\/config.toml\n\nsudo systemctl restart containerd\n\nsudo systemctl status containerd<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"382\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-90-1024x382.png\" alt=\"\" class=\"wp-image-590\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-90-1024x382.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-90-300x112.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-90-768x287.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-90.png 1403w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Ok at this time the container runtime is ready<\/p>\n\n\n\n<p><strong>On ALL NODES \ud83d\ude42<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get install -y apt-transport-https ca-certificates curl gpg<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"333\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-91.png\" alt=\"\" class=\"wp-image-591\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-91.png 855w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-91-300x117.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-91-768x299.png 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.29\/deb\/Release.key | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/kubernetes-apt-keyring.gpg\n\n#and \n\necho 'deb &#91;signed-by=\/etc\/apt\/keyrings\/kubernetes-apt-keyring.gpg] https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.29\/deb\/ \/' | sudo tee \/etc\/apt\/sources.list.d\/kubernetes.list<\/code><\/pre>\n\n\n\n<p>Install kubelet , kubeadm and kubectl<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get install -y kubelet kubeadm kubectl\nsudo apt-mark hold kubelet kubeadm kubectl<\/code><\/pre>\n\n\n\n<p><strong>Now let&#8217;s start the cluster configuration:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>##just on the Masternode\n\nsudo kubeadm init --pod-network-cidr=10.210.0.0\/16 --apiserver-advertise-address=192.168.0.235\n\n### in my case i wanted to use the IPS : 192.168.0.x for kubernetes  192.168.0.235 it's the kmaster01 ip aka master node they where defined on Vagrantfile on the past post<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-92-1024x471.png\" alt=\"\" class=\"wp-image-592\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-92-1024x471.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-92-300x138.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-92-768x354.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-92.png 1414w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"401\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-93-1024x401.png\" alt=\"\" class=\"wp-image-593\" style=\"width:840px;height:auto\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-93-1024x401.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-93-300x117.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-93-768x301.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-93.png 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"396\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-94-1024x396.png\" alt=\"\" class=\"wp-image-594\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-94-1024x396.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-94-300x116.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-94-768x297.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-94.png 1028w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Note that is important to copy the kubeadm join text and save it on a file because we are going to use it later to join the nodes.<\/p>\n\n\n\n<p>Let&#8217;s run the instructions on the Screen<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p $HOME\/.kube\nsudo cp -i \/etc\/kubernetes\/admin.conf $HOME\/.kube\/config\nsudo chown $(id -u):$(id -g) $HOME\/.kube\/config\n\n##i have run this with my user cpotrica<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"92\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-95.png\" alt=\"\" class=\"wp-image-595\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-95.png 659w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-95-300x42.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/figure>\n\n\n\n<p>Now let&#8217;s setup the CNI for Pod networking there are lots of solutions here is a list:<\/p>\n\n\n\n<p><a href=\"https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/addons\/\">https:\/\/kubernetes.io\/docs\/concepts\/cluster-administration\/addons\/<\/a><\/p>\n\n\n\n<p>I&#8217;m going to use Antrea (I Wonder why \ud83d\ude42 )<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f https:\/\/raw.githubusercontent.com\/vmware-tanzu\/antrea\/master\/build\/yamls\/antrea.yml\n\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"678\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-96-1024x678.png\" alt=\"\" class=\"wp-image-596\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-96-1024x678.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-96-300x199.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-96-768x508.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-96.png 1248w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s Join the Nodes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># @ knode01 and knode02\n\nkubeadm join 192.168.0.235:6443 --token m1q7ou.16exuspsnhi81cxk \\\n\n--discovery-token-ca-cert-hash sha256:d51ff7073131a64eaab1689f743a17484a0f9dc88d5f45a305af411b5d5256aa\n\n## note that this will be the information after you kubeadm init not mine.<\/code><\/pre>\n\n\n\n<p>knode01<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"976\" height=\"265\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-97.png\" alt=\"\" class=\"wp-image-597\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-97.png 976w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-97-300x81.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-97-768x209.png 768w\" sizes=\"auto, (max-width: 976px) 100vw, 976px\" \/><\/figure>\n\n\n\n<p>knode02<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"254\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-98-1024x254.png\" alt=\"\" class=\"wp-image-598\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-98-1024x254.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-98-300x74.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-98-768x191.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-98.png 1092w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>On master node &#8220;kmaster01&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get nodes <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"111\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-99.png\" alt=\"\" class=\"wp-image-599\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-99.png 541w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-99-300x62.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/figure>\n\n\n\n<p>you will see knode01 and knode02 as workers<\/p>\n\n\n\n<p>Let&#8217;s check on the master node the system pods running<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get pod -o wide -A<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"223\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-100-1024x223.png\" alt=\"\" class=\"wp-image-600\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-100-1024x223.png 1024w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-100-300x65.png 300w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-100-768x167.png 768w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-100.png 1407w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now let&#8217;s create a small pod just to test<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl run nginx --image=nginx\n\n#create the an nginx pod just for testing\n\n#check if its available and running\n\nkubectl get pod<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"521\" src=\"http:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-101.png\" alt=\"\" class=\"wp-image-601\" srcset=\"https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-101.png 728w, https:\/\/virtuality.pt\/wp-content\/uploads\/2023\/12\/image-101-300x215.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/figure>\n\n\n\n<p>At this point, we have a running Kubernetes cluster on the Vagrant box we created before !!<\/p>\n\n\n\n<p>Shortly, I plan to delve deeper into this cluster setup. My upcoming posts will explore more advanced topics, such as implementing a load balancer, orchestrating deployments, and diving into other intricate functionalities.<\/p>\n\n\n\n<p>HF !!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday, I utilized Vagrant to deploy three VMs on my laptop through VMware Fusion. Now, I&#8217;m gearing up to configure a Kubernetes cluster for testing and study purposes\u2014ideal for when I&#8217;m on the move or when my primary lab isn&#8217;t accessible. With these VMs in place, I&#8217;ll designate one as the master node and the remaining two as workers. Following standard Kubernetes setup procedures, I&#8217;ll initialize the master node, join the workers, and it will be ready to begin deploying and testing applications within this simulated cluster environment. Vagrant&#8217;s convenience lies in its ability to swiftly recreate these VMs and experiment with diverse configurations without impacting my primary setup. This flexibility proves invaluable for testing and learning experiences. Before starting <a href=\"https:\/\/virtuality.pt\/?p=584\" class=\"btn btn-link continue-link\">Read More \/ Ler Mais<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/virtuality.pt\/index.php?rest_route=\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtuality.pt\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtuality.pt\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtuality.pt\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtuality.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":2,"href":"https:\/\/virtuality.pt\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/virtuality.pt\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/virtuality.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtuality.pt\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtuality.pt\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}