---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: database
  namespace: k8s
spec:
  selector:
    matchLabels:
      run: db-debian-sid
  template:
    metadata:
      labels:
        run: db-debian-sid
    spec:
      volumes:
      - name: cgroup
        hostPath:
          path: /sys/fs/cgroup
          type: Directory
      containers:
      - name: db-debian-sid
        image: ngonzalez121/debian-sid
        ports:
        - name: ssh
          containerPort: 22
        - name: postgresql
          containerPort: 5432
        - name: redis
          containerPort: 6379
        securityContext:
          privileged: true
          capabilities:
            add: ["SYS_ADMIN"]
        volumeMounts:
        - name: cgroup
          mountPath: /sys/fs/cgroup:ro
