apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  labels:
    app: redis
    visualize: "true"
    type: workshop
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
      version: "4.0.14-alpine"
  template:
    metadata:
      labels:
        app: redis
        version: "4.0.14-alpine"
        visualize: "true"
      annotations:
        sidecar.istio.io/inject: 'true'
    spec:
      containers:
      - name: redis
        image: redis:4.0.14-alpine
        imagePullPolicy: Always
        livenessProbe:
          tcpSocket:
            port: 6379
          initialDelaySeconds: 30
          timeoutSeconds: 1
          periodSeconds: 10
          successThreshold: 1
          failureThreshold: 3
        ports:
        - name: redis-server
          containerPort: 6379
        resources:
          requests:
            cpu: 400m
            memory: 500Mi
          limits:
            cpu: 1000m
            memory: 2000Mi
        volumeMounts:
          - name: redis-data
            mountPath: /data
      volumes:
        - name: redis-data
          persistentVolumeClaim:
            claimName: redis
