---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-commander
  annotations:
    # Tell Kubernetes to apply the AppArmor profile "runtime/default".
    # Note that this is ignored if the Kubernetes node is not running version 1.4 or greater.
    # and fails if apparmor enabled but profile not found (may happens on borked k8s installs only)
    # set to "unconfined" to disable AppArmor
    container.apparmor.security.beta.kubernetes.io/redis-commander: runtime/default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis-commander
  template:
    metadata:
      labels:
        app: redis-commander
        tier: backend
    spec:
      containers:
        - name: redis-commander
          image: rediscommander/redis-commander
          imagePullPolicy: Always
          env:
            - name: REDIS_HOST
              value: "redis"
            - name: REDIS_PASSWORD
              value: "SECRET"
            - name: K8S_SIGTERM
              value: "1"
          ports:
            - name: redis-commander
              containerPort: 8081
          livenessProbe:
            httpGet:
              path: /favicon.png
              port: 8081
            initialDelaySeconds: 10
            timeoutSeconds: 5
          # resources:
          #   limits:
          #     cpu: "500m"
          #     memory: "512M"
          securityContext:
            runAsNonRoot: true
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
