3. Cluster Customizations (RED)

3.0 User Access

Establish a shared project namespace that everyone on your team can use:

  1. Use an admin account to create a new project namespace for the Red team to use:

    oc new-project red-team
  2. Provide existing user accounts with access to the red-team project namespace:

    for user in {1..10}; do oc adm policy add-role-to-user edit user$user ; done

3.1 Console Notifications

  1. Click on the Import (+) link in the header, then paste the following YAML:

    apiVersion: console.openshift.io/v1
    kind: ConsoleNotification
    metadata:
      name: hackathon-banner
    spec:
      text: Welcome Red Team to the Summit Connect 2022 Hackathon!
      location: BannerTop
      link:
        href: 'https://github.com/redhat-scholars/quickstart-workshop/tree/master/apps/red'
        text: (Red Team Repo)
      color: '#fff'
      backgroundColor: darkred
  2. Click Create to make the new ConsoleNotification visible to all cluster users

  1. Download an image that we can use for our header logo

  2. Upload the image into a Kubernetes configmap

    oc create configmap console-custom-logo --from-file /tmp/red-shell.png -n openshift-config
  3. Paste the following to generate a json patch file. This file will be used to update the cluster console operator config:

    cat <<EOF > /tmp/patch.yaml
    spec:
      customization:
        customLogoFile:
          key: red-shell.png
          name: console-custom-logo
    EOF
  4. Send the configuration patch to the console cluster operator:

    oc patch consoles.operator.openshift.io cluster --type merge --patch-file /tmp/patch.yaml

3.3 Customize the Login Screen

Admin access required for the section

  1. Run the following command to create a template login page that you can modify:

    oc adm create-login-template > login.html
  2. Replace the default login.html page with something more exciting:

  3. Store our updated login page in a secret:

    oc create secret generic login-template --from-file=login.html -n openshift-config
  4. Generate a patch file:

    cat <<EOF > /tmp/patch.yaml
    spec:
      templates:
        login:
          name: login-template
    EOF
  5. Apply the patch to the oauths resource named "cluster":

    oc patch oauths cluster --type merge --patch-file /tmp/patch.yaml

3.4 Configure Web Terminal defaults

Update the cluster default terminal image by modifying the DevWorkspaceTemplate/web-terminal-tooling resource:

  1. Search All Projects for resources of type DevWorkspaceTemplate

    Search All Projects

    Search Resource type "DevWorkspaceTemplate"

  2. Select the resource named web-terminal-tooling

    View templates

  3. Click on YAML to modify the terminal settings

    web terminal tooling

  4. Add a new annotation after line 5:

    web-terminal.redhat.com/unmanaged-state: "true"
  5. Replace the spec.components[].container.image url with:

    quay.io/ryan_j/summitconnect:4.10.25
  6. Click Save to set the new default terminal image for the cluster

    web-terminal-tooling yaml config

  7. Close and restart your Web Terminal

  8. In a new terminal, check the version of the oc command line tool:

    oc version
    Client Version: 4.10.25
    Server Version: 4.10.26
    Kubernetes Version: v1.23.5+012e945

    If you don’t see an updated client release available, use the following command to refresh the outdated web terminal tooling pod:

    oc delete pod -l 'controller.devfile.io/devworkspace_id'

    There will be a brief pause while the Web Terminal tooling container is replaced

Non-admin users can also quickly override the default terminal image (without setting a new cluster default) using the wtoctl command:

wtoctl set image quay.io/ryan_j/summitconnect:latest

3.5 Quickstart Installation

  1. Install the red team quickstart which provides an introduction to odo v3.0:

  2. Search all quickstarts for a new entry named "Local development with odo 3.0"

  3. Start the quickstart and follow along with each step