Kubernetes – Redis Deployment

Need to quickly get started with Redis in your Kubernetes cluster? Here’s an deployment with service:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  selector:
    matchLabels:
      app: redis
  replicas: 1
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - name: redis
        image: redis:7-alpine
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
        ports:
        - containerPort: 6379

---

apiVersion: v1
kind: Service
metadata:
  name: redis-service
spec:
  selector:
    app: redis
  ports:
    - protocol: TCP
      port: 6379

Next, configure your Redis enabled application to use “redis-service” as it’s Redis endpoint.

Cache them objects 👾

Leave a Reply

Your email address will not be published. Required fields are marked *