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
To set up your own workshop cluster, begin with the demo-setup installation instructions while implementing the following changes:
-
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/"
-
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" -
When running the
template
playbook, use this modifiedtemplate.yaml
file instead: https://github.com/ryanj/janus-platforms/blob/workshop/ansible/cluster-setup/template.yaml -
When running the
site
playbook, use this modifiedsite.yaml
file instead: https://github.com/ryanj/janus-platforms/blob/workshop/ansible/cluster-setup/site.yaml -
After the ansible installation has finished successfully, complete all Post Install instructions in the next section
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
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