apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  labels:
    app.kubernetes.io/name: redis
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: redis
  template:
    metadata:
      labels:
        app.kubernetes.io/name: redis
    spec:
      containers:
        - name: redis
          image: redis:6.2.6-alpine
          ports:
            - name: redis
              containerPort: 6379
          readinessProbe:
            exec:
              command:
                - sh
                - -c
                - "redis-cli -h localhost ping"
            initialDelaySeconds: 10
            periodSeconds: 10
            timeoutSeconds: 3
          livenessProbe:
            exec:
              command:
                - sh
                - -c
                - "redis-cli -h localhost ping"
            initialDelaySeconds: 15
            periodSeconds: 60
            timeoutSeconds: 1
      restartPolicy: Always