KubeKanvas Logo
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
Back to Templates

Deploy Redis on Kubernetes: StatefulSet with Client Service Access

Tags:
RedisStatefulSetKubernetesClusterIP ServiceRead/Write Validation
Created by:
Mahmood
Deploy Redis on Kubernetes: StatefulSet with Client Service Access template preview
14 uses
KubeKanvas Logo
Visual Kubernetes cluster design tool that helps you create, manage, and deploy your applications with ease.
Product
  • Features
  • Pricing
  • Templates
Resources
  • Blog
  • Tutorials
Company
  • About Us
  • Contact
  • Terms of Service
  • Privacy Policy
  • Impressum
XGitHubLinkedIn
© 2026 KubeKanvas. All rights reserved.

Deploying Redis on Kubernetes requires a StatefulSet for stable pod identity across restarts and a dedicated client service for load-balanced access from in-cluster applications. This template deploys a 3-replica Redis StatefulSet in a dedicated namespace with password authentication and a ClusterIP service for client connections, and includes step-by-step verification to confirm read/write operations are working correctly.

What's Included

ComponentTypePortRole
NamespaceNamespace-Isolates Redis resources in project-redis-dev
RedisStatefulSet63793-replica cluster with stable pod identity and password authentication
redis-client-serviceClusterIP Service6379Load-balanced client access across all Redis pods

Architecture Overview

Redis runs as a 3-replica StatefulSet (redis-0, redis-1, redis-2) inside the project-redis-dev namespace, providing stable pod naming and ordered startup. A ClusterIP Service (redis-client-service) on port 6379 distributes client connections across the running Redis pods. Password authentication is enforced at the Redis level, requiring clients to authenticate before issuing commands.

Prerequisites

  • A running Kubernetes cluster (e.g Docker Desktop)
  • KubeKanvas CLI installed and running on your computer (Optional, if you want to use one-click deployment)

How to Deploy

  1. Click on the button at the top right corner of this page to load the manifest into the editor.
  2. Update the Redis password in the configuration to replace the default value.
  3. Adjust the replica count in the StatefulSet if your workload requires fewer or more instances.
  4. Deploy the template to your cluster via the Play button in the top right bar. If you prefer to deploy manually, download the YAML and apply it with kubectl.
  5. Wait for all pods to reach Running status. You can monitor progress in the Release Monitor screen.

How to Test

  1. Confirm all three Redis pods are running: kubectl get pods -n project-redis-dev — you should see redis-0, redis-1, and redis-2 in Running status.
  2. Launch a temporary Alpine Redis client pod with auto-deletion: kubectl run redis-client --rm -it --image=redis:alpine --restart=Never -n project-redis-dev -- sh.
  3. Inside the pod, connect to Redis via the client service: redis-cli -h redis-client-service -p 6379 -a mypassword.
  4. Run PING and confirm the response is PONG, verifying the connection is established.
  5. Write a test key: SET testkey "hello" and confirm the response is OK.
  6. Read the key back: GET testkey and confirm it returns "hello", verifying read/write operations.
  7. Exit the client with QUIT, then type exit to leave and auto-delete the test pod.

Use Cases

  • In-cluster cache deployment: Running Redis as a StatefulSet for applications that need a persistent, named cache backend accessible by DNS.
  • Client service access pattern: Exposing Redis to other pods through a dedicated ClusterIP service rather than targeting individual pod IPs directly.
  • Read/write validation workflow: Confirming a Redis deployment is functional end-to-end using a temporary client pod without installing Redis locally.
  • Namespace-isolated cache layer: Running Redis in a dedicated namespace to keep it separate from application workloads with clear network boundaries.

Summary

This template configures a 3-replica Redis StatefulSet on Kubernetes in a dedicated namespace with password authentication and a ClusterIP service for load-balanced client access.