apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  namespace: foxhunt
  labels:
    app.kubernetes.io/name: redis
    app.kubernetes.io/part-of: foxhunt
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: redis
  template:
    metadata:
      labels:
        app.kubernetes.io/name: redis
        app.kubernetes.io/part-of: foxhunt
    spec:
      nodeSelector:
        k8s.scaleway.com/pool-name: infra
      containers:
        - name: redis
          image: redis:7-alpine
          command:
            - redis-server
            - --maxmemory
            - 512mb
            - --maxmemory-policy
            - allkeys-lru
          ports:
            - containerPort: 6379
              name: redis
          readinessProbe:
            exec:
              command:
                - redis-cli
                - ping
            initialDelaySeconds: 5
            periodSeconds: 10
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: 250m
              memory: 640Mi
---
apiVersion: v1
kind: Service
metadata:
  name: redis
  namespace: foxhunt
  labels:
    app.kubernetes.io/name: redis
    app.kubernetes.io/part-of: foxhunt
spec:
  selector:
    app.kubernetes.io/name: redis
  ports:
    - port: 6379
      targetPort: 6379
      name: redis
