Skip to content
yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-commander
  annotations:
    container.apparmor.security.beta.kubernetes.io/redis-commander: runtime/default
    container.security.alpha.kubernetes.io/redis-commander: runtime/default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis-commander
  template:
    metadata:
      labels:
        app: redis-commander
        tier: backend
    spec:
      automountServiceAccountToken: false
      containers:
        - name: redis-commander
          image: rediscommander/redis-commander
          imagePullPolicy: Always
          env:
            - name: REDIS_HOST
              value: "redis-1669709819-master"
            - name: K8S_SIGTERM
              value: "1"
          ports:
            - name: redis-commander
              containerPort: 8081
          livenessProbe:
            httpGet:
              path: /favicon.png
              port: 8081
            initialDelaySeconds: 10
            timeoutSeconds: 5
          # adapt to your needs base on data stored inside redis (number of keys and size of biggest keys)
          # or comment out for less secure installation
          resources:
            limits:
              cpu: "500m"
              memory: "512M"
          securityContext:
            runAsNonRoot: true
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
---
apiVersion: v1
kind: Service
metadata:
  name: redis-commander
spec:
  ports:
    - port: 8081
      targetPort: 8081
      name: redis-commander
      protocol: TCP
  selector:
    app: redis-commander
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-commander
  annotations:
    container.apparmor.security.beta.kubernetes.io/redis-commander: runtime/default
    container.security.alpha.kubernetes.io/redis-commander: runtime/default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis-commander
  template:
    metadata:
      labels:
        app: redis-commander
        tier: backend
    spec:
      automountServiceAccountToken: false
      containers:
        - name: redis-commander
          image: rediscommander/redis-commander
          imagePullPolicy: Always
          env:
            - name: REDIS_HOST
              value: "redis-1669709819-master"
            - name: K8S_SIGTERM
              value: "1"
          ports:
            - name: redis-commander
              containerPort: 8081
          livenessProbe:
            httpGet:
              path: /favicon.png
              port: 8081
            initialDelaySeconds: 10
            timeoutSeconds: 5
          # adapt to your needs base on data stored inside redis (number of keys and size of biggest keys)
          # or comment out for less secure installation
          resources:
            limits:
              cpu: "500m"
              memory: "512M"
          securityContext:
            runAsNonRoot: true
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
---
apiVersion: v1
kind: Service
metadata:
  name: redis-commander
spec:
  ports:
    - port: 8081
      targetPort: 8081
      name: redis-commander
      protocol: TCP
  selector:
    app: redis-commander
  type: LoadBalancer