mattheh / backstage-workshop

Backstage workshop for Red Hat Summit 2023

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backstage Workshop for Red Hat Summit 2023

To learn about the Software Templates that were used in this workshop, explore the scaffolder-templates folder. For additional Template examples, see https://github.com/janus-idp/software-templates

Workshop Content Development

Local Development with Gulp

Install local development dependencies via npm:

npm install

Launch a local development server:

npm start

Promoting your changes

Add and commit your changes, then run git push to trigger a new deployment:

git push origin master

Workshop Cluster Setup

To set up your own workshop cluster, begin with the demo-setup installation instructions while implementing the following changes:

  1. After creating your new GH Org, visit the org/settings/member_privileges admin page, and change the Base permissions for all repos to "Write"

    open "https://github.com/organizations/$GITHUB_ORGANIZATION/settings/member_privileges/"
  2. When asked to fork the janus-idp/software-templates repo to your new GH Org, fork this repo instead: https://github.com/redhat-scholars/backstage-workshop. Make sure that the resulting repo is named "software-templates"

  3. When running the template playbook, use this modified template.yaml file instead: https://github.com/ryanj/janus-platforms/blob/workshop/ansible/cluster-setup/template.yaml

  4. When running the site playbook, use this modified site.yaml file instead: https://github.com/ryanj/janus-platforms/blob/workshop/ansible/cluster-setup/site.yaml

  5. After the ansible installation has finished successfully, complete all Post Install instructions in the next section

Post Install

TODO: Automate this section using Ansible

This section includes creating three console links, and installing the Namespace Configuration Operator.

Create three console links for the header menu:

cat <<EOF | oc apply -f -
apiVersion: console.openshift.io/v1
kind: ConsoleLink
metadata:
  name: application-menu-github
spec:
  href: 'https://github.com/$GITHUB_ORGANIZATION'
  location: ApplicationMenu
  text: $GITHUB_ORGANIZATION
  applicationMenu:
    section: Workshop Resources
    imageURL: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
EOF
cat <<EOF | oc apply -f -
apiVersion: console.openshift.io/v1
kind: ConsoleLink
metadata:
  name: application-menu-content
spec:
  href: 'https://redhat-scholars.github.io/backstage-workshop'
  location: ApplicationMenu
  text: Workshop Content
  applicationMenu:
    section: Workshop Resources
    # TODO: Get better source URL, or add to GitHub
    imageURL: https://yt3.ggpht.com/ytc/AKedOLRI9AQ_w5yyklg6BhPexpyq9ZPbAXZnXTnzEcyx5Q=s88-c-k-c0x00ffffff-no-rj
EOF
cat <<EOF | oc apply -f -
apiVersion: console.openshift.io/v1
kind: ConsoleLink
metadata:
  name: application-menu-backstage
spec:
  href: 'https://janus-demo.apps$OPENSHIFT_CLUSTER_INFO'
  location: ApplicationMenu
  text: Backstage
  applicationMenu:
    section: Workshop Resources
    # TODO: Get better source URL, or add to GitHub
    imageURL: https://janus-idp.io/images/favicon/favicon.ico
EOF

Installing the Namespace Configuration Operator

Warning
This section is only intended for OpenShift clusters that are using GH Auth to authenticate cluster users. Skip this section if you are not using GH Auth to log in to your OpenShift cluster. (See the providerName config line in the below yaml)

Install the CoP Namespace Configuration Operator from the OperatorHub:

oc new-project namespace-configuration-operator
oc create -f https://raw.githubusercontent.com/redhat-cop/namespace-configuration-operator/master/config/operatorhub/operator.yaml

After the operator installation has completed, install the following UserConfig yaml:

cat <<EOF | oc create -f -
kind: UserConfig
apiVersion: redhatcop.redhat.io/v1alpha1
metadata:
  name: test-user-config
spec:
  annotationSelector: {}
  identityExtraFieldSelector: {}
  labelSelector: {}
  providerName: GitHub
  templates:
    - excludedPaths:
        - .spec.replicas
        - .metadata
        - .status
      objectTemplate: |
        - apiVersion: project.openshift.io/v1
          kind: Project
          metadata:
            name: {{ .Name }}
        - apiVersion: rbac.authorization.k8s.io/v1
          kind: RoleBinding
          metadata:
            name: {{ .Name }}-rolebinding
            namespace: {{ .Name }}
          roleRef:
            apiGroup: rbac.authorization.k8s.io
            kind: ClusterRole
            name: admin
          subjects:
          - apiGroup: rbac.authorization.k8s.io
            kind: User
            name: {{ .Name }}
EOF

About

Backstage workshop for Red Hat Summit 2023

License:Apache License 2.0


Languages

Language:HTML 86.6%Language:Java 6.1%Language:TypeScript 2.6%Language:Dockerfile 2.1%Language:Smarty 1.2%Language:JavaScript 1.1%Language:Handlebars 0.1%Language:CSS 0.0%Language:Shell 0.0%