apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: compute
  namespace: slurm-cluster
  labels:
    app: compute
spec:
  replicas: 3
  selector:
    matchLabels:
      app: compute
  serviceName: slurmd
  template:
    metadata:
      labels:
        app: compute
    spec:
      containers:
      - name: compute
        image: sinonkt/docker-slurmd
        ports:
        - name: slurmd-port
          containerPort: 6818
          protocol: TCP
        envFrom:
          - configMapRef:
              name: default-envs
        securityContext:
          capabilities:
            add: ["SYS_ADMIN"]
        volumeMounts:
        - name: cgroup
          mountPath: /sys/fs/cgroup
          readOnly: true
        - name: etc-slurm
          mountPath: /etc/slurm
          readOnly: true
      volumes:
      - name: cgroup
        hostPath:
          path: /sys/fs/cgroup
          type: Directory
      - name: etc-slurm
        hostPath:
          path: /Users/Krittin/Code/sinonkt/slurm-on-kubernetes/etc/slurm
          type: Directory