Step 2 - Tenant preparations¶
Note
This step is done by the tenant administrators, and is typically done in collaboration with the Nais team.
When setting up Nais in your Google organization, we will need a dedicated folder for all resources related to Nais. Everything Nais related will be contained within this folder, and no further permissions are required in the organization.
Required settings¶
The tenant administrator that will perform the following commands will need these permissions on the organization level:
OwnerOrganization AdministratorFolder CreatorOrganization Policy Administrator
Disable Domain restricted sharing policy¶
Domain restricted sharing must be disabled to allow SA's from other domains, as well as being able to create public resources. See Google documentation for more information.
- Select the top-level organization in the Google Cloud Console
- Go to
IAM & Admin->Organization policies - Find the policy
Domain restricted sharing(iam.allowedPolicyMemberDomains) - Actions (three dots) -> Edit policy
- Click
Manage policy - Select
Override parent's policyandReplace - In the
Policy valuesselectAllow all - Click
DoneandSet policy - Allow a couple of minutes for the policy to take effect
Run setup script¶
Download and run the setup script found here: https://raw.githubusercontent.com/nais/handbook/refs/heads/main/scripts/tenant-setup.sh
This can be done using the Google Cloud Shell, or locally if you have gcloud installed.
Note
After running the script, we have both the ORG_ID and NAIS_FOLDER_ID that is required by the nais team.
Teams and users (admin google com)¶
Create Kubernetes security group¶
This group is used to manage access to the kubernetes clusters, and this is where Nais automatically adds teams that should have access to the clusters.
- Go to https://admin.google.com/ac/groups
- Click on
Create group - Enter
gke-security-groupsas the group name - Enter
gke-security-groupsas the email address - Enter
This group manages who has GKE permissionsas the description - Note: Do not check the box for
Security - Click
Next - Select 'Only invited users' in the 'Who can join the group' section. Leave the rest as default.
- Click
Create Group
Create nais admin user¶
Nais needs a dedicated user account in the Google directory. This user must be manually created in the Google Admin console. The user must be granted the Groups Admin role to be able to create and maintain groups for the teams:
- Go to https://admin.google.com/ac/users
- Click on
Add new user - Enter
naisas first name, andadminas last name - Enter
nais-adminas the primary email - Click
Add new userto add the user account (you can safely ignore the generated password) - Click on the created user (might require a hard refresh of the user list) and then on
Assign rolesunder theAdmin roles and privilegessection - Assign the
Groups Adminrole and clickSave
Create Console admins group¶
Nais (API) automatically syncs users from the Google Workspace to its own database. Tenants can control which users that should be assigned the admin role in Nais by creating a group called console-admins@<tenant-domain>, and then add the necessary users to this group. When Console/Nais API runs the user sync it will look for this group, and make sure that the users in the group are granted the admin role.
Whenever a user is removed from the group, Nais will revoke the admin role from the user on the next sync.
- Go to https://admin.google.com/ac/groups
- Click on
Create group - Enter
console-adminsas the group name - Enter
console-adminsas the email address - Enter
This group is used to control who has admin permissions in the Nais Consoleas the description - Click
Next - Select 'Only invited users' in the 'Who can join the group' section. Leave the rest as default.
- Click
Create Group
Users with the admin role in Console have access to some additional settings:
- Configure / enable / disable reconcilers
- Grant / revoke roles
- Manipulate reconciler states for teams
Highly recommended settings¶
Log location¶
Every project created in GCP will have a default log location for all logs. The default is Global. In order to keep your logs in europe, we strongly recommend setting the default log location to europe using the following command
Organization policy for location¶
Although all resources created by NAIS is located within the EU, teams are still able to create resources anywhere unless an organizational constraint is in place.