{"id":3641,"date":"2023-07-25T14:56:44","date_gmt":"2023-07-25T11:56:44","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3641"},"modified":"2023-07-25T15:15:12","modified_gmt":"2023-07-25T12:15:12","slug":"how-to-deploy-redis-on-kubernetes","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/","title":{"rendered":"How to Deploy Redis on Kubernetes"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" data-attachment-id=\"3648\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/tutorial\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Tutorial\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?fit=750%2C422&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?resize=750%2C422&#038;ssl=1\" alt=\"How to Deploy Redis on Kubernetes\" class=\"wp-image-3648\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Tutorial.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>This article provides a detailed guide on how to install Redis on Kubernetes, covering everything from configuring the Kubernetes environment to installing and administering Redis. The demand for effective, scalable, and trustworthy data storage solutions has increased as the world transitions to microservices and containerized applications. Redis, a high-performance in-memory data structure store popularly used for caching, session management, and real-time analytics, is one such solution. Redis&#8217; scalability and dependability can be greatly improved by deploying it on Kubernetes, an open-source platform for managing containerized workloads. <\/p>\n\n\n\n<p>Before we dive into the installation of <a href=\"https:\/\/k3s.io\/\" target=\"_blank\" rel=\"noopener\">K3s<\/a>, it&#8217;s crucial to prepare your Ubuntu 22.04 server. Your server should meet the following minimum requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>2 GB RAM<\/li>\n\n\n\n<li>2 CPUs<\/li>\n\n\n\n<li>40 GB of Disk Space<\/li>\n\n\n\n<li>Ubuntu 22.04 LTS installed. You can buy a powerful Ubuntu VPS from\u00a0<a href=\"https:\/\/virtono.com\/cloud-vps\" target=\"_blank\" rel=\"noopener\">Virtono<\/a> (29 locations).<\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/#Step_1_Preparing_the_Server\" title=\"Step 1: Preparing the Server\">Step 1: Preparing the Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/#Step_2_Installing_K3s\" title=\"Step 2: Installing K3s\">Step 2: Installing K3s<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/#Step_3_Deploying_Redis_on_Kubernetes\" title=\"Step 3: Deploying Redis on Kubernetes\">Step 3: Deploying Redis on Kubernetes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/#Step_4_Verifying_the_Deployment\" title=\"Step 4: Verifying the Deployment\">Step 4: Verifying the Deployment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/#Step_5_Connecting_to_Redis\" title=\"Step 5: Connecting to Redis\">Step 5: Connecting to Redis<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/#Final_Thoughts\" title=\"Final Thoughts\">Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Preparing_the_Server\"><\/span>Step 1: Preparing the Server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>We must first configure the server where the <a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-and-configure-kubernetes-on-ubuntu-22-04\/\">Kubernetes cluster<\/a> will run before we can deploy Redis on it. The steps are the same for other operating systems, but for the purposes of this guide, we&#8217;ll assume you&#8217;re using a server that is based on Linux.<\/p>\n\n\n\n<p>First, update and upgrade your server&#8217;s package index:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>apt-get update &amp;&amp; apt-get upgrade -y<\/code><\/pre>\n\n\n\n<p>These commands will install the most recent versions of all packages already present on your system and update the package lists to reflect upgrades and new package installations. Updating your system is beneficial because it makes sure you have the newest features and security patches.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Installing_K3s\"><\/span>Step 2: Installing K3s<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the installation script offered by Rancher to install K3s. The script adds a systemd service that keeps K3s running and downloads the K3s binary. Additionally, it generates a kubeconfig file so that the user can communicate with the K3s cluster.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>curl -sfL https:\/\/get.k3s.io | sh -<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"257\" data-attachment-id=\"3642\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/screenshot-2023-07-25-at-13-32-45\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.32.45.png?fit=993%2C340&amp;ssl=1\" data-orig-size=\"993,340\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-07-25-at-13.32.45\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.32.45.png?fit=750%2C257&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.32.45.png?resize=750%2C257&#038;ssl=1\" alt=\"How to Deploy Redis on Kubernetes\" class=\"wp-image-3642\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.32.45.png?w=993&amp;ssl=1 993w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.32.45.png?resize=300%2C103&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.32.45.png?resize=768%2C263&amp;ssl=1 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>To verify the installation, use:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo k3s kubectl get node<\/code><\/pre>\n\n\n\n<p>If K3s is installed correctly, you should see the name of your server in the output.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3643\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/screenshot-2023-07-25-at-13-34-07\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.34.07.png?fit=780%2C175&amp;ssl=1\" data-orig-size=\"780,175\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-07-25-at-13.34.07\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.34.07.png?fit=750%2C168&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.34.07.png?resize=750%2C168&#038;ssl=1\" alt=\"Redis on Kubernetes\" class=\"wp-image-3643\" width=\"750\" height=\"168\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.34.07.png?w=780&amp;ssl=1 780w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.34.07.png?resize=300%2C67&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.34.07.png?resize=768%2C172&amp;ssl=1 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Copy the K3s&nbsp;<code>kubeconfig<\/code>&nbsp;file to your home directory:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo cp \/etc\/rancher\/k3s\/k3s.yaml ~\/.kube\/config\nsudo chown $(id -u):$(id -g) ~\/.kube\/config<\/code><\/pre>\n\n\n\n<p>Check Cluster Connectivity:<\/p>\n\n\n\n<p>Use&nbsp;<code>kubectl<\/code>&nbsp;to check if your cluster is reachable and working correctly:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>kubectl cluster-info<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"95\" data-attachment-id=\"3645\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/screenshot-2023-07-25-at-13-42-58\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?fit=1142%2C145&amp;ssl=1\" data-orig-size=\"1142,145\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-07-25-at-13.42.58\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?fit=750%2C95&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?resize=750%2C95&#038;ssl=1\" alt=\"Check Cluster Connectivity\" class=\"wp-image-3645\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?resize=1024%2C130&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?resize=300%2C38&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?resize=768%2C98&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.42.58.png?w=1142&amp;ssl=1 1142w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Deploying_Redis_on_Kubernetes\"><\/span>Step 3: Deploying Redis on Kubernetes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After K3s has been configured, Redis should be deployed. In order to deploy Redis on Kubernetes cluster, we will use a Helm chart. Helm is a Kubernetes package manager that makes it easier to deploy applications.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code># curl https:\/\/baltocdn.com\/helm\/signing.asc | sudo apt-key add -\n# sudo apt-get install apt-transport-https --yes\n# echo \"deb https:\/\/baltocdn.com\/helm\/stable\/debian\/ all main\" | sudo tee \/etc\/apt\/sources.list.d\/helm-stable-debian.list\n# sudo apt-get update\n# sudo apt-get install helm<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, add the Bitnami repository, which contains the Redis chart:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code># helm repo add bitnami https:\/\/charts.bitnami.com\/bitnami\n# helm repo update<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"206\" data-attachment-id=\"3644\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/screenshot-2023-07-25-at-13-40-34\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.40.34.png?fit=745%2C206&amp;ssl=1\" data-orig-size=\"745,206\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-07-25-at-13.40.34\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.40.34.png?fit=745%2C206&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.40.34.png?resize=745%2C206&#038;ssl=1\" alt=\"Deploy Redis on Kubernetes\" class=\"wp-image-3644\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.40.34.png?w=745&amp;ssl=1 745w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.40.34.png?resize=300%2C83&amp;ssl=1 300w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/figure>\n<\/div>\n\n\n<p>Create Redis namespace<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo kubectl create namespace redis<\/code><\/pre>\n\n\n\n<p>Now, deploy Redis on Kubernetes using the Helm chart:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>helm install my-release bitnami\/redis --namespace redis<\/code><\/pre>\n\n\n\n<p>This command deploys Redis on Kubernetes with a set of configurations that are suitable for production environments.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"215\" data-attachment-id=\"3646\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/screenshot-2023-07-25-at-13-46-34\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?fit=1153%2C331&amp;ssl=1\" data-orig-size=\"1153,331\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-07-25-at-13.46.34\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?fit=750%2C215&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?resize=750%2C215&#038;ssl=1\" alt=\"deploy Redis using the Helm chart\" class=\"wp-image-3646\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?resize=1024%2C294&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?resize=300%2C86&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?resize=768%2C220&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-13.46.34.png?w=1153&amp;ssl=1 1153w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_4_Verifying_the_Deployment\"><\/span>Step 4: Verifying the Deployment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the following kubectl command to see if Redis on Kubernetes is active:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>kubectl get pods -n redis\nNAME                          READY   STATUS    RESTARTS   AGE\nmy-release-redis-master-0     1\/1     Running   0          9m20s\nmy-release-redis-replicas-0   1\/1     Running   0          9m20s\nmy-release-redis-replicas-1   1\/1     Running   0          8m43s\nmy-release-redis-replicas-2   1\/1     Running   0          8m19s<\/code><\/pre>\n\n\n\n<p>If Redis on Kubernetes is running correctly, you should see a pod with a Running status.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_5_Connecting_to_Redis\"><\/span>Step 5: Connecting to Redis<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To connect to Redis, you can use the&nbsp;<code>redis-cli<\/code>&nbsp;tool. First, you need to install it:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt install redis-tools<\/code><\/pre>\n\n\n\n<p>Then, you can connect to Redis:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>kubectl exec -it my-release-redis-master-0 -n redis -- redis-cli<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"221\" data-attachment-id=\"3651\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/attachment\/screenshot-2023-07-25-at-14-56-05\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-14.56.05.png?fit=882%2C260&amp;ssl=1\" data-orig-size=\"882,260\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot 2023-07-25 at 14.56.05\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-14.56.05.png?fit=750%2C221&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-14.56.05.png?resize=750%2C221&#038;ssl=1\" alt=\"Connecting to Redis\" class=\"wp-image-3651\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-14.56.05.png?w=882&amp;ssl=1 882w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-14.56.05.png?resize=300%2C88&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/Screenshot-2023-07-25-at-14.56.05.png?resize=768%2C226&amp;ssl=1 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The specific steps needed to deploy Redis on K3s on an Ubuntu 22.04 server were covered in detail in this article. Redis-like applications are simple to deploy and Kubernetes management is made simple with the aid of K3s. This set up can be used in a variety of circumstances, including environments for development, testing, and even production. Always keep in mind that the configurations used in this guide are basic and may require adjusting for a production setup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article provides a detailed guide on how to install Redis on Kubernetes, covering everything from configuring the Kubernetes environment to installing and administering Redis. The demand for effective, scalable, and trustworthy data storage solutions has increased as the world transitions to microservices and containerized applications. Redis, a high-performance in-memory<\/p>\n","protected":false},"author":8,"featured_media":3649,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[558,556,554,559,555,557,552,551,553],"class_list":["post-3641","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-connecting-to-redis","tag-create-redis-namespace","tag-deploy-redis","tag-deploying-redis-on-k3s","tag-deploying-redis-on-kubernetes","tag-how-to-deploy-redis","tag-installing-k3s","tag-redis-on-k3s","tag-redis-on-kubernetes"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-Deploy-Redis-on-Kubernetes.png?fit=360%2C240&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-WJ","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3677,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-k3s-cluster-and-helm\/","url_meta":{"origin":3641,"position":0},"title":"How to install K3s Cluster and Helm","author":"George B.","date":"July 27, 2023","format":false,"excerpt":"In this tutorial, we are going to explore how to install K3s and Helm. K3s is a lightweight Kubernetes distribution designed for developers and operators looking for a method to run Kubernetes in resource-constrained environments. Helm, on the other hand, is a package manager for Kubernetes that simplifies the deployment\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-install-K3s-Cluster-and-Helm.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3238,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/install-redis-on-linux\/","url_meta":{"origin":3641,"position":1},"title":"Install Redis on Linux","author":"George B.","date":"April 14, 2023","format":false,"excerpt":"This article aims to provide you with a full guide on how to install Redis on Linux, an open-source, in-memory data structure store that can be used as a database, cache, and message broker. We will walk you through the step-by-step process of installation and setup, as well as provide\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Redis-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Redis-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Redis-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3687,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-mongodb-on-kubernetes\/","url_meta":{"origin":3641,"position":2},"title":"How to Deploy MongoDB on Kubernetes","author":"George B.","date":"July 29, 2023","format":false,"excerpt":"This tutorial will walk you through installing MongoDB on Kubernetes cluster. We'll assume that you've already got K3s and Helm set up on your machine. The deployment of applications like MongoDB on Kubernetes cluster is made easier by the Kubernetes package manager Helm. Before getting too technical, it's important to\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-Deploy-MongoDB-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3761,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/","url_meta":{"origin":3641,"position":3},"title":"How to Deploy Grafana on Kubernetes","author":"George B.","date":"August 24, 2023","format":false,"excerpt":"This article will walk you through the process of deploying Grafana on Kubernetes, specifically using k3s and Helm, and making it accessible via a NodePort on your VPS (Virtual Private Server). We'll assume you have k3s and Helm already installed. If not, please refer to their respective official documentation to\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/How-to-Deploy-Grafana-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3832,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-rabbitmq-on-kubernetes\/","url_meta":{"origin":3641,"position":4},"title":"How to Deploy RabbitMQ on Kubernetes","author":"George B.","date":"September 7, 2023","format":false,"excerpt":"In this guide, we will walk you through the process of deploying RabbitMQ on Kubernetes(K3s), assuming you already have K3s and Helm installed. Deploying RabbitMQ on Kubernetes can seem like a daunting task, especially if you're new to the world of containerization and orchestration. However, the process can be simplified\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Deploy-RabbitMQ-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3821,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-zipkin-on-kubernetes\/","url_meta":{"origin":3641,"position":5},"title":"How to Deploy Zipkin on Kubernetes","author":"George B.","date":"September 6, 2023","format":false,"excerpt":"This tutorial will walk you through setting up Zipkin on Kubernetes, assuming that you already have K3s and Helm set up. Microservices have become a key element in the quickly changing world of software development. Distributed tracing systems like Zipkin have become very popular in tandem with this explosion in\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Deploy-Zipkin-on-k3s.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3641"}],"version-history":[{"count":3,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3641\/revisions"}],"predecessor-version":[{"id":3654,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3641\/revisions\/3654"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3649"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}