apiVersion: apps/v1
kind: Deployment
metadata:
  name: argocd-redis
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: argocd-redis
  template:
    metadata:
      labels:
        app.kubernetes.io/name: argocd-redis
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/name: argocd-redis
                topologyKey: kubernetes.io/hostname
              weight: 100
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/part-of: argocd
                topologyKey: kubernetes.io/hostname
              weight: 5
      containers:
        - args:
            - --save
            - ""
            - --appendonly
            - "no"
          image: redis:6.2.1-alpine@sha256:f012233eecdc0f4bb9355fead6ff9681cd2b5aedbeb62f46677587e1540b7b3d
          imagePullPolicy: IfNotPresent
          name: redis
          ports:
            - containerPort: 6379
      securityContext:
        fsGroup: 1000
        runAsGroup: 1000
        runAsNonRoot: true
        runAsUser: 1000
      serviceAccountName: argocd-redis
