Creating a User
Start by opening your terminal and creating a new user named “miketest” with the following command:Mapping an Identity to the User
Next, create an identity that permits all operations for “miketest” by executing:Managing Service Accounts
Service accounts in OpenShift allow you to manage automated processes and application access. You can create them either through YAML definitions or directly via the command line.Creating a Service Account Using YAML
To create a service account using a YAML definition in thelimittester namespace, use the following configuration:
Creating a Service Account Using the Command Line
For those who prefer the command line, create a service account named “mikesa” by running:If no namespace is specified, the service account will be created in the default namespace.
Adding Roles to a Service Account
Grant view access permissions to the service account “mikesa” in the default namespace using a role binding. Execute the following command:Configuring Groups and Role Bindings
Managing groups and their role bindings is crucial for organizing user permissions. This section explains how to create a group and assign roles to it.Creating a Group
Begin by creating a new user named “tester”:Creating a Role Binding
To grant the “admin” role to the “testroles” group, perform the following steps within the OpenShift UI:- Navigate to the group’s detail view and select Role Bindings.
- Click “Create Binding.”
- Provide a binding name (e.g., “testbinding”), choose the appropriate namespace (such as “default”), and select the role name (e.g., “admin”).
- Confirm the creation.
A detailed discussion on roles, role bindings, cluster roles, and cluster role bindings is available in subsequent lessons.
This concludes our demonstration of user management in OpenShift. In this lesson, we have covered the following key topics:
- Creating users
- Mapping identities to users
- Managing service accounts via YAML and the command line
- Assigning roles using role bindings
- Configuring groups for streamlined permission management