apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-deployment
  namespace: cerebral
  labels:
    app: redis
spec:
  replicas: 1  # Number of Redis instances
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - name: redis
        image: redis:latest
        ports:
        - containerPort: 6379
        resources:
          limits:
            cpu: "0.5"
            memory: 512Mi
          requests:
            cpu: "0.5"
            memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: redis-service
  namespace: cerebral
spec:
  type: LoadBalancer
  ports:
  - port: 6379
    targetPort: 6379
  selector:
    app: redis
