apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  selector:
    matchLabels:
      app: redis
  replicas: 1
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
        - name: redis
          image: redis:6-alpine3.14
          command:
            - redis-server
            - "/redis-master/redis.conf"
          env:
            - name: MASTER
              value: "true"
          ports:
            - containerPort: 6379
          resources:
            limits:
              cpu: "0.1"
          volumeMounts:
            - mountPath: /redis-master-data
              name: data
            - mountPath: /redis-master
              name: config
      volumes:
        - name: data
          emptyDir: {}
        - name: config
          configMap:
            name: redis-config
            items:
              - key: redis-config
                path: redis.conf
