🔴
Kubernetes

Redis on Kubernetes

Redis Deployment + ClusterIP Service for in-cluster caching

📋Configuration Files

redis-deployment.yml

yaml
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4 name: redis
5spec:
6 replicas: 1
7 selector:
8 matchLabels:
9 app: redis
10 template:
11 metadata:
12 labels:
13 app: redis
14 spec:
15 containers:
16 - name: redis
17 image: redis:7-alpine
18 ports:
19 - containerPort: 6379
20 resources:
21 limits:
22 memory: 256Mi
23 cpu: 250m

redis-service.yml

yaml
1apiVersion: v1
2kind: Service
3metadata:
4 name: redis
5spec:
6 type: ClusterIP
7 selector:
8 app: redis
9 ports:
10 - port: 6379
11 targetPort: 6379
📄

Step 01

Apply Redis

(01)Deploy to cluster

Linux
1kubectl apply -f .
2kubectl get all
3kubectl get pods -w

(02)Remove

Linux
1kubectl delete -f .