Customize a perspective using YAML view

You can customize a perspective by editing the console resource YAML content.

Prerequisites
  • You must have administrator privileges.

Procedure
  1. In the Administrator perspective, navigate to AdministrationCluster Settings.

  2. Select the Configuration tab and click the Console (operator.openshift.io) resource.

  3. Click the YAML tab and make your customization:

    1. 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: Enabled
    2. To 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: Enabled
    3. To 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
  4. Click Save.