Created
March 29, 2021 18:29
-
-
Save iam-veeramalla/f0c67dd345cba72109792a20e0eea167 to your computer and use it in GitHub Desktop.
RH-SSO/Keycloak Installation using OpenShift Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Login as admin into your cluster | |
``` | |
oc login -u kubeadmin -p password | |
``` | |
Run the following commands to update the core set of Red Hat Single Sign-On 7.4.6.GA resources for OpenShift in the openshift project | |
``` | |
for resource in sso74-image-stream.json \ | |
sso74-https.json \ | |
sso74-postgresql.json \ | |
sso74-postgresql-persistent.json \ | |
sso74-ocp4-x509-https.json \ | |
sso74-ocp4-x509-postgresql-persistent.json | |
do | |
oc -n openshift replace -f \ | |
https://raw.githubusercontent.com/jboss-container-images/redhat-sso-7-openshift-image/sso74-dev/templates/${resource} | |
done | |
``` | |
[Ignore for Disconnected Cluster]Run the following command to install the Red Hat Single Sign-On 7.4.6.GA OpenShift image streams in the openshift project: | |
``` | |
oc -n openshift import-image rh-sso-7/sso74-openshift-rhel8:7.4 --from=registry.redhat.io/rh-sso-7/sso74-openshift-rhel8:7.4 --confirm | |
``` | |
[Only for Disconnected Cluster]Please perform below mentioned additional steps for disconnected/air-gapped/proxy environments. | |
``` | |
docker pull registry.redhat.io/rh-sso-7/sso74-openshift-rhel8:7.4 | |
docker tag registry.redhat.io/rh-sso-7/sso74-openshift-rhel8:7.4 upshift.mirror-registry.qe.devcluster.openshift.com:5000/rhsso | |
docker push upshift.mirror-registry.qe.devcluster.openshift.com:5000/rhsso | |
> Edit the imagestream to update the docker images sections. | |
"spec": { | |
"dockerImageRepository": "172.30.69.44:5000/openshift/mongodb-26-rhel7", | |
oc -n openshift import-image rh-sso-7/sso74-openshift-rhel8:7.4 --from=upshift.mirror-registry.qe.devcluster.openshift.com:5000/rhsso --confirm | |
``` | |
Create a new project: | |
``` | |
oc new-project keycloak | |
``` | |
Add the view role to the default service account. This enables the service account to view all the resources in the sso-app-demo namespace, which is necessary for managing the cluster. | |
``` | |
oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default | |
``` | |
Deploying the Template using OpenShift CLI | |
``` | |
List the available Red Hat Single Sign-On application templates: | |
oc get templates -n openshift -o name | grep -o 'sso74.\+' | |
``` | |
Deploy the required template, Output of this command provides all the important details like credentials. | |
``` | |
oc new-app --template=sso74-ocp4-x509-https | |
``` | |
Login to RH-SSO, Get User-ID and Password from above command output. | |
``` | |
oc get routes | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment