apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    application: kube-ops-view
    component: redis
  name: kube-ops-view-redis
  namespace: kube-ops
spec:
  replicas: 1
  selector:
    matchLabels:
      application: kube-ops-view
      component: redis
  template:
    metadata:
      labels:
        application: kube-ops-view
        component: redis
    spec:
      containers:
      - name: redis
        image: redis:5-alpine
        ports:
        - containerPort: 6379
          protocol: TCP
        readinessProbe:
          tcpSocket:
            port: 6379
        resources:
          limits:
            cpu: 200m
            memory: 100Mi
          requests:
            cpu: 50m
            memory: 50Mi
        securityContext:
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          # we need to use the "redis" uid
          runAsUser: 999
