apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
        - name: redis
          image: redis:6
          command: [ "redis-server", "/config/redis.conf"]
          imagePullPolicy: IfNotPresent

          volumeMounts:
            - name: redis-config
              mountPath: /config

          resources:
            requests:
              cpu: 50m
              memory: 100Mi
            limits:
              cpu: 100m
              memory: 150Mi

          ports:
            - name: redis
              containerPort: 6379

          securityContext:
            readOnlyRootFilesystem: true

      volumes:
        - name: redis-config
          secret:
            secretName: redis-config