6.9. Customizing user perspectives
The OpenShift Container Platform web console provides two perspectives by default, Administrator and Developer. You might have more perspectives available depending on installed console plugins. As a cluster administrator, you can show or hide a perspective for all users or for a specific user role. Customizing perspectives ensures that users can view only the perspectives that are applicable to their role and tasks. For example, you can hide the Administrator perspective from unprivileged users so that they cannot manage cluster resources, users, and projects. Similarly, you can show the Developer perspective to users with the developer role so that they can create, deploy, and monitor applications.
You can also customize the perspective visibility for users based on role-based access control (RBAC). For example, if you customize a perspective for monitoring purposes, which requires specific permissions, you can define that the perspective is visible only to users with required permissions.
Each perspective includes the following mandatory parameters, which you can edit in the YAML view:
-
id: Defines the ID of the perspective to show or hide -
visibility: Defines the state of the perspective along with access review checks, if needed -
state: Defines whether the perspective is enabled, disabled, or needs an access review check
By default, all perspectives are enabled. When you customize the user perspective, your changes are applicable to the entire cluster.
6.9.1. Customizing a perspective using YAML view 复制链接链接已复制到粘贴板!
Prerequisites
- You must have administrator privileges.
Procedure
-
In the Administrator perspective, navigate to Administration
Cluster Settings. - Select the Configuration tab and click the Console (operator.openshift.io) resource.
Click the YAML tab and make your customization:
To enable or disable a perspective, insert the snippet for Add user perspectives and edit the YAML code as needed:
apiVersion: operator.openshift.io/v1 kind: Console metadata: name: cluster spec: customization: perspectives: - id: admin visibility: state: Enabled - id: dev visibility: state: EnabledTo hide a perspective based on RBAC permissions, insert the snippet for Hide user perspectives and edit the YAML code as needed:
apiVersion: operator.openshift.io/v1 kind: Console metadata: name: cluster spec: customization: perspectives: - id: admin requiresAccessReview: - group: rbac.authorization.k8s.io resource: clusterroles verb: list - id: dev state: EnabledTo customize a perspective based on your needs, create your own YAML snippet:
apiVersion: operator.openshift.io/v1 kind: Console metadata: name: cluster spec: customization: perspectives: - id: admin visibility: state: AccessReview accessReview: missing: - resource: deployment verb: list required: - resource: namespaces verb: list - id: dev visibility: state: Enabled
- Click Save.