Introduction
This guide explains how to use Redis within a Kubernetes environment, including installation, configuration, and basic Redis commands.
Installation
Install Redis Tools
## Install Redis CLI tools
sudo apt install redis-tools
Configuration
Kubernetes Resources
ConfigMap
## Get Redis ConfigMap
kubectl get configmap -n resilience-api redis -o yaml
## Output:
apiVersion: v1
data:
address: 10.59.242.156:6379
kind: ConfigMap
Secret
## Get Redis authentication secret
kubectl get secrets -n resilience-api redis-auth -o yaml
## Output:
apiVersion: v1
data:
auth_string: MzRkZDlmYTItZjYxYS00ZTA2LTgzMmUtNTFiZDkwZWY4NDEy
kind: Secret
Connecting to Redis
## Connect to Redis using host and authentication
redis-cli -h 10.0.0.156
auth_string: MzRkZDlmYTItZjYxYS00ZTA2LTgzMmUtNTFiZDkwZWY4NDEy
Basic Redis Commands
## Check Redis server information
info
## Test connection
ping
## List all keys
keys *
Related Kubernetes Deployment Guides
Deploy more stateful applications on Kubernetes:
- Private Helm Repository with ChartMuseum - Manage Kubernetes packages and chart repositories
- Pulumi Infrastructure as Code: Complete Setup Guide - Automate Kubernetes deployments with IaC
- MongoDB Security Guide: Production Database Hardening - Secure database deployments in production
☸️ See all Kubernetes guides and DevOps articles for more deployment patterns.