nsscache to support SUP with the following steps:
- Set up SUNK User Provisioning (SUP).
- Create user groups with CoreWeave IAM or your upstream IdP.
- Create a Kubernetes Secret and add it to the
slurmchart.
Prerequisites
Before making any changes to thensscache configuration, you must first do the following:
- Set up SUP. SUP is required to provision cluster access to users, whether you use a federated IdP or not.
- Create user groups with CoreWeave IAM or your upstream IdP. SUP provisions access to groups of users, rather than individual users. You must create these groups before you configure
nsscache, and the group names must exactly match the group names specified in thensscacheconfiguration.
Configure a Kubernetes Secret for SUP
With prerequisites in place, givensscache the credentials it needs to authenticate with your directory service. Create a Kubernetes Secret that contains the configuration for your directory service, then add the Secret to the slurm chart’s values.yaml file, as detailed in the following sections.
Create a Kubernetes Secret
Create a Kubernetes Secret that contains the configuration for your directory service. This Secret can be a SCIM token or an LDAP service account password. Be sure to follow the appropriate naming conventions detailed in the following sections when creating your Secret.Naming conventions for SCIM Secrets
For a SCIM Secret, the suggested Secret name is[RELEASE-NAME]-nsscache-scim-secret.
Inside the Secret, the key under data must be named nsscache-scim-auth-token, as shown in the following example. This contains the base64-encoded SCIM token.
Naming conventions for LDAP Secrets
For an LDAP Secret, the suggested Secret name is[RELEASE-NAME]-nsscache-ldap-secret.
Inside the Secret, the key under data must be named nsscache-ldap-password. This contains the base64-encoded password for the LDAP service.
Update the slurm chart with your Kubernetes Secret
After you create the Secret, update the slurm chart’s values.yaml file so that nsscache references it.
Edit the nsscache.existingSecret parameter with the name of your Secret, as shown in Provision cluster access to groups of users. With the Secret in place and referenced from the chart, nsscache can authenticate against your directory service.
Provision cluster access to groups of users
Oncensscache can authenticate to your directory service, configure it to provision specific users and groups into the cluster. SUP provisions cluster access to groups of users, rather than individual users. You must create the groups in CoreWeave IAM or your upstream IdP before you configure nsscache. The names of your created user groups must match the group names specified in the nsscache configuration exactly.
Example SCIM values
values.yaml file sets the suggested nsscache configuration for SCIM by default. For a full list of configuration options, see the SCIM parameter reference.
The following parameters configure the groups to provision:
sudoGroupsspecifies the user groups that can runsudocommands in the nodes.scim_users_endpointspecifies the SCIM endpoint path for retrieving user data. The default value isUsers.scim_groups_endpointspecifies the SCIM endpoint path for retrieving group data. The default value isGroups.scim_users_parametersspecifies which users in these groups to provision, so they find their User ID in the cluster. By default, this filters out inactive users withfilter=active eq "true".scim_groups_parametersspecifies the groups to provision. By default, this filters out inactive users withexcludeInactiveUsers=true. If you specify no user groups,nsscacheprovisions all groups.
Filter specific user groups
scim_groups_parameters and scim_users_parameters let you add optional parameters to the groups and users endpoints, respectively. nsscache automatically URL-encodes special characters such as spaces and quotes.
To provision access to specific user groups, list the group names in both the scim_users_parameters and scim_groups_parameters parameters, as follows:
- Filter out inactive users
- Provision access to the users in the
slurm-usersandsudo-usersgroups. - Provision the virtual user groups
slurm-usersandsudo-users.
scim_users_parameters and scim_groups_parameters parameters so that nsscache provisions the users and groups correctly.
Example: Authentik LDAP values
Example Authentik LDAP values
Verify and troubleshoot nsscache
After you configure nsscache, use the following checks to confirm that user and group data is syncing from your directory service into the cluster.
You don’t need to sync data manually with nsscache. It takes about two minutes for data to sync from an identity provider to SUNK through nsscache. If user data isn’t available, wait a few minutes and check again.
To validate that nsscache is working, follow these steps:
-
Log in to the Login pod for your cluster.
-
Access the
/etc/nsscachedirectory and list the files within:This should return the following files: -
Check the contents of the
group.cache,passwd.cache,shadow.cache, andsshkey.cachefiles directly for information about the users and groups in your directory, as shown with the followingcatcommand:Alternatively, use thegetentcommand with thegroup,passwd, orshadowoptions to list the system users and groups in addition to the data pulled bynsscache, as shown in the following example:Thegetentcommand doesn’t retrieve SSH keys directly. To view the contents of thesshkey.cachefile, use thecatcommand, as shown in the preceding example.
Migrate to nsscache from SSSD
In SUNK v7.0.0 and later,
nsscache is the default directory service. The following steps only apply if you use an earlier version of SUNK and are migrating to nsscache for your directory service.nsscache.
Disable SSSD in the slurm and slurm-login charts
SSSD and nsscache are mutually exclusive, so you must turn off SSSD before nsscache can handle directory lookups. To enable nsscache, you must edit the slurm Helm chart. If you use individual login pods, you must also edit the slurm-login Helm chart.
Update the slurm chart
In the slurm chart’s values.yaml file, update the sssdContainer.enabled parameter to false and remove the directoryService section, as shown in the following example:
nsscache.
You may remove the directoryCache.directoryService section in the values.yaml of the slurm chart, because nsscache does not use this configuration.
Disable SSSDYou must disable SSSD to use
nsscache. For SUNK versions v6.x and earlier, SSSD is enabled by default.Update the slurm-login chart
If you use individual login pods, you must also edit the slurm-login chart’s values.yaml file.
Set the directoryCache.source parameter to nsscache, as shown in the following example:
directoryCache.directoryService section in the values.yaml of the slurm-login chart, because nsscache does not use this configuration.
At this point, both the slurm and slurm-login charts are configured to use nsscache as the directory service, and your cluster is ready to provision users through SUP.