{"id":137986,"date":"2023-07-04T09:23:22","date_gmt":"2023-07-04T06:23:22","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=137986"},"modified":"2023-10-07T10:45:05","modified_gmt":"2023-10-07T07:45:05","slug":"install-kubernetes-using-talos-container-linux","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/install-kubernetes-using-talos-container-linux\/","title":{"rendered":"Install Kubernetes Cluster using Talos Container Linux"},"content":{"rendered":"\n<p><strong>Kubernetes<\/strong> is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It was originally developed by <strong>Google<\/strong> and is now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes is designed to run distributed applications across clusters of hosts, providing mechanisms for container scheduling, scaling, service discovery, load balancing, and many more.<\/p>\n\n\n\n<p>Kubernetes has become a fundamental technology in the world of cloud-native computing and has gained significant popularity and adoption in recent years. Some of the key benefits brought by this tool to the tech world are portability, flexibility, scalability, high availability, and automation of various tasks such as container deployment, scaling, and load balancing.<\/p>\n\n\n\n<p>There are several popular distributions of Kubernetes available that provide additional features, management tools, and support services on top of the core Kubernetes platform. Some of the well-known Kubernetes distributions include; Amazon Elastic Kubernetes Service (EKS), Google Kubernetes Engine (GKE), VMware Tanzu, Rancher, Red Hat OpenShift etc. Today we will learn how to set up a multi-node Kubernetes Cluster using Talos Container Linux<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is Talos Container Linux?<\/h3>\n\n\n\n<p><strong>Talos<\/strong> is a Linux distribution specifically designed for distributed systems like Kubernetes, offering a container-optimized environment. It is a modern Linux distribution built from scratch with the goal of providing an optimized and secure platform for distributed systems.<\/p>\n\n\n\n<p>The origin of Talos Linux can be traced back to a project initiated by the CoreOS team, which was later acquired by Red Hat in 2018. CoreOS had developed a container-focused Linux distribution called CoreOS Container Linux, which became popular in the Kubernetes ecosystem. However, after the acquisition by Red Hat, the focus shifted towards integrating CoreOS technologies into Red Hat&#8217;s portfolio.<\/p>\n\n\n\n<p>In response to the changing landscape, a group of former CoreOS engineers, led by <strong><em>Eric Chiang<\/em><\/strong>, decided to continue the development of a lightweight and specialized Linux distribution for Kubernetes. This led to the creation of Talos Linux as a community-driven project. Talos takes a unique approach by prioritizing minimalism and practicality, resulting in a set of distinctive features:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Immutable<\/strong>: It operates on the principle of immutability, meaning that its core components are not modifiable once deployed. This approach enhances system stability and reduces the risk of unintended changes.<\/li>\n\n\n\n<li><strong>Atomic<\/strong>: It adopts an atomic design, ensuring that system updates and changes are applied as a single, indivisible unit. This approach simplifies management and ensures consistent system behaviour.<\/li>\n\n\n\n<li><strong>Ephemeral<\/strong>: It treats its instances as ephemeral entities, which means they can be easily created, replaced, or terminated. This flexibility enables efficient scaling and dynamic allocation of resources.<\/li>\n\n\n\n<li><strong>Minimal<\/strong>: It follows a minimalistic approach, striving to provide the necessary functionality while minimizing resource consumption and complexity. This simplicity makes it easier to manage and reduces attack vectors.<\/li>\n\n\n\n<li><strong>Secure by default<\/strong>: It prioritizes security by implementing secure defaults and configurations out of the box. This approach helps protect the system from potential vulnerabilities and ensures a more secure deployment.<\/li>\n\n\n\n<li><strong>Single declarative configuration<\/strong>: It is managed through a single declarative configuration file and a gRPC API. This unified management approach simplifies administration and allows for easy automation and integration with other tools.<\/li>\n\n\n\n<li><strong>Platform compatibility<\/strong>: It can be deployed on various platforms, including container runtimes, cloud environments, virtualized infrastructures, and bare metal servers. This flexibility enables deployment across a wide range of environments and infrastructure choices.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">System Requirements<\/h3>\n\n\n\n<p>To spin the Kubernetes Cluster you need to set up Talos Linux machines with the below hardware requirements.<\/p>\n\n\n\n<p><strong>Minimum Requirements<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Task<\/th><th>Memory<\/th><th>Cores<\/th><th>System Disk<\/th><\/tr><\/thead><tbody><tr><td>Control Plane<\/td><td>2 GiB<\/td><td>2<\/td><td>10 GiB<\/td><\/tr><tr><td>Worker<\/td><td>1 GiB<\/td><td>1<\/td><td>10 GiB<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Recommended<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Task<\/th><th>Memory<\/th><th>Cores<\/th><th>System Disk<\/th><\/tr><\/thead><tbody><tr><td>Control Plane<\/td><td>4 GiB<\/td><td>4<\/td><td>100 GiB<\/td><\/tr><tr><td>Worker<\/td><td>2 GiB<\/td><td>2<\/td><td>100 GiB<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Aside from spinning Talos Linux on bare metal, you can also run it in a virtualized environment with Hyper-V, KVM, Proxmox, VMware, Xen etc.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Install talosctl on your system<\/h2>\n\n\n\n<p><code>talosctl<\/code> is a CLI tool that makes interfacing with the Talos API easy. Before we proceed, we need to install it. The command for that is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -sL https:\/\/talos.dev\/install | sh<\/code><\/pre>\n\n\n\n<p>Sample Output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"989\" height=\"635\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux.png\" alt=\"\" class=\"wp-image-138013\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux.png 989w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-300x193.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-768x493.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-696x447.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-654x420.png 654w\" sizes=\"auto, (max-width: 989px) 100vw, 989px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. Set up the Talos Linux Nodes<\/h2>\n\n\n\n<p>For this guide, we will work with 3 Talos Linux nodes(1 master node with 2 worker nodes). As said earlier, I will be using KVM to run the VMs. <\/p>\n\n\n\n<p>First, download the ISO file from their <a href=\"https:\/\/github.com\/siderolabs\/talos\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub Releases<\/a> page. As of this guide, the latest release was at 1.4.0. <\/p>\n\n\n\n<p>The ISO files can be pulled using Wget as shown:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">##For amd64<\/mark><\/em>\nVER=$(curl -s https:\/\/api.github.com\/repos\/siderolabs\/talos\/releases\/latest|grep tag_name|cut -d '\"' -f 4|sed 's\/v\/\/')<em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\n<\/mark><\/em>wget https:\/\/github.com\/siderolabs\/talos\/releases\/download\/v${VER}\/talos-amd64.iso\n\n<em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">##For RM64\n<\/mark><\/em>wget https:\/\/github.com\/siderolabs\/talos\/releases\/download\/v${VER}\/talos-arm64.iso<\/code><\/pre>\n\n\n\n<p>Once downloaded, you can create the Talos Linux nodes on your desired hypervisor. You can also do some automation with <a href=\"https:\/\/www.talos.dev\/v1.4\/talos-guides\/install\/virtualized-platforms\/vagrant-libvirt\/\" target=\"_blank\" rel=\"noreferrer noopener\">Vagrant &amp; Libvirt<\/a> for KVM or Terraform.<\/p>\n\n\n\n<p>The steps for creating a VM that meets the desired specifications are almost similar on all the hypervisors. But one this you need to ensure is that the network set for the VM has <strong>internet access<\/strong> since there are images required when spinning the Kubernetes cluster. <\/p>\n\n\n\n<p>For Virtualbox, you can automate the creation with Vagrant:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/using-vagrant-with-virtualbox-kvm-on-rocky\/\" target=\"_blank\" rel=\"noreferrer noopener\">Using Vagrant With VirtualBox \/ KVM on Rocky Linux 9<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-vagrant-and-virtualbox-on-fedora\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Vagrant and VirtualBox on Fedora<\/a><\/li>\n<\/ul>\n\n\n\n<p>Verify the installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">vagrant --version<\/mark>\nVagrant x.y.z<\/code><\/pre>\n\n\n\n<p>You can provision the VMS on VirtualBox using the below Vagrant file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Vagrant.configure(\"2\") do |config|\n  ## Master node\n  config.vm.define \"control-plane-node-1\" do |vm|\n    vm.vm.box = \"ubuntu\/bionic64\"\n    vm.vm.provider :virtualbox do |vb|\n      vb.memory = 4096\n      vb.cpus = 2\n      vb.customize &#91;'modifyvm', :id, '--nic1', 'bridged', '--bridgeadapter1', 'ens18']\n      vb.customize &#91;'storageattach', :id, '--storagectl', 'IDE', '--port', '1', '--device', '0', '--type', 'dvddrive', '--medium', '\/tmp\/talos-amd64.iso']\n      vb.customize &#91;\"createmedium\", \"disk\", \"--filename\", \"master1_disk.vdi\", \"--format\", \"VDI\", \"--size\", \"20096\"]\n      vb.customize &#91;'storagectl', :id, '--name', 'SATA Controller', '--add', 'sata']\n      vb.customize &#91;'storageattach', :id, '--storagectl', 'SATA Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'master1_disk.vdi']\n    end\n  end\n\n  ## Worker Node1\n  config.vm.define \"worker1\" do |vm|\n    vm.vm.box = \"ubuntu\/bionic64\"\n    vm.vm.provider :virtualbox do |vb|\n      vb.memory = 2048\n      vb.cpus = 1\n      vb.customize &#91;'modifyvm', :id, '--nic1', 'bridged', '--bridgeadapter1', 'ens18']\n      vb.customize &#91;'storageattach', :id, '--storagectl', 'IDE', '--port', '1', '--device', '0', '--type', 'dvddrive', '--medium', '\/tmp\/talos-amd64.iso']\n      vb.customize &#91;\"createmedium\", \"disk\", \"--filename\", \"worker1_disk.vdi\", \"--format\", \"VDI\", \"--size\", \"20096\"]\n      vb.customize &#91;'storagectl', :id, '--name', 'SATA Controller', '--add', 'sata']\n      vb.customize &#91;'storageattach', :id, '--storagectl', 'SATA Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'worker1_disk.vdi']\n    end\n  end\n\n  ## Worker Node2\n  config.vm.define \"worker2\" do |vm|\n    vm.vm.box = \"ubuntu\/bionic64\"\n    vm.vm.provider :virtualbox do |vb|\n      vb.memory = 2048\n      vb.cpus = 1\n      vb.customize &#91;'modifyvm', :id, '--nic1', 'bridged', '--bridgeadapter1', 'ens18']\n      vb.customize &#91;'storageattach', :id, '--storagectl', 'IDE', '--port', '1', '--device', '0', '--type', 'dvddrive', '--medium', '\/tmp\/talos-amd64.iso']\n      vb.customize &#91;\"createmedium\", \"disk\", \"--filename\", \"worker2_disk.vdi\", \"--format\", \"VDI\", \"--size\", \"20096\"]\n      vb.customize &#91;'storagectl', :id, '--name', 'SATA Controller', '--add', 'sata']\n      vb.customize &#91;'storageattach', :id, '--storagectl', 'SATA Controller', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', 'worker2_disk.vdi']\n    end\n  end\nend<\/code><\/pre>\n\n\n\n<p>Fire up the VMs on VirtualBox:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vagrant up control-plane-node-1 --provider=virtualbox\nvagrant up worker1 --provider=virtualbox\nvagrant up worker2 --provider=virtualbox<\/code><\/pre>\n\n\n\n<p>Because Vagrant always wants to connect to the VM, we can start individual VMs, once it fails to make an SSH connection, press <strong>CTRL+C a<\/strong>nd run the next.<\/p>\n\n\n\n<p>Once all the VMs have been started, view the status.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> vagrant status<\/mark>\nCurrent machine states:\n\ncontrol-plane-node-1      running (virtualbox)\nworker1                   running (virtualbox)\nworker2                   running (virtualbox)\n\nThis environment represents multiple VMs. The VMs are all listed\nabove with their current state. For more information about a specific\nVM, run `vagrant status NAME`.<\/code><\/pre>\n\n\n\n<p>Once the VMs are started, they will boot into the live mode, Talos doesn&#8217;t make any installations to the hard disk until the configurations are passed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"697\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-1.png\" alt=\"\" class=\"wp-image-138014\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-1.png 972w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-1-300x215.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-1-768x551.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-1-696x499.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-1-586x420.png 586w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/figure>\n\n\n\n<p>Make network configurations, and set the hostname, static IP address and DNS by pressing <strong>F3<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"557\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-2.png\" alt=\"\" class=\"wp-image-138016\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-2.png 866w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-2-300x193.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-2-768x494.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-2-696x448.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-2-653x420.png 653w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/figure>\n\n\n\n<p>Save the configurations and proceed to spin the Kubernetes cluster as shown below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Create Kubernetes Cluster using talosctl<\/h2>\n\n\n\n<p>I have the below configurations for my environment:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Task<\/strong><\/td><td><strong>Hostname<\/strong><\/td><td><strong>IP address<\/strong><\/td><\/tr><tr><td>master<\/td><td>master.computingforgeeks.com<\/td><td>192.168.200.105<\/td><\/tr><tr><td>worker node1<\/td><td>worker1.computingforgeeks.com<\/td><td>192.168.200.106<\/td><\/tr><tr><td>worker node2<\/td><td>worker2.computingforgeeks.com<\/td><td>192.168.200.107<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Using the CLI tool, we can create machine configs and use them for installing Talos and Kubernetes. Using the IP\/Domain name of the load balancer\/controller node, generate the base configuration files for the VMs.<\/p>\n\n\n\n<p>For this guide, we will use the master node IP(<em><strong>192.168.200.105<\/strong><\/em>), but this can be the LoadBalancer IP,  in production environments with multiple controller nodes.<\/p>\n\n\n\n<p>Generate the secret:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl gen secrets -o secrets.yaml<\/code><\/pre>\n\n\n\n<p>Now create the configuration files. The command has the below syntax:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl gen config --with-secrets secrets.yaml &lt;cluster-name&gt; &lt;cluster-endpoint&gt;<\/code><\/pre>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl gen config --with-secrets secrets.yaml my-cluster https:\/\/192.168.200.105:6443 \\\n    --output-dir _out <\/code><\/pre>\n\n\n\n<p>The <strong>_out<\/strong> is used as the output path for the created files. After this, you will have configs generated:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>generating PKI and tokens\nCreated _out\/controlplane.yaml\nCreated _out\/worker.yaml\nCreated _out\/talosconfig<\/code><\/pre>\n\n\n\n<p>The<strong> .yaml<\/strong> files serve different purposes in configuring and managing the systems. <strong>talosconfig<\/strong> file is a YAML-based configuration file used on the local client side. It contains settings and parameters that tailor the behaviour of the Talos client. This file allows you to customize and fine-tune various aspects of the Talos client to align with your specific requirements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Start the Control Node<\/h3>\n\n\n\n<p>Now using the controller YAML, we will fire up the control node. But before that, you can check the disk and view the name because the default configuration defines the installation disk as <strong>\/dev\/sda<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> talosctl -n <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">192.168.200.105<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> disks --insecure<\/mark>\nDEV        MODEL           SERIAL   TYPE   UUID   WWID   MODALIAS      NAME   SIZE    BUS_PATH                                                                   SUBSYSTEM          SYSTEM_DISK\n\/dev\/sda   QEMU HARDDISK   -        HDD    -      -      scsi:t-0x00   -      22 GB   \/pci0000:00\/0000:00:01.1\/0000:02:00.0\/virtio1\/host6\/target6:0:0\/6:0:0:0\/   \/sys\/class\/block <\/code><\/pre>\n\n\n\n<p>The disk can be something else on your setup, you can modify the <strong><em>controlplane.yaml<\/em><\/strong> file to accommodate it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    # Used to provide instructions for installations.\n    install:\n       <em> disk: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\/dev\/sda<\/mark><\/em> # The disk used for installations.<\/code><\/pre>\n\n\n\n<p>Save the file and fire up the control plane first:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl apply-config --insecure -n <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">192.168.200.105<\/mark> --file _out\/controlplane.yaml<\/code><\/pre>\n\n\n\n<p>The above command can be repeated severally on multiple nodes if you need to create a HA of the control node.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Run the Worker Nodes<\/h3>\n\n\n\n<p>Similar to the above process, you identify the disk on the worker nodes and make adjustments to the <strong>worker.yaml<\/strong>. Once the changes have been saved, we can fire up the worker nodes using the generated configurations:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl apply-config --insecure -n 192.168.200.106 --file _out\/worker.yaml\ntalosctl apply-config --insecure -n 192.168.200.107 --file _out\/worker.yaml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Bootstrap Etcd<\/h3>\n\n\n\n<p>Now we will set up a shell using the <em>talosconfig<\/em> and configure the endpoints:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export CONTROL_PLANE_IP=192.168.200.105\nexport TALOSCONFIG=\"_out\/talosconfig\"\ntalosctl config endpoint $CONTROL_PLANE_IP\ntalosctl config node $CONTROL_PLANE_IP<\/code><\/pre>\n\n\n\n<p>Now we will set the endpoints and nodes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl --talosconfig _out\/talosconfig config endpoint $CONTROL_PLANE_IP\ntalosctl --talosconfig _out\/talosconfig config node $CONTROL_PLANE_IP<\/code><\/pre>\n\n\n\n<p>Bootstrap etcd<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl --talosconfig _out\/talosconfig bootstrap -n $CONTROL_PLANE_IP<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Access Talos Powered Kubernetes Cluster<\/h2>\n\n\n\n<p>Once the cluster is up, you can access and use it as desired to run the containerized workloads. But first, obtain the admin <code>kubeconfig<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>talosctl --talosconfig _out\/talosconfig kubeconfig .<\/code><\/pre>\n\n\n\n<p>Now instal kubectl on your system with the commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -LO \"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/$(curl -s https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt)\/bin\/linux\/amd64\/kubectl\"\nchmod +x kubectl\nsudo mv kubectl \/usr\/local\/bin<\/code><\/pre>\n\n\n\n<p>Export the admin config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p $HOME\/.kube\nsudo cp -i kubeconfig $HOME\/.kube\/config\nsudo chown $(id -u):$(id -g) $HOME\/.kube\/config<\/code><\/pre>\n\n\n\n<p>Now view the nodes in the cluster:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"> kubectl get nodes -o wide<\/mark>\nNAME                            STATUS   ROLES           AGE     VERSION   INTERNAL-IP       EXTERNAL-IP   OS-IMAGE         KERNEL-VERSION   CONTAINER-RUNTIME\nmaster.computingforgeeks.com    Ready    control-plane   2m10s   v1.27.1   192.168.200.105   &lt;none&gt;        Talos (v1.4.4)   6.1.28-talos     containerd:\/\/1.6.21\nworker1.computingforgeeks.com   Ready    &lt;none&gt;          118s    v1.27.1   192.168.200.106   &lt;none&gt;        Talos (v1.4.4)   6.1.28-talos     containerd:\/\/1.6.21\nworker2.computingforgeeks.com   Ready    &lt;none&gt;          2m20s   v1.27.1   192.168.200.107   &lt;none&gt;        Talos (v1.4.4)   6.1.28-talos     containerd:\/\/1.6.21<\/code><\/pre>\n\n\n\n<p>View the pods:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">kubectl get pods -A<\/mark>\nNAMESPACE     NAME                                                   READY   STATUS    RESTARTS        AGE\nkube-system   coredns-d779cc7ff-k6dwc                                1\/1     Running   0               3m4s\nkube-system   coredns-d779cc7ff-wqj6x                                1\/1     Running   0               3m4s\nkube-system   kube-apiserver-master.computingforgeeks.com            1\/1     Running   0               55s\nkube-system   kube-controller-manager-master.computingforgeeks.com   1\/1     Running   1 (3m21s ago)   2m2s\nkube-system   kube-flannel-h9k89                                     1\/1     Running   0               2m50s\nkube-system   kube-flannel-jtwkm                                     1\/1     Running   0               2m38s\nkube-system   kube-flannel-v4b97                                     1\/1     Running   0               3m\nkube-system   kube-proxy-4hc2n                                       1\/1     Running   0               3m\nkube-system   kube-proxy-cd5jf                                       1\/1     Running   0               2m50s\nkube-system   kube-proxy-fh266                                       1\/1     Running   0               2m38s\nkube-system   kube-scheduler-master.computingforgeeks.com            1\/1     Running   2 (3m19s ago)   104s<\/code><\/pre>\n\n\n\n<p>On the console, you should also see the nodes ready as shown:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"557\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-3.png\" alt=\"\" class=\"wp-image-138017\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-3.png 866w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-3-300x193.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-3-768x494.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-3-696x448.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-3-653x420.png 653w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">5. Deploy a Test Application on Kubernetes<\/h2>\n\n\n\n<p>To verify if the cluster is working properly, we can deploy a sample Nginx application. To achieve that, we can use the below manifest:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f - &lt;&lt;EOF\napiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\nspec:\n  selector:\n    matchLabels:\n      app: nginx\n  replicas: 2 \n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:latest\n        ports:\n        - containerPort: 80\nEOF<\/code><\/pre>\n\n\n\n<p>View if the pods are running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">kubectl get pods<\/mark>\nNAME                                READY   STATUS    RESTARTS   AGE\nnginx-deployment-57d84f57dc-dkjs4   1\/1     Running   0          34s\nnginx-deployment-57d84f57dc-fd29c   1\/1     Running   0          34s<\/code><\/pre>\n\n\n\n<p>Expose the app with NodePort:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">kubectl expose deployment nginx-deployment --type=NodePort --port=80<\/mark>\nservice\/nginx-deployment exposed<\/code><\/pre>\n\n\n\n<p>Get the service port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">kubectl get svc<\/mark>\nNAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE\nkubernetes         ClusterIP   10.96.0.1       &lt;none&gt;        443\/TCP        5m5s\nnginx-deployment   NodePort    10.111.46.209   &lt;none&gt;        80:<strong>31721<\/strong>\/TCP   11s<\/code><\/pre>\n\n\n\n<p>You can now verify access to the app using the URL <a href=\"http:\/\/NodeIP:31721\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/NodeIP:31721<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"571\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-4.png\" alt=\"\" class=\"wp-image-138018\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-4.png 945w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-4-300x181.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-4-768x464.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-4-696x421.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2023\/05\/Setup-Multi-node-Kubernetes-Cluster-using-Talos-Container-Linux-4-695x420.png 695w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Closing Thoughts<\/h2>\n\n\n\n<p>This guide has provided a detailed illustration of how to set up Multi-node Kubernetes Cluster using Talos Container Linux. We can all agree that Talos Linux is a modern container-optimized environment. I hope this was of great importance to you.<\/p>\n\n\n\n<p>See more articles on this website:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/trow-container-image-registry-with-kubernetes\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Use Trow Container Image Registry With Kubernetes<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/become-a-kubernetes-pro-with-this-kubectl-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Become a Kubernetes Pro with this kubectl Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-traefik-ingress-controller-on-kubernetes\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Configure Traefik Ingress Controller on Kubernetes<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It was originally developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes is designed to run distributed applications across clusters of hosts, providing mechanisms for container scheduling, scaling, service discovery, load balancing, &#8230; <a title=\"Install Kubernetes Cluster using Talos Container Linux\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/install-kubernetes-using-talos-container-linux\/\" aria-label=\"Read more about Install Kubernetes Cluster using Talos Container Linux\">Read more<\/a><\/p>\n","protected":false},"author":21,"featured_media":138016,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[316,299,317,50,832],"tags":[38663],"class_list":["post-137986","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers","category-how-to","category-kubernetes","category-linux-tutorials","category-tech","tag-talos-container-linux"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/137986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=137986"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/137986\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/138016"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=137986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=137986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=137986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}