apiVersion: valkey.buf.red/v1alpha1
kind: Sentinel
metadata:
  name: standalone-sentinel
  namespace: default
spec:
  image: valkey/valkey:8.0
  # Number of sentinel instances (must be odd, minimum 3)
  replicas: 3
  
  # Resource allocation for sentinel
  resources:
    requests:
      memory: "128Mi"
      cpu: "50m"
    limits:
      memory: "256Mi"
      cpu: "100m"
  
  # Network access
  access:
    serviceType: ClusterIP
    # Optional: Set password for default user
    defaultPasswordSecret: sentinel-password
  
  # Sentinel-specific configuration
  customConfigs:
    # Sentinel timeouts and intervals
    sentinel-down-after-milliseconds: "30000"   # 30s to mark master as down
    sentinel-failover-timeout: "180000"         # 3min failover timeout
    sentinel-parallel-syncs: "1"                # Sync 1 replica at a time
    
    # Network configuration
    tcp-keepalive: "300"
    
    # Logging
    loglevel: "notice"

---
# Optional: Secret for sentinel authentication
apiVersion: v1
kind: Secret
metadata:
  name: sentinel-password
  namespace: default
type: Opaque
data:
  password: c2VudGluZWxwYXNzd29yZA==  # sentinelpassword (base64)
