Crusoe Slurm User Management
Crusoe Slurm User Management allows you to create multiple users that have access to your Slurm cluster. Each user represents a Linux user provisioned across all Slurm components — login, compute, and controller nodes. Users are managed via the SlurmUser Custom Resource. You can control access to each user by defining one or more SSH keys. Additionally, you can organize users into groups via the SlurmUserGroup Custom Resource for advanced features like partition access control.
Prerequisites
Minimum Version Requirements
Ensure your environment meets the following minimum version requirements:
| Component | Minimum Version | Description |
|---|---|---|
| CMK cluster version | 1.33.4-cmk.43 | User management requires this CMK version or above |
| SlurmCluster clusterVersion | 25.11.2-cmk.4 | Available versions can be found in the Slurm container registry |
Get SlurmCluster Details
Run the following command to find the SlurmCluster name:
kubectl get slurmclusters -A
Example Output:
NAMESPACE NAME AGE
slurm <your-slurm-cluster-name> 4h25m0
This NAME field is used as the clusterReference when creating SlurmUser and SlurmUserGroup objects.
Limitations
- All users have non-sudo access to the Slurm cluster.
Slurm User Management
All users are managed using the SlurmUser Custom Resource.
After creating, updating, or deleting a user, it takes about a minute for changes to propagate through the Slurm cluster.
Creating a Slurm User
Create a file with the following content, replacing name, fullName, and sshPublicKeys with your values. The name field represents the Linux username and must be unique:
apiVersion: slurm.crusoe.ai/v1alpha1
kind: SlurmUser
metadata:
name: bob
namespace: slurm
spec:
clusterReference: <your-slurm-cluster-name>
fullName: Bob
sshPublicKeys:
- ssh-ed25519 AAAAC3... # Replace with your public SSH key
Apply the configuration:
kubectl apply -f <user-bob.yaml>
Find the login node IP using kubectl get svc -n slurm. The EXTERNAL-IP of the login service is the login node IP:
NAMESPACE NAME TYPE EXTERNAL-IP PORT(S)
slurm <your-slurm-cluster-name>-login LoadBalancer 160.211.64.102 22:32396/TCP
The user can now log in using their private key:
ssh -i <path-to-private-key> bob@<login-node-ip>
Getting all Slurm Users
Use the following command to get all SlurmUsers in the cluster:
kubectl get slurmusers -A
Output:
NAMESPACE NAME USERNAME UID GID CLUSTER CREATED AGE
slurm bob bob 10001 10001 <your-slurm-cluster-name> True 8s
Updating a Slurm User
Only the sshPublicKeys field can be updated. Use the following command to edit the SSH keys for a user:
kubectl edit slurmuser -n slurm bob
Deleting a Slurm User
Delete a SlurmUser with the following command. The user will lose access to the Slurm cluster post this operation:
kubectl delete slurmuser -n slurm bob
Slurm UserGroup Management
SlurmUserGroups allow you to organize users into groups for advanced features like partition access control.
Creating a Slurm UserGroup
Create a file with the following content, replacing clusterReference and members with your values:
apiVersion: slurm.crusoe.ai/v1alpha1
kind: SlurmUserGroup
metadata:
name: ml-team
namespace: slurm
spec:
clusterReference: <your-slurm-cluster-name>
members:
- bob
Apply the configuration:
kubectl apply -f <user-group-ml-team.yaml>
Getting all Slurm UserGroups
Use the following command to get all SlurmUserGroups in the cluster:
kubectl get slurmusergroups -A
Output:
NAMESPACE NAME GROUPNAME GID MEMBERS CLUSTER CREATED AGE
slurm ml-team ml-team 50000 1 <your-slurm-cluster-name> True 80s
Updating a Slurm UserGroup
You can add or remove users by editing the spec.members list:
kubectl edit slurmusergroup -n slurm ml-team
Deleting a Slurm UserGroup
Delete a SlurmUserGroup with the following command:
kubectl delete slurmusergroup -n slurm ml-team