The upstream source for the login, errors, and providers HTML templates for OpenShift.
- Install Jekyll and run
bundle install. - Install Yarn and run
yarn install.- Note that certain dependencies require Node.js 20+. You can install n to switch between node versions.
- Run
yarn serve-jekyll- Note that
yarn generate-styleswill have to be run if there are new PatternFly classes added to the HTML.
- Note that
Github Pages only runs in safe mode, preventing the usage of symlinks, so PatternFly source must be manually copied to _includes.
- Install Jekyll and run
bundle install. - Install Yarn and run
yarn install. - Run
yarn upgrade @patternfly/patternfly. - Run
yarn generate-styles. - Verify there are no regressions by running
yarn serve-jekyll. Note that the CSS will not be automatically updated, so if you make changes to the HTML, you will need to runyarn generate-stylesagain. - Make manual changes to the generated CSS if needed.
- Commit the changes.
The default templates for OKD are built into the oauth server template.go files via the following method:
- Copy the generated source in
_site/okd/errors.htmlto the corresponding template at https://github.com/openshift/oauth-server/blob/master/pkg/server/errorpage/templates.go. - Copy the generated source in
_site/okd/login.htmlto the corresponding template at https://github.com/openshift/oauth-server/blob/master/pkg/server/login/templates.go. - Copy the generated source in
_site/okd/providers.htmlto the corresponding template at https://github.com/openshift/oauth-server/blob/master/pkg/server/selectprovider/templates.go. - Submit a pull request to https://github.com/openshift/oauth-server containing the copied changes.
To test the changes:
- Create three key/value secrets in the
openshift-confignamespace with the following values:-
Secret Name:
errorKey:
errors.htmlValue: html from
https://github.com/openshift/oauth-server/blob/<HASH>/pkg/server/errorpage/templates.go -
Secret Name:
loginKey:
login.htmlValue: html from
https://github.com/openshift/oauth-server/blob/<HASH>/pkg/server/login/templates.go -
Secret Name:
providerKey:
providers.htmlValue: html from
https://github.com/openshift/oauth-server/blob/<HASH>/pkg/server/selectprovider/templates.go
-
- Update
specinhttps://<HOSTNAME>/k8s/cluster/config.openshift.io~v1~OAuth/cluster/yamlwith the following:templates: error: name: error login: name: login providerSelection: name: provider - Wait for new pods to be deployed at
https://<HOSTNAME>/k8s/ns/openshift-authentication/pods
To undo the changes for testing:
- Remove the changes from step 2 above at
https://<HOSTNAME>/k8s/cluster/config.openshift.io~v1~OAuth/cluster/yaml. - Delete the secrets created in step 1 above.
The RHO branded templates take advantage of the override mechanism by providing customized templates via secrets via the following method:
- Copy the output from
yarn generate-branding-secretto https://github.com/openshift/cluster-authentication-operator/blob/master/bindata/oauth-openshift/branding-secret.yaml. - Submit a pull request to https://github.com/openshift/cluster-authentication-operator containing the copied changes.
To test the changes:
- Scale
cluster-version-operatorto zero pods in the web console by visitinghttps://<HOSTNAME>/k8s/ns/openshift-cluster-version/deployments/cluster-version-operatorand using the pod donut controls to set pods to zero. Additionally, pause rollouts viaActions > Pause Rollouts. - Scale
authentication-operatorto zero pods in the web console by visitinghttps://<HOSTNAME>/k8s/ns/openshift-authentication-operator/deployments/authentication-operatorand using the pod donut controls to set pods to zero. - Delete the existing branding secret:
oc delete secret v4-0-config-system-ocp-branding-template -n openshift-authentication - Recreate the branding secret:
oc create -f https://raw.githubusercontent.com/openshift/cluster-authentication-operator/<HASH>/bindata/oauth-openshift/branding-secret.yaml - Delete existing openshift-authentication pods so they are regenerated with the new branding secret:
oc delete pods --all -n openshift-authentication
To undo the changes for testing:
- Resume rollouts of
cluster-version-operatorin the web console by visitinghttps://<HOSTNAME>/k8s/ns/openshift-cluster-version/deployments/cluster-version-operatorviaActions > Resume Rolloutsand scale pods back to one using the pod donut controls. - Visit
https://<HOSTNAME>/k8s/ns/openshift-authentication-operator/deployments/authentication-operatorand use the pod donut controls to set pods to one.
The OpenShift Dedicated and OpenShift Service on AWS branded templates also take advantage of the override mechanism. Note that the provider template has a special override for these brands: the kube:admin provider is hidden.
To update the templates used by OpenShift Dedicated and OpenShift Service on AWS, follow these steps:
- Install Jekyll and run
bundle install. - Install Yarn and run
yarn install. - Run
yarn build-jekyllto generate the HTML templates. The - You can find the templates for OpenShift Service on AWS and OpenShift Dedicated in the
_site/rosaand_site/oddirectories respectively. - Follow the instructions on the managed-cluster-config repository for OpenShift Dedicated and OpenShift Service on AWS to update the templates.