├── .gitignore ├── README.md ├── docs └── demo-images │ ├── ocp-install-create-project.png │ ├── ocp-install-final-details.png │ ├── ocp-install-imagestreams.png │ ├── ocp-install-version-checking.png │ ├── ocp-install-video.png │ ├── ocp-login.png │ ├── ocp-service-catalog-mw.png │ ├── ocp-service-catalog-net.png │ ├── ocp-service-catalog.png │ ├── ocp-virtualbox.png │ ├── ocp.png │ ├── rhcs-arch.png │ └── rhcs-arch.pxm ├── init-win10.bat ├── init.bat ├── init.sh └── support ├── oc-builder.sh ├── ocp-restart.sh └── ocp-stop.sh /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .DS_Store 3 | *.box 4 | *.zip 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Update: June 2018 moved to [Gitlab](https://gitlab.com/redhatdemocentral/ocp-install-demo). 2 | 3 | 4 | OpenShift Container Platform Install Demo 5 | ========================================= 6 | If you are looking to develop containerized applications, the OpenShift Container Plaform (OCP) can help you by providing 7 | private PaaS (Cloud) environment you can install locally. It includes the same container development and run-time 8 | tools used to create and deploy containers for large data centers. 9 | 10 | This project requires a docker engine, OpenShift command line tools and VirtualBox, but these checks happen when you run the 11 | installation and point you to what is missing. It also checks that you have the right versions running too. 12 | 13 | Pro Tip: Pay close attention to console output, will guide you to dependencies you need if missing. These dependencies are 14 | listed here and the install provides pointers to downloads if missing: 15 | 16 | ``` 17 | 1. VirtualBox for Windows and OSX 18 | 2. Hyper-V for Windows 10 (Windows Feature Install) 19 | a. Important - Use Hyper-V Manager to create "ocpNET" Virtual Switch. (name is used in script) 20 | b. Important - Set "ocpNET" to External Network physical/wireless interface (with DHCP) - Must have Internet. 21 | 3. KVM for Linux 22 | 4. Docker-machine tooling 23 | 5. Ansible-playbook tooling 24 | 5. OpenShift Client (oc) v3.9.14 25 | ``` 26 | Need more help? Follow a lab workshop on [how to install OpenShift Container Platform step-by-step](https://appdevcloudworkshop.github.io/lab01.html). 27 | 28 | 29 | Install on your machine 30 | ----------------------- 31 | 1. [Download and unzip.](https://github.com/redhatdemocentral/ocp-install-demo/archive/master.zip) 32 | 33 | 2. Run 'init.sh', 'init.bat' or 'init-win10.bat' file, then sit back. (Note: 'init.bat' and 'init-win10.bat' must be run with Administrative privileges.) 34 | 35 | 3. Follow displayed instructions to log in to your brand new OpenShift Container Platform! 36 | 37 | 4. Still want more help installing? Try these 38 | instructions (part of an online workshop) that explain the installation in detail. 39 | 40 | 41 | Notes 42 | ----- 43 | Installation reserves default of 6GB memory on your machine for OCP, see comments at top of init scripts to adjust variable 44 | used to limit memory usage based on your needs. 45 | 46 | ----- 47 | 48 | Log in to the OCP console with: 49 | 50 | ``` 51 | Developer user: openshift-dev 52 | Developer pass: devel 53 | 54 | Admin user: admin 55 | Admin pass: admin 56 | ``` 57 | 58 | ------ 59 | 60 | Persisitence is enabled, so to shutdown and restart the openshift cluster with your projects in place DO NOT 61 | run 'docker-machine rm -f openshift' or use init.sh / init.bat, instead: 62 | 63 | ``` 64 | # shutdown using: 65 | # 66 | $ oc cluster down --docker-machine=openshift 67 | $ docker-machine stop openshift 68 | 69 | # restart use the existing data and configuration: 70 | # 71 | $ docker-machine start openshift 72 | $ oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data \ 73 | --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true \ 74 | --host-pv-dir=/var/lib/boot2docker/ocp-pv 75 | ``` 76 | 77 | You can find these commands for unix based machines in the directory support/{ocp-stop.sh|ocp-restart.sh}. 78 | 79 | ----- 80 | 81 | Network errors? If you recieve the following error, on Linux: 82 | 83 | ``` 84 | Error: did not detect an --insecure-registry argument on the Docker daemon 85 | ``` 86 | 87 | Then ensure that the Docker daemon is running with the following argument by: 88 | 89 | ``` 90 | # Add the following to /etc/sysconfig/docker file and 91 | # restart the docker service: 92 | # 93 | INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16' 94 | ``` 95 | 96 | Or this network error on osX: 97 | 98 | ``` 99 | Unable to connect to the server: net/http: TLS handshake timeout 100 | ``` 101 | 102 | Then add the this IP to the Docker Deamon insecure registry list: 103 | 104 | ``` 105 | 172.30.0.0/16 106 | 107 | ``` 108 | 109 | ----- 110 | 111 | This project has an install script that is setup to allow you to re-run it without worrying about previous 112 | installations. If you re-run it, it removes old 'openshift' machines and reinstalls for you. 113 | 114 | ----- 115 | 116 | 117 | Supporting Articles 118 | ------------------- 119 | - [Free Online Self-Paced Workshop Updated to OpenShift Container Platform 3.7](http://www.schabell.org/2017/12/free-online-self-paced-workshop-updated-openshift-37.html) 120 | 121 | - [Cloud Happiness - How to instal new OpenShift Container Platform 3.7 in minutes](http://www.schabell.org/2017/12/cloud-happiness-how-to-install-new-openshift-v37-in-minutes.html) 122 | 123 | - [Windows Hyper-V OpenShift Container Platform Install in Minutes](http://www.schabell.org/2017/11/windows-hyper-v-openshift-container-platform-install-minutes.html) 124 | 125 | - [10 Steps to Cloud Happiness: Step 2 - Use a Container Catalog](http://www.schabell.org/2017/10/10-steps-to-cloud-happiness-step-2.html) 126 | 127 | - [10 Steps to Cloud Happiness: Step 1 - Get a Cloud](http://www.schabell.org/2017/10/10-steps-to-cloud-happiness-step-1.html) 128 | 129 | - [Cloud Happiness - How to install new OpenShift Container Platform 3.6 in just minutes](http://www.schabell.org/2017/08/cloud-happiness-how-to-install-new-openshift-v36-in-minutes.html) 130 | 131 | - [Anyone show you how to install OpenShift Container Platform in minutes? (video)](http://www.schabell.org/2017/06/howto-install-openshift-container-platform-in-minutes-video.html) 132 | 133 | - [Cloud Happiness - How To Get OpenShift Container Platform v3.5 Installed in Minutes](http://www.schabell.org/2017/05/cloud-happiness-how-to-get-openshift.html) 134 | 135 | - [Red Hat Summit - How to setup a container platform for modern application delivery in minutes](http://www.schabell.org/2017/05/redhat-summit-how-to-setup-container-platform-slides.html) 136 | 137 | - [Red Hat Summit DevZone - Anyone show you how to install OpenShift Container Platform in minutes?](http://www.schabell.org/2017/05/devzone-how-to-install-openshift-slides.html) 138 | 139 | - [Get hands-on with AppDev Cloud free online workshop.](http://appdevcloudworkshop.github.io) 140 | 141 | - [Cloud Happiness - OpenShift Container Platform Install on Windows, why wait?](http://www.schabell.org/2017/03/cloud-happiness-openshift-container-platform-windows-install.html) 142 | 143 | - [Cloud Happiness - OpenShift Container Platform v3.4 install demo update](http://www.schabell.org/2017/02/cloud-happiness-openshift-container-platform-install-updated.html) 144 | 145 | - [Holiday Homework - Red Hat Cloud demo updates](http://www.schabell.org/2016/12/holiday-homework-redhat-cloud-demo-updates.html) 146 | 147 | - [3 Steps to Cloud Happiness with OpenShift Container Platform](http://www.schabell.org/2016/11/3-steps-to-cloud-happiness-with-ocp.html) 148 | 149 | 150 | Released versions 151 | ----------------- 152 | See the tagged releases for the following versions of the product: 153 | 154 | - v2.5 - OpenShift Container Platform v3.9 based on OpenShift command line tools v3.9.14, updated image streams and templates to v3.10 feeds. 155 | 156 | - v2.4 - OpenShift Container Platform v3.9 based on OpenShift command line tools v3.9.14. 157 | 158 | - v2.3 - OpenShift Container Platform v3.7 based on OpenShift command line tools v3.7.9 and added process server templates. 159 | 160 | - v2.2 - OpenShift Container Platform v3.7 based on OpenShift command line tools v3.7.9 with Docker dependency removed. 161 | 162 | - v2.1 - OpenShift Container Platform v3.7 based on OpenShift command line tools v3.7.9. 163 | 164 | - v2.0 - OpenShift Container Platform v3.6 based on OpenShift command line tools v3.6.173 with Hyper-V Windows installation. 165 | 166 | - v1.9 - OpenShift Container Platform v3.6 based on OpenShift command line tools v3.6.173 with tech preview service catalog enabled. 167 | 168 | - v1.8 - OpenShift Container Platform v3.6 based on OpenShift command line tools v3.6.173 with persistence enabled for restarts. 169 | 170 | - v1.7 - OpenShift Container Platform v3.5 based on OpenShift command line tools v3.5.5.5 with persistence enabled for restarts. 171 | 172 | - v1.6 - OpenShift Container Platform v3.5 based on OpenShift command line tools v3.5.5.5. 173 | 174 | - v1.5 - OpenShift Container Platform v3.4 based on OpenShift command line tools v3.4.1.2-fixed. 175 | 176 | - v1.4 - OpenShift Container Platform v3.4 based on OpenShift command line tools v3.4.1.2, added more JBoss product templates. 177 | 178 | - v1.3 - OpenShift Container Platform v3.4 based on OpenShift command line tools v3.4.1.2, added Windows installer option. 179 | 180 | - v1.2 - OpenShift Container Platform v3.4 based on OpenShift command line tools v3.4.1.2, improved docker validation for Linux. 181 | 182 | - v1.1 - OpenShift Container Platform v3.4 based on OpenShift command line tools v3.4.1.2. 183 | 184 | - v1.0 - OpenShift Container Platform v3.3 based on OpenShift command line tools v3.3.1.3. 185 | 186 | [![OCP Video](https://github.com/redhatdemocentral/ocp-install-demo/blob/master/docs/demo-images/ocp-install-video.png?raw=true)](https://youtu.be/Rj0We91ec9Y) 187 | 188 | ![OCP Login](https://github.com/redhatdemocentral/ocp-install-demo/blob/master/docs/demo-images/ocp-login.png?raw=true) 189 | 190 | ![OCP Catalog](https://github.com/redhatdemocentral/ocp-install-demo/blob/master/docs/demo-images/ocp-service-catalog.png?raw=true) 191 | 192 | ![Cloud Suite](https://github.com/redhatdemocentral/ocp-install-demo/blob/master/docs/demo-images/rhcs-arch.png?raw=true) 193 | 194 | -------------------------------------------------------------------------------- /docs/demo-images/ocp-install-create-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-install-create-project.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-install-final-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-install-final-details.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-install-imagestreams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-install-imagestreams.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-install-version-checking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-install-version-checking.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-install-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-install-video.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-login.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-service-catalog-mw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-service-catalog-mw.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-service-catalog-net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-service-catalog-net.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-service-catalog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-service-catalog.png -------------------------------------------------------------------------------- /docs/demo-images/ocp-virtualbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp-virtualbox.png -------------------------------------------------------------------------------- /docs/demo-images/ocp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/ocp.png -------------------------------------------------------------------------------- /docs/demo-images/rhcs-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/rhcs-arch.png -------------------------------------------------------------------------------- /docs/demo-images/rhcs-arch.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhatdemocentral/ocp-install-demo/35b3111ba40f049863919dfb01c5e0b3c43470f5/docs/demo-images/rhcs-arch.pxm -------------------------------------------------------------------------------- /init-win10.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | setlocal 3 | 4 | set PROJECT_HOME=%~dp0 5 | set DOCKER_MAJOR_VER=17 6 | set DOCKER_MINOR_VER=06 7 | set OC_MAJOR_VER=v3 8 | set OC_MINOR_VER=9 9 | set OC_MINI_VER=14 10 | set OCP_VERSION=%OC_MAJOR_VER%.%OC_MINOR_VER% 11 | set STREAM_BRMS_63="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/decisionserver63-image-stream.json" 12 | set STREAM_BRMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/decisionserver64-image-stream.json" 13 | set STREAM_EAP_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap64-image-stream.json" 14 | set STREAM_EAP_70="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap70-image-stream.json" 15 | set STREAM_EAP_71="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap71-image-stream.json" 16 | set STREAM_FUSE="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/fis-image-streams.json" 17 | set STREAM_OPENJDK18="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/openjdk18-image-stream.json" 18 | set STREAM_BPMS_63="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/processserver63-image-stream.json" 19 | set STREAM_BPMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/processserver64-image-stream.json" 20 | set STREAM_DOTNET="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/image-streams/dotnet_imagestreams.json" 21 | set STREAM_RHEL="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/image-streams/image-streams-rhel7.json" 22 | set TEMPLATE_EAP70="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/eap70-basic-s2i.json" 23 | set TEMPLATE_EAP71="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/eap71-basic-s2i.json" 24 | set TEMPLATE_BRMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/decisionserver64-basic-s2i.json" 25 | set TEMPLATE_BPM_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/processserver64-postgresql-s2i.json" 26 | set TEMPLATE_BPM_DB_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/processserver64-postgresql-persistent-s2i.json" 27 | 28 | REM uncomment amount memory needed, sets RAM usage limit for OCP, default 6 GB. 29 | REM set VM_MEMORY=10240 30 | set VM_MEMORY=6144 31 | REM set VM_MEMORY=3072 32 | 33 | REM wipe screen. 34 | cls 35 | 36 | echo. 37 | echo ############################################################## 38 | echo ## ## 39 | echo ## Setting up your very own ## 40 | echo ## ## 41 | echo ## ### #### ##### # # #### # # ##### ##### ##### ## 42 | echo ## # # # # # ## # # # # # # # ## 43 | echo ## # # #### ### # # # ### ##### # #### # ## 44 | echo ## # # # # # ## # # # # # # ## 45 | echo ## ### # ##### # # #### # # ##### # # ## 46 | echo ## ## 47 | echo ## #### ### # # ##### ### ##### # # ##### ##### ## 48 | echo ## # # # ## # # # # # ## # # # # ## 49 | echo ## # # # # # # # ##### # # # # ### ##### ## 50 | echo ## # # # # ## # # # # # ## # # # ## 51 | echo ## #### ### # # # # # ##### # # ##### # # ## 52 | echo ## ## 53 | echo ## #### # ### ##### ##### ### ##### # # ## 54 | echo ## # # # # # # # # # # # ## ## ## 55 | echo ## #### # ##### # #### # # ##### # # # ## 56 | echo ## # # # # # # # # # # # # ## 57 | echo ## # ##### # # # # ### # # # # ## 58 | echo ## ## 59 | echo ## https://github.com/redhatdemocentral/ocp-install-demo ## 60 | echo ## ## 61 | echo ############################################################## 62 | echo. 63 | 64 | REM Ensure OpenShift command line tools available. 65 | call oc help >nul 2>&1 66 | 67 | if %ERRORLEVEL% NEQ 0 ( 68 | echo OpenShift CLI tooling is required but not installed yet... download %OCP_VERSION% here: https://access.redhat.com/downloads/content/290 69 | GOTO :EOF 70 | ) else ( 71 | echo OpenShift command line tools installed... checking for valid version... 72 | echo. 73 | ) 74 | 75 | REM Ensure docker-machine tool available. 76 | call docker-machine -v >nul 2>&1 77 | 78 | if %ERRORLEVEL% NEQ 0 ( 79 | echo Docker-machine tooling is required but not installed yet... instructions here: https://docs.docker.com/machine/install-machine/#install-machine-directly 80 | GOTO :EOF 81 | ) else ( 82 | echo Docker-machine command line tools installed... 83 | echo. 84 | ) 85 | 86 | for /f "delims=*" %%i in ('oc version ^| findstr -i oc') do ( 87 | for /F "tokens=2 delims= " %%A in ('echo %%i') do ( 88 | set verFull=%%A 89 | ) 90 | ) 91 | 92 | for /F "tokens=1,2,3 delims=." %%a in ('echo %verFull%') do ( 93 | set verone=%%a 94 | set vertwo=%%b 95 | set verthree=%%c 96 | ) 97 | 98 | if %OC_MAJOR_VER% EQU %verone% if %OC_MINOR_VER% EQU %vertwo% if %OC_MINI_VER% EQU %verthree% ( 99 | echo Version of installed OpenShift command line tools correct... %verfull% 100 | echo. 101 | GOTO :passOcTestContinue 102 | ) 103 | 104 | echo Version of installed OpenShift command line tools is %verone%.%vertwo%.%verthree%, must be %OC_MAJOR_VER%.%OC_MINOR_VER%.%OC_MINI_VER%... 105 | echo. 106 | echo Download for Windows here: https://access.redhat.com/downloads/content/290 107 | GOTO :EOF 108 | 109 | :passOcTestContinue 110 | 111 | echo Setting up OpenShift docker machine... 112 | echo. 113 | call docker-machine create --driver hyperv --hyperv-cpu-count "2" --hyperv-memory %VM_MEMORY% --engine-insecure-registry 172.30.0.0/16 --hyperv-virtual-switch ocpNET --hyperv-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.13.1/boot2docker.iso openshift 114 | 115 | if %ERRORLEVEL% EQU 0 ( 116 | echo. 117 | echo Docker-Machine Install Good... 118 | echo. 119 | GOTO GoodMachine 120 | ) 121 | 122 | echo. 123 | echo Error occurred during openshift docker machine creation... 124 | echo. 125 | echo Cleaning out existing 'openshift' machine... 126 | echo. 127 | call docker-machine rm -f openshift 128 | echo Setting up new OpenShift docker machine... 129 | call docker-machine create --driver hyperv --hyperv-cpu-count "2" --hyperv-memory %VM_MEMORY% --engine-insecure-registry 172.30.0.0/16 --hyperv-virtual-switch ocpNET --hyperv-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.13.1/boot2docker.iso openshift 130 | 131 | if %ERRORLEVEL% NEQ 0 ( 132 | echo. 133 | echo Problem with docker machine creation that I can't resolve, validate network configuration and/or please raise an issue and add error output: 134 | echo. 135 | echo https://github.com/redhatdemocentral/ocp-install-demo/issues/new 136 | echo. 137 | GOTO :EOF 138 | ) 139 | 140 | 141 | :GoodMachine 142 | 143 | echo Installing OCP with cluster up... 144 | echo. 145 | 146 | call oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true --host-pv-dir=/var/lib/boot2docker/ocp-pv 147 | 148 | if %ERRORLEVEL% EQU 0 ( 149 | echo. 150 | echo OCP Good... 151 | echo. 152 | GOTO OCPGood 153 | ) 154 | 155 | echo. 156 | echo There was an issue starting OCP. Trying to recover... 157 | echo. 158 | call oc cluster down --docker-machine=openshift 159 | call oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true --host-pv-dir=/var/lib/boot2docker/ocp-pv 160 | 161 | if %ERRORLEVEL% NEQ 0 ( 162 | echo. 163 | echo There was an issue starting OCP. If you feel the need, raise an issue and add error output: 164 | echo. 165 | echo https://github.com/redhatdemocentral/ocp-install-demo/issues/new 166 | echo. 167 | GOTO :EOF 168 | ) 169 | 170 | :OCPGood 171 | 172 | echo. 173 | echo Logging in as admin user... 174 | echo. 175 | oc login -u system:admin 176 | 177 | for /f "delims=" %%i in ('oc status ^| findstr -i -c:"My Project"') do ( 178 | for /F "tokens=8 delims= " %%A in ('echo %%i') do ( 179 | set OCP_IP=%%A 180 | ) 181 | ) 182 | 183 | echo Granting admin user full cluster-admin rights... 184 | echo. 185 | call oc adm policy add-cluster-role-to-user cluster-admin admin 186 | 187 | if %ERRORLEVEL% NEQ 0 ( 188 | echo. 189 | echo Problem granting admin user full cluster-admin rights. 190 | echo. 191 | GOTO :EOF 192 | ) 193 | 194 | echo. 195 | echo Granting rights to service catalog access... 196 | echo. 197 | oc adm policy add-cluster-role-to-group system:openshift:templateservicebroker-client system:unauthenticated system:authenticated 198 | 199 | if %ERRORLEVEL% NEQ 0 ( 200 | echo. 201 | echo Problem granting service catalog rights. 202 | echo. 203 | GOTO :EOF 204 | ) 205 | 206 | echo. 207 | echo Updating JBoss image streams. 208 | 209 | REM Updating JBoss BRMS 6.3 image stream. 210 | call oc delete -n openshift -f %STREAM_BRMS_63% 211 | call oc create -n openshift -f %STREAM_BRMS_63% 212 | 213 | if %ERRORLEVEL% NEQ 0 ( 214 | echo. 215 | echo Problem with accessing JBoss BRMS 63 stream for OCP. 216 | echo. 217 | echo Trying again. 218 | echo. 219 | call oc delete -n openshift -f %STREAM_BRMS_63% 220 | call oc create -n openshift -f %STREAM_BRMS_63% 221 | 222 | if %ERRORLEVELS% NEQ 0 ( 223 | echo Failed again, exiting, check output messages and network connectivity before running install again. 224 | echo. 225 | call docker-machine rm -f openshift 226 | GOTO :EOF 227 | ) 228 | ) 229 | 230 | REM Updating JBoss BPMS 6.3 image stream. 231 | call oc delete -n openshift -f %STREAM_BPMS_63% 232 | call oc create -n openshift -f %STREAM_BPMS_63% 233 | 234 | if %ERRORLEVEL% NEQ 0 ( 235 | echo. 236 | echo Problem with accessing JBoss BPMS 63 stream for OCP. 237 | echo. 238 | echo Trying again. 239 | echo. 240 | call oc delete -n openshift -f %STREAM_BPMS_63% 241 | call oc create -n openshift -f %STREAM_BPMS_63% 242 | 243 | if %ERRORLEVELS% NEQ 0 ( 244 | echo Failed again, exiting, check output messages and network connectivity before running install again. 245 | echo. 246 | call docker-machine rm -f openshift 247 | GOTO :EOF 248 | ) 249 | ) 250 | 251 | REM Updating JBoss BRMS 6.4 image stream. 252 | call oc delete -n openshift -f %STREAM_BRMS_64% 253 | call oc create -n openshift -f %STREAM_BRMS_64% 254 | 255 | if %ERRORLEVEL% NEQ 0 ( 256 | echo. 257 | echo Problem with accessing JBoss BRMS 64 stream for OCP. 258 | echo. 259 | echo Trying again. 260 | echo. 261 | call oc delete -n openshift -f %STREAM_BRMS_64% 262 | call oc create -n openshift -f %STREAM_BRMS_64% 263 | 264 | if %ERRORLEVELS% NEQ 0 ( 265 | echo Failed again, exiting, check output messages and network connectivity before running install again. 266 | echo. 267 | call docker-machine rm -f openshift 268 | GOTO :EOF 269 | ) 270 | ) 271 | 272 | REM Updating JBoss BPMS 6.4 image stream. 273 | call oc delete -n openshift -f %STREAM_BPMS_64% 274 | call oc create -n openshift -f %STREAM_BPMS_64% 275 | 276 | if %ERRORLEVEL% NEQ 0 ( 277 | echo. 278 | echo Problem with accessing JBoss BPMS 64 stream for OCP. 279 | echo. 280 | echo Trying again. 281 | echo. 282 | call oc delete -n openshift -f %STREAM_BPMS_64% 283 | call oc create -n openshift -f %STREAM_BPMS_64% 284 | 285 | if %ERRORLEVELS% NEQ 0 ( 286 | echo Failed again, exiting, check output messages and network connectivity before running install again. 287 | echo. 288 | call docker-machine rm -f openshift 289 | GOTO :EOF 290 | ) 291 | ) 292 | 293 | REM Updating JBoss EAP 7.0 image stream. 294 | call oc delete -n openshift -f %STREAM_EAP_70% 295 | call oc create -n openshift -f %STREAM_EAP_70% 296 | 297 | if %ERRORLEVEL% NEQ 0 ( 298 | echo. 299 | echo Problem with accessing JBoss EAP 70 stream for OCP. 300 | echo. 301 | echo Trying again. 302 | echo. 303 | call oc delete -n openshift -f %STREAM_EAP_70% 304 | call oc create -n openshift -f %STREAM_EAP_70% 305 | 306 | if %ERRORLEVELS% NEQ 0 ( 307 | echo Failed again, exiting, check output messages and network connectivity before running install again. 308 | echo. 309 | call docker-machine rm -f openshift 310 | GOTO :EOF 311 | ) 312 | ) 313 | 314 | REM Updating JBoss EAP 7.1 image stream. 315 | call oc delete -n openshift -f %STREAM_EAP_71% 316 | call oc create -n openshift -f %STREAM_EAP_71% 317 | 318 | if %ERRORLEVEL% NEQ 0 ( 319 | echo. 320 | echo Problem with accessing JBoss EAP 71 stream for OCP. 321 | echo. 322 | echo Trying again. 323 | echo. 324 | call oc delete -n openshift -f %STREAM_EAP_71% 325 | call oc create -n openshift -f %STREAM_EAP_71% 326 | 327 | if %ERRORLEVELS% NEQ 0 ( 328 | echo Failed again, exiting, check output messages and network connectivity before running install again. 329 | echo. 330 | call docker-machine rm -f openshift 331 | GOTO :EOF 332 | ) 333 | ) 334 | 335 | REM Updating Fuse image streams. 336 | call oc delete -n openshift -f %STREAM_FUSE% 337 | call oc create -n openshift -f %STREAM_FUSE% 338 | 339 | if %ERRORLEVEL% NEQ 0 ( 340 | echo. 341 | echo Problem with accessing Fuse Integration product streams for OCP. 342 | echo. 343 | echo Trying again. 344 | echo. 345 | call oc delete -n openshift -f %STREAM_FUSE% 346 | call oc create -n openshift -f %STREAM_FUSE% 347 | 348 | if %ERRORLEVELS% NEQ 0 ( 349 | echo Failed again, exiting, check output messages and network connectivity before running install again. 350 | echo. 351 | call docker-machine rm -f openshift 352 | GOTO :EOF 353 | ) 354 | ) 355 | 356 | REM Updating OPENJDK18 image stream. 357 | call oc delete -n openshift -f %STREAM_OPENJDK18% 358 | call oc create -n openshift -f %STREAM_OPENJDK18% 359 | 360 | if %ERRORLEVEL% NEQ 0 ( 361 | echo. 362 | echo Problem with accessing OPENJDK18 stream for OCP. 363 | echo. 364 | echo Trying again. 365 | echo. 366 | call oc delete -n openshift -f %STREAM_OPENJDK18% 367 | call oc create -n openshift -f %STREAM_OPENJDK18% 368 | 369 | if %ERRORLEVELS% NEQ 0 ( 370 | echo Failed again, exiting, check output messages and network connectivity before running install again. 371 | echo. 372 | call docker-machine rm -f openshift 373 | GOTO :EOF 374 | ) 375 | ) 376 | 377 | REM Updating EAP 7.0 template. 378 | call oc delete -n openshift -f %TEMPLATE_EAP70% 379 | call oc create -n openshift -f %TEMPLATE_EAP70% 380 | 381 | if %ERRORLEVEL% NEQ 0 ( 382 | echo. 383 | echo Problem with accessing JBoss EAP 70 stream for OCP. 384 | echo. 385 | echo Trying again. 386 | echo. 387 | call oc delete -n openshift -f %TEMPLATE_EAP70% 388 | call oc create -n openshift -f %TEMPLATE_EAP70% 389 | 390 | if %ERRORLEVELS% NEQ 0 ( 391 | echo Failed again, exiting, check output messages and network connectivity before running install again. 392 | echo. 393 | call docker-machine rm -f openshift 394 | GOTO :EOF 395 | ) 396 | ) 397 | 398 | REM Updating EAP 7.1 template. 399 | call oc delete -n openshift -f %TEMPLATE_EAP71% 400 | call oc create -n openshift -f %TEMPLATE_EAP71% 401 | 402 | if %ERRORLEVEL% NEQ 0 ( 403 | echo. 404 | echo Problem with accessing JBoss EAP 71 stream for OCP. 405 | echo. 406 | echo Trying again. 407 | echo. 408 | call oc delete -n openshift -f %TEMPLATE_EAP71% 409 | call oc create -n openshift -f %TEMPLATE_EAP71% 410 | 411 | if %ERRORLEVELS% NEQ 0 ( 412 | echo Failed again, exiting, check output messages and network connectivity before running install again. 413 | echo. 414 | call docker-machine rm -f openshift 415 | GOTO :EOF 416 | ) 417 | ) 418 | 419 | REM Updating Decision Server 6.4 template. 420 | call oc delete -n openshift -f %TEMPLATE_BRMS_64% 421 | call oc create -n openshift -f %TEMPLATE_BRMS_64% 422 | 423 | if %ERRORLEVEL% NEQ 0 ( 424 | echo. 425 | echo Problem with accessing JBoss BRMS 64 stream for OCP. 426 | echo. 427 | echo Trying again. 428 | echo. 429 | call oc delete -n openshift -f %TEMPLATE_BRMS_64% 430 | call oc create -n openshift -f %TEMPLATE_BRMS_64% 431 | 432 | if %ERRORLEVELS% NEQ 0 ( 433 | echo Failed again, exiting, check output messages and network connectivity before running install again. 434 | echo. 435 | call docker-machine rm -f openshift 436 | GOTO :EOF 437 | ) 438 | ) 439 | 440 | REM Updating Process Server 6.4 template. 441 | call oc delete -n openshift -f %TEMPLATE_BPM_64% 442 | call oc create -n openshift -f %TEMPLATE_BPM_64% 443 | 444 | if %ERRORLEVEL% NEQ 0 ( 445 | echo. 446 | echo Problem with accessing JBoss BPM Suite 64 template for OCP. 447 | echo. 448 | echo Trying again. 449 | echo. 450 | call oc delete -n openshift -f %TEMPLATE_BPM_64% 451 | call oc create -n openshift -f %TEMPLATE_BPM_64% 452 | 453 | if %ERRORLEVELS% NEQ 0 ( 454 | echo Failed again, exiting, check output messages and network connectivity before running install again. 455 | echo. 456 | call docker-machine rm -f openshift 457 | GOTO :EOF 458 | ) 459 | ) 460 | 461 | REM Updating Process Server DB 6.4 template. 462 | call oc delete -n openshift -f %TEMPLATE_BPM_DB_64% 463 | call oc create -n openshift -f %TEMPLATE_BPM_DB_64% 464 | 465 | if %ERRORLEVEL% NEQ 0 ( 466 | echo. 467 | echo Problem with accessing JBoss BPM Suite DB 64 template for OCP. 468 | echo. 469 | echo Trying again. 470 | echo. 471 | call oc delete -n openshift -f %TEMPLATE_BPM_DB_64% 472 | call oc create -n openshift -f %TEMPLATE_BPM_DB_64% 473 | 474 | if %ERRORLEVELS% NEQ 0 ( 475 | echo Failed again, exiting, check output messages and network connectivity before running install again. 476 | echo. 477 | call docker-machine rm -f openshift 478 | GOTO :EOF 479 | ) 480 | ) 481 | 482 | echo. 483 | echo Updating RHEL 7 image streams... 484 | call oc delete -n openshift -f %STREAM_RHEL% 485 | call oc create -n openshift -f %STREAM_RHEL% 486 | 487 | if %ERRORLEVEL% NEQ 0 ( 488 | echo. 489 | echo Problem with accessing RHEL product streams for OCP. 490 | echo. 491 | echo Trying again. 492 | echo. 493 | call oc delete -n openshift -f %STREAM_RHEL% 494 | call oc create -n openshift -f %STREAM_RHEL% 495 | 496 | if %ERRORLEVELS% NEQ 0 ( 497 | echo Failed again, exiting, check output messages and network connectivity before running install again. 498 | echo. 499 | call docker-machine rm -f openshift 500 | GOTO :EOF 501 | ) 502 | ) 503 | 504 | echo. 505 | echo Update .Net image streams... 506 | call oc delete -n openshift -f %STREAM_DOTNET% 507 | call oc create -n openshift -f %STREAM_DOTNET% 508 | 509 | if %ERRORLEVEL% NEQ 0 ( 510 | echo. 511 | echo Problem with accessing .Net image streams for OCP. 512 | echo. 513 | echo Trying again. 514 | echo. 515 | call oc delete -n openshift -f %STREAM_DOTNET% 516 | call oc create -n openshift -f %STREAM_DOTNET% 517 | 518 | if %ERRORLEVELS% NEQ 0 ( 519 | echo Failed again, exiting, check output messages and network connectivity before running install again. 520 | echo. 521 | call docker-machine rm -f openshift 522 | GOTO :EOF 523 | ) 524 | ) 525 | 526 | echo. 527 | echo ==================================================== 528 | echo = = 529 | echo = Install complete, get ready to rock your Cloud. = 530 | echo = Look for information at end of OSE install. = 531 | echo = = 532 | echo = The server is accessible via web console at: = 533 | echo = = 534 | echo = %OCP_IP% = 535 | echo = = 536 | echo = Log in as user: openshift-dev = 537 | echo = password: devel = 538 | echo = = 539 | echo = Admin log in as: admin = 540 | echo = password: admin = 541 | echo = = 542 | echo = Now get your Red Hat Demo Central example = 543 | echo = projects here: = 544 | echo = = 545 | echo = https://github.com/redhatdemocentral = 546 | echo = = 547 | echo = To stop and restart your OCP cluster with = 548 | echo = installed containers, see Readme.md in the = 549 | echo = NOTES section for details. = 550 | echo = = 551 | echo = When finished, clean up your demo with: = 552 | echo = = 553 | echo = $ docker-machine rm -f openshift = 554 | echo = = 555 | echo ==================================================== 556 | -------------------------------------------------------------------------------- /init.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | setlocal 3 | 4 | set PROJECT_HOME=%~dp0 5 | set DOCKER_MAJOR_VER=17 6 | set DOCKER_MINOR_VER=06 7 | set OC_MAJOR_VER=v3 8 | set OC_MINOR_VER=9 9 | set OC_MINI_VER=14 10 | set OCP_VERSION=%OC_MAJOR_VER%.%OC_MINOR_VER% 11 | set STREAM_BRMS_63="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/decisionserver63-image-stream.json" 12 | set STREAM_BRMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/decisionserver64-image-stream.json" 13 | set STREAM_EAP_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap64-image-stream.json" 14 | set STREAM_EAP_70="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap70-image-stream.json" 15 | set STREAM_EAP_71="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap71-image-stream.json" 16 | set STREAM_FUSE="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/fis-image-streams.json" 17 | set STREAM_OPENJDK18="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/openjdk18-image-stream.json" 18 | set STREAM_BPMS_63="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/processserver63-image-stream.json" 19 | set STREAM_BPMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/processserver64-image-stream.json" 20 | set STREAM_DOTNET="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/image-streams/dotnet_imagestreams.json" 21 | set STREAM_RHEL="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/image-streams/image-streams-rhel7.json" 22 | set TEMPLATE_EAP70="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/eap70-basic-s2i.json" 23 | set TEMPLATE_EAP71="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/eap71-basic-s2i.json" 24 | set TEMPLATE_BRMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/decisionserver64-basic-s2i.json" 25 | set TEMPLATE_BPM_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/processserver64-postgresql-s2i.json" 26 | set TEMPLATE_BPM_DB_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/processserver64-postgresql-persistent-s2i.json" 27 | 28 | 29 | REM uncomment amount memory needed, sets RAM usage limit for OCP, default 6 GB. 30 | REM set VM_MEMORY=10240 31 | REM set VM_MEMORY=8192 32 | set VM_MEMORY=6144 33 | 34 | REM wipe screen. 35 | cls 36 | 37 | echo. 38 | echo ############################################################## 39 | echo ## ## 40 | echo ## Setting up your very own ## 41 | echo ## ## 42 | echo ## ### #### ##### # # #### # # ##### ##### ##### ## 43 | echo ## # # # # # ## # # # # # # # ## 44 | echo ## # # #### ### # # # ### ##### # #### # ## 45 | echo ## # # # # # ## # # # # # # ## 46 | echo ## ### # ##### # # #### # # ##### # # ## 47 | echo ## ## 48 | echo ## #### ### # # ##### ### ##### # # ##### ##### ## 49 | echo ## # # # ## # # # # # ## # # # # ## 50 | echo ## # # # # # # # ##### # # # # ### ##### ## 51 | echo ## # # # # ## # # # # # ## # # # ## 52 | echo ## #### ### # # # # # ##### # # ##### # # ## 53 | echo ## ## 54 | echo ## #### # ### ##### ##### ### ##### # # ## 55 | echo ## # # # # # # # # # # # ## ## ## 56 | echo ## #### # ##### # #### # # ##### # # # ## 57 | echo ## # # # # # # # # # # # # ## 58 | echo ## # ##### # # # # ### # # # # ## 59 | echo ## ## 60 | echo ## https://github.com/redhatdemocentral/ocp-install-demo ## 61 | echo ## ## 62 | echo ############################################################## 63 | echo. 64 | 65 | REM Ensure OpenShift command line tools available. 66 | call oc help >nul 2>&1 67 | 68 | if %ERRORLEVEL% NEQ 0 ( 69 | echo OpenShift CLI tooling is required but not installed yet... download %OCP_VERSION% here: https://access.redhat.com/downloads/content/290 70 | GOTO :EOF 71 | ) else ( 72 | echo OpenShift command line tools installed... checking for valid version... 73 | echo. 74 | ) 75 | 76 | REM Ensure docker-machine tool available. 77 | call docker-machine -v >nul 2>&1 78 | 79 | if %ERRORLEVEL% NEQ 0 ( 80 | echo Docker-machine tooling is required but not installed yet... instructions here: https://docs.docker.com/machine/install-machine/#install-machine-directly 81 | GOTO :EOF 82 | ) else ( 83 | echo Docker-machine command line tools installed... 84 | echo. 85 | ) 86 | 87 | for /f "delims=*" %%i in ('oc version ^| findstr -i oc') do ( 88 | for /F "tokens=2 delims= " %%A in ('echo %%i') do ( 89 | set verFull=%%A 90 | ) 91 | ) 92 | 93 | for /F "tokens=1,2,3 delims=." %%a in ('echo %verFull%') do ( 94 | set verone=%%a 95 | set vertwo=%%b 96 | set verthree=%%c 97 | ) 98 | 99 | if %OC_MAJOR_VER% EQU %verone% if %OC_MINOR_VER% EQU %vertwo% if %OC_MINI_VER% EQU %verthree% ( 100 | echo Version of installed OpenShift command line tools correct... %verfull% 101 | echo. 102 | GOTO :passOcTestContinue 103 | ) 104 | 105 | echo Version of installed OpenShift command line tools is %verone%.%vertwo%.%verthree%, must be %OC_MAJOR_VER%.%OC_MINOR_VER%.%OC_MINI_VER%... 106 | echo. 107 | echo Download for Windows here: https://access.redhat.com/downloads/content/290 108 | GOTO :EOF 109 | 110 | :passOcTestContinue 111 | 112 | echo Setting up OpenShift docker machine... 113 | echo. 114 | call docker-machine create --driver virtualbox --virtualbox-cpu-count "2" --virtualbox-memory "%VBOX_MEMORY%" --engine-insecure-registry 172.30.0.0/16 --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.13.1/boot2docker.iso openshift 115 | 116 | if %ERRORLEVEL% NEQ 0 ( 117 | echo. 118 | echo Error occurred during openshift docker machine creation... 119 | echo. 120 | echo Cleaning out existing 'openshift' machine... 121 | echo. 122 | call docker-machine rm -f openshift 123 | 124 | echo Setting up new OpenShift docker machine... 125 | echo. 126 | call docker-machine create --driver virtualbox --virtualbox-cpu-count "2" --virtualbox-memory "%VBOX_MEMORY%" --engine-insecure-registry 172.30.0.0/16 --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.13.1/boot2docker.iso openshift 127 | 128 | if %ERRORLEVEL% NEQ 0 ( 129 | echo. 130 | echo Problem with docker machine creation that I can't resolve, please raise an issue and add error output: 131 | echo. 132 | echo https://github.com/redhatdemocentral/ocp-install-demo/issues/new 133 | echo. 134 | GOTO :EOF 135 | ) 136 | ) 137 | 138 | echo Installing OCP with cluster up... 139 | echo. 140 | 141 | call oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true --host-pv-dir=/var/lib/boot2docker/ocp-pv 142 | 143 | if %ERRORLEVEL% NEQ 0 ( 144 | echo. 145 | echo There was an issue starting OCP. If you feel the need, raise an issue and add error output: 146 | echo. 147 | echo https://github.com/redhatdemocentral/ocp-install-demo/issues/new 148 | echo. 149 | GOTO :EOF 150 | ) 151 | 152 | echo. 153 | echo Logging in as admin user... 154 | echo. 155 | oc login -u system:admin 156 | 157 | for /f "delims=" %%i in ('oc status ^| findstr -i -c:"My Project"') do ( 158 | for /F "tokens=8 delims= " %%A in ('echo %%i') do ( 159 | set OCP_IP=%%A 160 | ) 161 | ) 162 | 163 | echo Granting admin user full cluster-admin rights... 164 | echo. 165 | call oc adm policy add-cluster-role-to-user cluster-admin admin 166 | 167 | if %ERRORLEVEL% NEQ 0 ( 168 | echo. 169 | echo Problem granting admin user full cluster-admin rights. 170 | echo. 171 | GOTO :EOF 172 | ) 173 | 174 | echo. 175 | echo Granting rights to service catalog access... 176 | echo. 177 | oc adm policy add-cluster-role-to-group system:openshift:templateservicebroker-client system:unauthenticated system:authenticated 178 | 179 | if %ERRORLEVEL% NEQ 0 ( 180 | echo. 181 | echo Problem granting service catalog rights. 182 | echo. 183 | GOTO :EOF 184 | ) 185 | 186 | echo. 187 | echo Updating JBoss image streams... 188 | 189 | REM Updating JBoss BRMS 6.3 image stream. 190 | call oc delete -n openshift -f %STREAM_BRMS_63% 191 | call oc create -n openshift -f %STREAM_BRMS_63% 192 | 193 | if %ERRORLEVEL% NEQ 0 ( 194 | echo. 195 | echo Problem with accessing JBoss BRMS 63 stream for OCP. 196 | echo. 197 | echo Trying again. 198 | echo. 199 | call oc delete -n openshift -f %STREAM_BRMS_63% 200 | call oc create -n openshift -f %STREAM_BRMS_63% 201 | 202 | if %ERRORLEVELS% NEQ 0 ( 203 | echo Failed again, exiting, check output messages and network connectivity before running install again. 204 | echo. 205 | call docker-machine rm -f openshift 206 | GOTO :EOF 207 | ) 208 | ) 209 | 210 | REM Updating JBoss BPMS 6.3 image stream. 211 | call oc delete -n openshift -f %STREAM_BPMS_63% 212 | call oc create -n openshift -f %STREAM_BPMS_63% 213 | 214 | if %ERRORLEVEL% NEQ 0 ( 215 | echo. 216 | echo Problem with accessing JBoss BPMS 63 stream for OCP. 217 | echo. 218 | echo Trying again. 219 | echo. 220 | call oc delete -n openshift -f %STREAM_BPMS_63% 221 | call oc create -n openshift -f %STREAM_BPMS_63% 222 | 223 | if %ERRORLEVELS% NEQ 0 ( 224 | echo Failed again, exiting, check output messages and network connectivity before running install again. 225 | echo. 226 | call docker-machine rm -f openshift 227 | GOTO :EOF 228 | ) 229 | ) 230 | 231 | REM Updating JBoss BRMS 6.4 image stream. 232 | call oc delete -n openshift -f %STREAM_BRMS_64% 233 | call oc create -n openshift -f %STREAM_BRMS_64% 234 | 235 | if %ERRORLEVEL% NEQ 0 ( 236 | echo. 237 | echo Problem with accessing JBoss BRMS 64 stream for OCP. 238 | echo. 239 | echo Trying again. 240 | echo. 241 | call oc delete -n openshift -f %STREAM_BRMS_64% 242 | call oc create -n openshift -f %STREAM_BRMS_64% 243 | 244 | if %ERRORLEVELS% NEQ 0 ( 245 | echo Failed again, exiting, check output messages and network connectivity before running install again. 246 | echo. 247 | call docker-machine rm -f openshift 248 | GOTO :EOF 249 | ) 250 | ) 251 | 252 | REM Updating JBoss BPMS 6.4 image stream. 253 | call oc delete -n openshift -f %STREAM_BPMS_64% 254 | call oc create -n openshift -f %STREAM_BPMS_64% 255 | 256 | if %ERRORLEVEL% NEQ 0 ( 257 | echo. 258 | echo Problem with accessing JBoss BPMS 64 stream for OCP. 259 | echo. 260 | echo Trying again. 261 | echo. 262 | call oc delete -n openshift -f %STREAM_BPMS_64% 263 | call oc create -n openshift -f %STREAM_BPMS_64% 264 | 265 | if %ERRORLEVELS% NEQ 0 ( 266 | echo Failed again, exiting, check output messages and network connectivity before running install again. 267 | echo. 268 | call docker-machine rm -f openshift 269 | GOTO :EOF 270 | ) 271 | ) 272 | 273 | REM Updating JBoss EAP 7.0 image stream. 274 | call oc delete -n openshift -f %STREAM_EAP_70% 275 | call oc create -n openshift -f %STREAM_EAP_70% 276 | 277 | if %ERRORLEVEL% NEQ 0 ( 278 | echo. 279 | echo Problem with accessing JBoss EAP 70 stream for OCP. 280 | echo. 281 | echo Trying again. 282 | echo. 283 | call oc delete -n openshift -f %STREAM_EAP_70% 284 | call oc create -n openshift -f %STREAM_EAP_70% 285 | 286 | if %ERRORLEVELS% NEQ 0 ( 287 | echo Failed again, exiting, check output messages and network connectivity before running install again. 288 | echo. 289 | call docker-machine rm -f openshift 290 | GOTO :EOF 291 | ) 292 | ) 293 | 294 | REM Updating JBoss EAP 7.1 image stream. 295 | call oc delete -n openshift -f %STREAM_EAP_71% 296 | call oc create -n openshift -f %STREAM_EAP_71% 297 | 298 | if %ERRORLEVEL% NEQ 0 ( 299 | echo. 300 | echo Problem with accessing JBoss EAP 71 stream for OCP. 301 | echo. 302 | echo Trying again. 303 | echo. 304 | call oc delete -n openshift -f %STREAM_EAP_71% 305 | call oc create -n openshift -f %STREAM_EAP_71% 306 | 307 | if %ERRORLEVELS% NEQ 0 ( 308 | echo Failed again, exiting, check output messages and network connectivity before running install again. 309 | echo. 310 | call docker-machine rm -f openshift 311 | GOTO :EOF 312 | ) 313 | ) 314 | 315 | REM Updating Fuse image streams. 316 | call oc delete -n openshift -f %STREAM_FUSE% 317 | call oc create -n openshift -f %STREAM_FUSE% 318 | 319 | if %ERRORLEVEL% NEQ 0 ( 320 | echo. 321 | echo Problem with accessing Fuse Integration product streams for OCP. 322 | echo. 323 | echo Trying again. 324 | echo. 325 | call oc delete -n openshift -f %STREAM_FUSE% 326 | call oc create -n openshift -f %STREAM_FUSE% 327 | 328 | if %ERRORLEVELS% NEQ 0 ( 329 | echo Failed again, exiting, check output messages and network connectivity before running install again. 330 | echo. 331 | call docker-machine rm -f openshift 332 | GOTO :EOF 333 | ) 334 | ) 335 | 336 | REM Updating OPENJDK18 image stream. 337 | call oc delete -n openshift -f %STREAM_OPENJDK18% 338 | call oc create -n openshift -f %STREAM_OPENJDK18% 339 | 340 | if %ERRORLEVEL% NEQ 0 ( 341 | echo. 342 | echo Problem with accessing OPENJDK18 stream for OCP. 343 | echo. 344 | echo Trying again. 345 | echo. 346 | call oc delete -n openshift -f %STREAM_OPENJDK18% 347 | call oc create -n openshift -f %STREAM_OPENJDK18% 348 | 349 | if %ERRORLEVELS% NEQ 0 ( 350 | echo Failed again, exiting, check output messages and network connectivity before running install again. 351 | echo. 352 | call docker-machine rm -f openshift 353 | GOTO :EOF 354 | ) 355 | ) 356 | 357 | REM Updating EAP 7.0 template. 358 | call oc delete -n openshift -f %TEMPLATE_EAP70% 359 | call oc create -n openshift -f %TEMPLATE_EAP70% 360 | 361 | if %ERRORLEVEL% NEQ 0 ( 362 | echo. 363 | echo Problem with accessing JBoss EAP 70 stream for OCP. 364 | echo. 365 | echo Trying again. 366 | echo. 367 | call oc delete -n openshift -f %TEMPLATE_EAP70% 368 | call oc create -n openshift -f %TEMPLATE_EAP70% 369 | 370 | if %ERRORLEVELS% NEQ 0 ( 371 | echo Failed again, exiting, check output messages and network connectivity before running install again. 372 | echo. 373 | call docker-machine rm -f openshift 374 | GOTO :EOF 375 | ) 376 | ) 377 | 378 | REM Updating EAP 7.1 template. 379 | call oc delete -n openshift -f %TEMPLATE_EAP71% 380 | call oc create -n openshift -f %TEMPLATE_EAP71% 381 | 382 | if %ERRORLEVEL% NEQ 0 ( 383 | echo. 384 | echo Problem with accessing JBoss EAP 71 stream for OCP. 385 | echo. 386 | echo Trying again. 387 | echo. 388 | call oc delete -n openshift -f %TEMPLATE_EAP71% 389 | call oc create -n openshift -f %TEMPLATE_EAP71% 390 | 391 | if %ERRORLEVELS% NEQ 0 ( 392 | echo Failed again, exiting, check output messages and network connectivity before running install again. 393 | echo. 394 | call docker-machine rm -f openshift 395 | GOTO :EOF 396 | ) 397 | ) 398 | 399 | REM Updating Decision Server 6.4 template. 400 | call oc delete -n openshift -f %TEMPLATE_BRMS_64% 401 | call oc create -n openshift -f %TEMPLATE_BRMS_64% 402 | 403 | if %ERRORLEVEL% NEQ 0 ( 404 | echo. 405 | echo Problem with accessing JBoss BRMS 64 stream for OCP. 406 | echo. 407 | echo Trying again. 408 | echo. 409 | call oc delete -n openshift -f %TEMPLATE_BRMS_64% 410 | call oc create -n openshift -f %TEMPLATE_BRMS_64% 411 | 412 | if %ERRORLEVELS% NEQ 0 ( 413 | echo Failed again, exiting, check output messages and network connectivity before running install again. 414 | echo. 415 | call docker-machine rm -f openshift 416 | GOTO :EOF 417 | ) 418 | ) 419 | 420 | REM Updating Process Server 6.4 template. 421 | call oc delete -n openshift -f %TEMPLATE_BPM_64% 422 | call oc create -n openshift -f %TEMPLATE_BPM_64% 423 | 424 | if %ERRORLEVEL% NEQ 0 ( 425 | echo. 426 | echo Problem with accessing JBoss BPM Suite 64 template for OCP. 427 | echo. 428 | echo Trying again. 429 | echo. 430 | call oc delete -n openshift -f %TEMPLATE_BPM_64% 431 | call oc create -n openshift -f %TEMPLATE_BPM_64% 432 | 433 | if %ERRORLEVELS% NEQ 0 ( 434 | echo Failed again, exiting, check output messages and network connectivity before running install again. 435 | echo. 436 | call docker-machine rm -f openshift 437 | GOTO :EOF 438 | ) 439 | ) 440 | 441 | REM Updating Process Server DB 6.4 template. 442 | call oc delete -n openshift -f %TEMPLATE_BPM_DB_64% 443 | call oc create -n openshift -f %TEMPLATE_BPM_DB_64% 444 | 445 | if %ERRORLEVEL% NEQ 0 ( 446 | echo. 447 | echo Problem with accessing JBoss BPM Suite DB 64 template for OCP. 448 | echo. 449 | echo Trying again. 450 | echo. 451 | call oc delete -n openshift -f %TEMPLATE_BPM_DB_64% 452 | call oc create -n openshift -f %TEMPLATE_BPM_DB_64% 453 | 454 | if %ERRORLEVELS% NEQ 0 ( 455 | echo Failed again, exiting, check output messages and network connectivity before running install again. 456 | echo. 457 | call docker-machine rm -f openshift 458 | GOTO :EOF 459 | ) 460 | ) 461 | 462 | echo. 463 | echo Updating RHEL 7 image streams... 464 | call oc delete -n openshift -f %STREAM_RHEL% 465 | call oc create -n openshift -f %STREAM_RHEL% 466 | 467 | if %ERRORLEVEL% NEQ 0 ( 468 | echo. 469 | echo Problem with accessing RHEL product streams for OCP. 470 | echo. 471 | echo Trying again. 472 | echo. 473 | call oc delete -n openshift -f %STREAM_RHEL% 474 | call oc create -n openshift -f %STREAM_RHEL% 475 | 476 | if %ERRORLEVELS% NEQ 0 ( 477 | echo Failed again, exiting, check output messages and network connectivity before running install again. 478 | echo. 479 | call docker-machine rm -f openshift 480 | GOTO :EOF 481 | ) 482 | ) 483 | 484 | echo. 485 | echo Update .Net image streams... 486 | call oc delete -n openshift -f %STREAM_DOTNET% 487 | call oc create -n openshift -f %STREAM_DOTNET% 488 | 489 | if %ERRORLEVEL% NEQ 0 ( 490 | echo. 491 | echo Problem with accessing .Net image streams for OCP. 492 | echo. 493 | echo Trying again. 494 | echo. 495 | call oc delete -n openshift -f %STREAM_DOTNET% 496 | call oc create -n openshift -f %STREAM_DOTNET% 497 | 498 | if %ERRORLEVELS% NEQ 0 ( 499 | echo Failed again, exiting, check output messages and network connectivity before running install again. 500 | echo. 501 | call docker-machine rm -f openshift 502 | GOTO :EOF 503 | ) 504 | ) 505 | 506 | echo. 507 | echo ==================================================== 508 | echo = = 509 | echo = Install complete, get ready to rock your Cloud. = 510 | echo = Look for information at end of OSE install. = 511 | echo = = 512 | echo = The server is accessible via web console at: = 513 | echo = = 514 | echo = %OCP_IP% = 515 | echo = = 516 | echo = Log in as user: openshift-dev = 517 | echo = password: devel = 518 | echo = = 519 | echo = Admin log in as: admin = 520 | echo = password: admin = 521 | echo = = 522 | echo = Now get your Red Hat Demo Central example = 523 | echo = projects here: = 524 | echo = = 525 | echo = https://github.com/redhatdemocentral = 526 | echo = = 527 | echo = To stop and restart your OCP cluster with = 528 | echo = installed containers, see Readme.md in the = 529 | echo = NOTES section for details. = 530 | echo = = 531 | echo = When finished, clean up your demo with: = 532 | echo = = 533 | echo = $ docker-machine rm -f openshift = 534 | echo = = 535 | echo ==================================================== 536 | echo. 537 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DOCKER_MAJOR_VER=17 4 | DOCKER_MINOR_VER=06 5 | OC_MAJOR_VER="v3" 6 | OC_MINOR_VER=9 7 | OC_MINI_VER=14 8 | OCP_VERSION="$OC_MAJOR_VER.$OC_MINOR_VER" 9 | ISO_URL="https://github.com/boot2docker/boot2docker/releases/download/v1.13.1/boot2docker.iso" 10 | ISO_CACHE="file://$HOME/.docker/machine/cache/boot2docker.iso" 11 | VIRT_DRIVER="virtualbox" 12 | STREAM_BRMS_63="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/decisionserver63-image-stream.json" 13 | STREAM_BRMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/decisionserver64-image-stream.json" 14 | STREAM_EAP_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap64-image-stream.json" 15 | STREAM_EAP_70="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap70-image-stream.json" 16 | STREAM_EAP_71="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/eap71-image-stream.json" 17 | STREAM_FUSE="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/fis-image-streams.json" 18 | STREAM_OPENJDK18="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/openjdk18-image-stream.json" 19 | STREAM_BPMS_63="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/processserver63-image-stream.json" 20 | STREAM_BPMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-streams/processserver64-image-stream.json" 21 | STREAM_DOTNET="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/image-streams/dotnet_imagestreams.json" 22 | STREAM_RHEL="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/image-streams/image-streams-rhel7.json" 23 | TEMPLATE_EAP70="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/eap70-basic-s2i.json" 24 | TEMPLATE_EAP71="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/eap71-basic-s2i.json" 25 | TEMPLATE_BRMS_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/decisionserver64-basic-s2i.json" 26 | TEMPLATE_BPM_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/processserver64-postgresql-s2i.json" 27 | TEMPLATE_BPM_DB_64="https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v3.10/xpaas-templates/processserver64-postgresql-persistent-s2i.json" 28 | 29 | # uncomment amount memory needed, sets RAM usage limit for OCP, default 6 GB. 30 | #VM_MEMORY=10240 # 10GB 31 | #VM_MEMORY=8192 # 8GB 32 | #VM_MEMORY=6144 # 6GB 33 | VM_MEMORY=4098 # 4GB 34 | #VM_MEMORY=3072 # 3GB 35 | 36 | # wipe screen. 37 | clear 38 | 39 | echo 40 | echo "##############################################################" 41 | echo "## ##" 42 | echo "## Setting up your very own ##" 43 | echo "## ##" 44 | echo "## ### #### ##### # # #### # # ##### ##### ##### ##" 45 | echo "## # # # # # ## # # # # # # # ##" 46 | echo "## # # #### ### # # # ### ##### # #### # ##" 47 | echo "## # # # # # ## # # # # # # ##" 48 | echo "## ### # ##### # # #### # # ##### # # ##" 49 | echo "## ##" 50 | echo "## #### ### # # ##### ### ##### # # ##### ##### ##" 51 | echo "## # # # ## # # # # # ## # # # # ##" 52 | echo "## # # # # # # # ##### # # # # ### ##### ##" 53 | echo "## # # # # ## # # # # # ## # # # ##" 54 | echo "## #### ### # # # # # ##### # # ##### # # ##" 55 | echo "## ##" 56 | echo "## #### # ### ##### ##### ### ##### # # ##" 57 | echo "## # # # # # # # # # # # ## ## ##" 58 | echo "## #### # ##### # #### # # ##### # # # ##" 59 | echo "## # # # # # # # # # # # # ##" 60 | echo "## # ##### # # # # ### # # # # ##" 61 | echo "## ##" 62 | echo "## https://github.com/redhatdemocentral/ocp-install-demo ##" 63 | echo "## ##" 64 | echo "##############################################################" 65 | echo 66 | 67 | # Ensure VirtualBox available. 68 | # 69 | if [ `uname` == 'Darwin' ]; then 70 | command -v VirtualBox -h >/dev/null 2>&1 || { echo >&2 "VirtualBox is required but not installed yet... download here: https://www.virtualbox.org/wiki/Downloads"; exit 1; } 71 | echo "VirtualBox is installed..." 72 | echo 73 | elif [ `uname` == 'Linux' ]; then 74 | VIRT_DRIVER='kvm' 75 | echo "You are running on Linux." 76 | echo "This script assumes you are going to use KVM on Linux." 77 | echo "You'll need to install docker-machine and docker-machine-driver-kvm in your \$PATH manually." 78 | echo "Download them from https://github.com/docker/machine/releases and https://github.com/dhiltgen/docker-machine-kvm/releases, respectively." 79 | fi 80 | 81 | # Ensure docker-machine tool available. 82 | # 83 | command -v docker-machine -v >/dev/null 2>&1 || { echo >&2 "Docker-machine is required but not installed yet... instructions here: https://docs.docker.com/machine/install-machine/#install-machine-directly"; exit 1; } 84 | echo "Docker-machine tooling installed..." 85 | echo 86 | 87 | # Ensure OpenShift command line tools available. 88 | # 89 | command -v oc help >/dev/null 2>&1 || { echo >&2 "OpenShift CLI tooling is required but not installed yet... download $OCP_VERSION here: https://access.redhat.com/downloads/content/290"; exit 1; } 90 | echo "OpenShift command line tools installed... checking for valid version..." 91 | echo 92 | 93 | # Check oc version. 94 | verfull=$(oc version | awk '/oc/{print $2}') 95 | verone=$(echo $verfull | awk -F[=.] '{print $1}') 96 | vertwo=$(echo $verfull | awk -F[=.] '{print $2}') 97 | verthree=$(echo $verfull | awk -F[=.] '{print $3}') 98 | 99 | # Check version elements, first is a string so using '==', the rest are integers. 100 | if [ $verone == $OC_MAJOR_VER ] && [ $vertwo -eq $OC_MINOR_VER ] && [ $verthree -ge $OC_MINI_VER ]; then 101 | echo "Version of installed OpenShift command line tools correct... $verone.$vertwo.$verthree" 102 | echo 103 | else 104 | echo "Version of installed OpenShift command line tools is $verone.$vertwo.$verthree, must be $OC_MAJOR_VER.$OC_MINOR_VER.$OC_MINI_VER..." 105 | echo 106 | if [ `uname` == 'Darwin' ]; then 107 | echo "Download for Mac here: https://access.redhat.com/downloads/content/290" 108 | exit 109 | else 110 | echo "Download for Linux here: https://access.redhat.com/downloads/content/290/" 111 | exit 112 | fi 113 | fi 114 | 115 | echo "Setting up OpenShift docker machine using $VIRT_DRIVER from cache..." 116 | echo 117 | docker-machine create --driver ${VIRT_DRIVER} --${VIRT_DRIVER}-cpu-count "2" --${VIRT_DRIVER}-memory "$VM_MEMORY" --engine-insecure-registry 172.30.0.0/16 --${VIRT_DRIVER}-boot2docker-url $ISO_CACHE openshift 118 | 119 | if [ $? -ne 0 ]; then 120 | echo 121 | echo "Error occurred during openshift docker machine creation..." 122 | echo 123 | echo "Cleaning out existing 'openshift' machine..." 124 | echo 125 | docker-machine rm -f openshift 126 | 127 | echo "Setting up OpenShift docker machine using $VIRT_DRIVER from url..." 128 | echo 129 | docker-machine create --driver ${VIRT_DRIVER} --${VIRT_DRIVER}-cpu-count "2" --${VIRT_DRIVER}-memory "$VM_MEMORY" --engine-insecure-registry 172.30.0.0/16 --${VIRT_DRIVER}-boot2docker-url $ISO_URL openshift 130 | 131 | if [ $? -ne 0 ]; then 132 | echo 133 | echo "Problem with docker machine creation that I can't resolve, please raise an issue and add error output:" 134 | echo 135 | echo " https://github.com/redhatdemocentral/ocp-install-demo/issues/new" 136 | echo 137 | exit 138 | fi 139 | fi 140 | 141 | echo "Installing OCP with cluster up..." 142 | echo 143 | oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true --version=$OCP_VERSION --host-pv-dir=/var/lib/boot2docker/ocp-pv 144 | 145 | 146 | if [ $? -ne 0 ]; then 147 | echo 148 | echo "Error occurred during 'oc cluster up' command..." 149 | echo 150 | echo "Cleaning out existing 'openshift' machine..." 151 | echo 152 | docker-machine rm -f openshift 153 | 154 | echo "Setting up OpenShift docker machine using $VIRT_DRIVER from cache..." 155 | echo 156 | docker-machine create --driver ${VIRT_DRIVER} --${VIRT_DRIVER}-cpu-count "2" --${VIRT_DRIVER}-memory "$VM_MEMORY" --engine-insecure-registry 172.30.0.0/16 --${VIRT_DRIVER}-boot2docker-url $ISO_CACHE openshift 157 | 158 | echo 159 | echo "Trying again to install OCP with cluster up..." 160 | echo 161 | echo "Using osX version of cluster up... installing second try OCP version: $OCP_VERSION" 162 | echo 163 | oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true --version=$OCP_VERSION --host-pv-dir=/var/lib/boot2docker/ocp-pv 164 | 165 | if [ $? -ne 0 ]; then 166 | echo 167 | echo "Problem with installation that I can't resolve, please raise an issue and add error output:" 168 | echo 169 | echo " https://github.com/redhatdemocentral/ocp-install-demo/issues/new" 170 | echo 171 | exit 172 | fi 173 | fi 174 | 175 | echo 176 | echo "Logging in as admin user..." 177 | echo 178 | oc login -u system:admin 179 | 180 | # capturing OCP IP address from status command. 181 | OCP_IP=$(oc status | awk '/My Project/{print $8}') 182 | 183 | echo 184 | echo "Set OCP IP to $OCP_IP..." 185 | echo 186 | 187 | # set console environment to openshift container. 188 | eval "$(docker-machine env openshift)" 189 | 190 | echo "Granting admin user full cluster-admin rights..." 191 | echo 192 | oc adm policy add-cluster-role-to-user cluster-admin admin 193 | 194 | if [ $? -ne 0 ]; then 195 | echo 196 | echo "Problem granting admin user full cluster-admin rights!" 197 | echo 198 | exit 199 | fi 200 | 201 | echo 202 | echo "Granting rights to service catalog access..." 203 | echo 204 | oc adm policy add-cluster-role-to-group system:openshift:templateservicebroker-client system:unauthenticated system:authenticated 205 | 206 | if [ $? -ne 0 ]; then 207 | echo 208 | echo "Problem granting service catalog rights!" 209 | echo 210 | exit 211 | fi 212 | 213 | echo 214 | echo "Updating JBoss image streams..." 215 | 216 | # Updating JBoss BRMS 6.3 image stream. 217 | # 218 | oc delete -n openshift -f $STREAM_BRMS_63 >/dev/null 2>&1 219 | oc create -n openshift -f $STREAM_BRMS_63 220 | 221 | if [ $? -ne 0 ]; then 222 | echo 223 | echo "Problem with accessing JBoss BRMS 63 stream for OCP..." 224 | echo 225 | echo "Trying again..." 226 | echo 227 | sleep 10 228 | oc delete -n openshift -f $STREAM_BRMS_63 >/dev/null 2>&1 229 | oc create -n openshift -f $STREAM_BRMS_63 230 | 231 | if [ $? -ne 0 ]; then 232 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 233 | echo 234 | docker-machine rm -f openshift 235 | exit 236 | fi 237 | fi 238 | 239 | # Updating JBoss BPMS 6.3 image stream. 240 | # 241 | oc delete -n openshift -f $STREAM_BPMS_63 >/dev/null 2>&1 242 | oc create -n openshift -f $STREAM_BPMS_63 243 | 244 | if [ $? -ne 0 ]; then 245 | echo 246 | echo "Problem with accessing JBoss BPMS 63 stream for OCP..." 247 | echo 248 | echo "Trying again..." 249 | echo 250 | sleep 10 251 | oc delete -n openshift -f $STREAM_BPMS_63 >/dev/null 2>&1 252 | oc create -n openshift -f $STREAM_BPMS_63 253 | 254 | if [ $? -ne 0 ]; then 255 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 256 | echo 257 | docker-machine rm -f openshift 258 | exit 259 | fi 260 | fi 261 | 262 | # Updating JBoss BRMS 6.4 image stream. 263 | # 264 | oc delete -n openshift -f $STREAM_BRMS_64 >/dev/null 2>&1 265 | oc create -n openshift -f $STREAM_BRMS_64 266 | 267 | if [ $? -ne 0 ]; then 268 | echo 269 | echo "Problem with accessing JBoss BRMS 64 stream for OCP..." 270 | echo 271 | echo "Trying again..." 272 | echo 273 | sleep 10 274 | oc delete -n openshift -f $STREAM_BRMS_64 >/dev/null 2>&1 275 | oc create -n openshift -f $STREAM_BRMS_64 276 | 277 | if [ $? -ne 0 ]; then 278 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 279 | echo 280 | docker-machine rm -f openshift 281 | exit 282 | fi 283 | fi 284 | 285 | # Updating JBoss BPMS 6.4 image stream. 286 | # 287 | oc delete -n openshift -f $STREAM_BPMS_64 >/dev/null 2>&1 288 | oc create -n openshift -f $STREAM_BPMS_64 289 | 290 | if [ $? -ne 0 ]; then 291 | echo 292 | echo "Problem with accessing JBoss BPMS 64 stream for OCP..." 293 | echo 294 | echo "Trying again..." 295 | echo 296 | sleep 10 297 | oc delete -n openshift -f $STREAM_BPMS_64 >/dev/null 2>&1 298 | oc create -n openshift -f $STREAM_BPMS_64 299 | 300 | if [ $? -ne 0 ]; then 301 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 302 | echo 303 | docker-machine rm -f openshift 304 | exit 305 | fi 306 | fi 307 | 308 | # Updating JBoss EAP 7.0 image stream. 309 | # 310 | oc delete -n openshift -f $STREAM_EAP_70 >/dev/null 2>&1 311 | oc create -n openshift -f $STREAM_EAP_70 312 | 313 | if [ $? -ne 0 ]; then 314 | echo 315 | echo "Problem with accessing JBoss EAP 70 stream for OCP..." 316 | echo 317 | echo "Trying again..." 318 | echo 319 | sleep 10 320 | oc delete -n openshift -f $STREAM_EAP_70 >/dev/null 2>&1 321 | oc create -n openshift -f $STREAM_EAP_70 322 | 323 | if [ $? -ne 0 ]; then 324 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 325 | echo 326 | docker-machine rm -f openshift 327 | exit 328 | fi 329 | fi 330 | 331 | # Updating JBoss EAP 7.1 image stream. 332 | oc delete -n openshift -f $STREAM_EAP_71 >/dev/null 2>&1 333 | oc create -n openshift -f $STREAM_EAP_71 334 | 335 | if [ $? -ne 0 ]; then 336 | echo 337 | echo "Problem with accessing JBoss EAP 71 stream for OCP..." 338 | echo 339 | echo "Trying again..." 340 | echo 341 | sleep 10 342 | oc delete -n openshift -f $STREAM_EAP_71 >/dev/null 2>&1 343 | oc create -n openshift -f $STREAM_EAP_71 344 | 345 | if [ $? -ne 0 ]; then 346 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 347 | echo 348 | docker-machine rm -f openshift 349 | exit 350 | fi 351 | fi 352 | 353 | # Updating Fuse image streams. 354 | oc delete -n openshift -f $STREAM_FUSE >/dev/null 2>&1 355 | oc create -n openshift -f $STREAM_FUSE 356 | 357 | if [ $? -ne 0 ]; then 358 | echo 359 | echo "Problem with accessing Fuse Integration product streams for OCP..." 360 | echo 361 | echo "Trying again..." 362 | echo 363 | sleep 10 364 | oc delete -n openshift -f $STREAM_FUSE >/dev/null 2>&1 365 | oc create -n openshift -f $STREAM_FUSE 366 | 367 | if [ $? -ne 0 ]; then 368 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 369 | echo 370 | docker-machine rm -f openshift 371 | exit 372 | fi 373 | fi 374 | 375 | # Updating OpenJDK18 image stream. 376 | # 377 | oc delete -n openshift -f $STREAM_OPENJDK18 >/dev/null 2>&1 378 | oc create -n openshift -f $STREAM_OPENJDK18 379 | 380 | if [ $? -ne 0 ]; then 381 | echo 382 | echo "Problem with accessing OPENJDK18 stream for OCP..." 383 | echo 384 | echo "Trying again..." 385 | echo 386 | sleep 10 387 | oc delete -n openshift -f $STREAM_OPENJDK18 >/dev/null 2>&1 388 | oc create -n openshift -f $STREAM_OPENJDK18 389 | 390 | if [ $? -ne 0 ]; then 391 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 392 | echo 393 | docker-machine rm -f openshift 394 | exit 395 | fi 396 | fi 397 | 398 | # Updating EAP 7.0 template. 399 | # 400 | oc delete -n openshift -f $TEMPLATE_EAP70 >/dev/null 2>&1 401 | oc create -n openshift -f $TEMPLATE_EAP70 402 | 403 | if [ $? -ne 0 ]; then 404 | echo 405 | echo "Problem with accessing JBoss EAP 70 template for OCP..." 406 | echo 407 | echo "Trying again..." 408 | echo 409 | sleep 10 410 | oc delete -n openshift -f $TEMPLATE_EAP70 >/dev/null 2>&1 411 | oc create -n openshift -f $TEMPLATE_EAP70 412 | 413 | if [ $? -ne 0 ]; then 414 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 415 | echo 416 | docker-machine rm -f openshift 417 | exit 418 | fi 419 | fi 420 | 421 | # Updating EAP 7.1 template. 422 | # 423 | oc delete -n openshift -f $TEMPLATE_EAP71 >/dev/null 2>&1 424 | oc create -n openshift -f $TEMPLATE_EAP71 425 | 426 | if [ $? -ne 0 ]; then 427 | echo 428 | echo "Problem with accessing JBoss EAP 71 template for OCP..." 429 | echo 430 | echo "Trying again..." 431 | echo 432 | sleep 10 433 | oc delete -n openshift -f $TEMPLATE_EAP71 >/dev/null 2>&1 434 | oc create -n openshift -f $TEMPLATE_EAP71 435 | 436 | if [ $? -ne 0 ]; then 437 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 438 | echo 439 | docker-machine rm -f openshift 440 | exit 441 | fi 442 | fi 443 | 444 | # Updating Decision Server 6.4 template. 445 | # 446 | oc delete -n openshift -f $TEMPLATE_BRMS_64 >/dev/null 2>&1 447 | oc create -n openshift -f $TEMPLATE_BRMS_64 448 | 449 | if [ $? -ne 0 ]; then 450 | echo 451 | echo "Problem with accessing JBoss BRMS 64 template for OCP..." 452 | echo 453 | echo "Trying again..." 454 | echo 455 | sleep 10 456 | oc delete -n openshift -f $TEMPLATE_BRMS_64 >/dev/null 2>&1 457 | oc create -n openshift -f $TEMPLATE_BRMS_64 458 | 459 | if [ $? -ne 0 ]; then 460 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 461 | echo 462 | docker-machine rm -f openshift 463 | exit 464 | fi 465 | fi 466 | 467 | # Updating Process Server 6.4 template. 468 | # 469 | oc delete -n openshift -f $TEMPLATE_BPM_64 >/dev/null 2>&1 470 | oc create -n openshift -f $TEMPLATE_BPM_64 471 | 472 | if [ $? -ne 0 ]; then 473 | echo 474 | echo "Problem with accessing JBoss BPM Suite 64 template for OCP..." 475 | echo 476 | echo "Trying again..." 477 | echo 478 | sleep 10 479 | oc delete -n openshift -f $TEMPLATE_BPM_64 >/dev/null 2>&1 480 | oc create -n openshift -f $TEMPLATE_BPM_64 481 | 482 | if [ $? -ne 0 ]; then 483 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 484 | echo 485 | docker-machine rm -f openshift 486 | exit 487 | fi 488 | fi 489 | 490 | # Updating Process Server DB 6.4 template. 491 | # 492 | oc delete -n openshift -f $TEMPLATE_BPM_DB_64 >/dev/null 2>&1 493 | oc create -n openshift -f $TEMPLATE_BPM_DB_64 494 | 495 | if [ $? -ne 0 ]; then 496 | echo 497 | echo "Problem with accessing JBoss BPM Suite DB 64 template for OCP..." 498 | echo 499 | echo "Trying again..." 500 | echo 501 | sleep 10 502 | oc delete -n openshift -f $TEMPLATE_BPM_DB_64 >/dev/null 2>&1 503 | oc create -n openshift -f $TEMPLATE_BPM_DB_64 504 | 505 | if [ $? -ne 0 ]; then 506 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 507 | echo 508 | docker-machine rm -f openshift 509 | exit 510 | fi 511 | fi 512 | 513 | echo 514 | echo "Updating RHEL 7 image streams..." 515 | oc delete -n openshift -f $STREAM_RHEL >/dev/null 2>&1 516 | oc create -n openshift -f $STREAM_RHEL 517 | 518 | if [ $? -ne 0 ]; then 519 | echo 520 | echo "Problem with accessing RHEL product streams for OCP..." 521 | echo 522 | echo "Trying again..." 523 | echo 524 | sleep 10 525 | oc delete -n openshift -f $STREAM_RHEL >/dev/null 2>&1 526 | oc create -n openshift -f $STREAM_RHEL 527 | 528 | if [ $? -ne 0 ]; then 529 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 530 | echo 531 | docker-machine rm -f openshift 532 | exit 533 | fi 534 | fi 535 | 536 | echo 537 | echo "Update .Net image streams..." 538 | oc delete -n openshift -f $STREAM_DOTNET >/dev/null 2>&1 539 | oc create -n openshift -f $STREAM_DOTNET 540 | 541 | if [ $? -ne 0 ]; then 542 | echo 543 | echo "Problem with accessing .Net image streams for OCP..." 544 | echo 545 | echo "Trying again..." 546 | echo 547 | sleep 10 548 | oc delete -n openshift -f $STREAM_DOTNET >/dev/null 2>&1 549 | oc create -n openshift -f $STREAM_DOTNET 550 | 551 | if [ $? -ne 0 ]; then 552 | echo "Failed again, exiting, check output messages and network connectivity before running install again..." 553 | echo 554 | docker-machine rm -f openshift 555 | exit 556 | fi 557 | fi 558 | 559 | echo 560 | echo "====================================================" 561 | echo "= =" 562 | echo "= Install complete, get ready to rock your Cloud. =" 563 | echo "= Look for information at end of OCP install. =" 564 | echo "= =" 565 | echo "= The server is accessible via web console at: =" 566 | echo "= =" 567 | echo "= $OCP_IP =" 568 | echo "= =" 569 | echo "= Log in as user: openshift-dev =" 570 | echo "= password: devel =" 571 | echo "= =" 572 | echo "= Admin log in as: admin =" 573 | echo "= password: admin =" 574 | echo "= =" 575 | echo "= Now get your Red Hat Demo Central example =" 576 | echo "= projects here: =" 577 | echo "= =" 578 | echo "= https://github.com/redhatdemocentral =" 579 | echo "= =" 580 | echo "= To stop and restart your OCP cluster with =" 581 | echo "= installed containers, see Readme.md in the =" 582 | echo "= NOTES section for details. =" 583 | echo "= =" 584 | echo "= When finished, clean up your demo with: =" 585 | echo "= =" 586 | echo "= $ docker-machine rm -f openshift =" 587 | echo "= =" 588 | echo "====================================================" 589 | -------------------------------------------------------------------------------- /support/oc-builder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SRC_URL=https://github.com/eschabell/origin.git 4 | SRC_REF=docker_version_warning 5 | OS_TYPE=darwin/amd64 6 | BUILD_FILE=https://raw.githubusercontent.com/eschabell/build-origin/master/origin-builder.yaml 7 | 8 | # prints the documentation for this script. 9 | function print_docs() 10 | { 11 | echo "This application will build you a new os commandline client for your operating" 12 | echo "system, one with the fix for the new boot2docker iso that uses v17.03 and" 13 | echo "gives errors with oc-v3.2.1.4 and possibly all previous versions:" 14 | echo 15 | echo " -- Checking Docker version ... FAIL" 16 | echo " Error: Minor number must not contain leading zeroes '03'" 17 | echo 18 | echo "Run this builder and provide the target operating system:" 19 | echo 20 | echo " $ ./oc_builder.sh [ linux | osx | windows ]" 21 | echo 22 | echo "You need a running OpenShift and your oc client must be logged in before" 23 | echo "running this builder. The ouput will be found by looking up the deployed" 24 | echo "builders published route, which is a web server hosting the newly created" 25 | echo "oc client for you to download." 26 | echo 27 | } 28 | 29 | build_os() 30 | { 31 | # Incoming parameter, should be 'linux', 'darwin' or 'windows'. 32 | # 33 | target_os="$1/amd64" 34 | 35 | # Forcing you to login. 36 | # 37 | oc login --password=devel --username=openshift-dev 38 | 39 | # Try to create new project, if fails not a problem. 40 | # 41 | echo "Creating a new project for you..." 42 | echo 43 | oc new-project my-project 44 | 45 | if [ $? -ne 0 ]; then 46 | echo 47 | echo Error occurred during 'oc new-project' command! 48 | exit 49 | fi 50 | 51 | # Select correct builder based on given os. 52 | # 53 | echo "Starting to build a new fixed oc client for your $1 system..." 54 | echo 55 | echo "Building using: $BUILD_FILE, source url: $SRC_URL, ref: $SRC_REF and platform: $target_os" 56 | echo 57 | oc new-app -f $BUILD_FILE -p SOURCE_URL=$SRC_URL -p SOURCE_REF=$SRC_REF -p PLATFORM=$target_os 58 | 59 | if [ $? -ne 0 ]; then 60 | echo 61 | echo Error occurred during 'oc new-app' command! 62 | exit 63 | fi 64 | } 65 | 66 | # wipe screen. 67 | clear 68 | 69 | echo 70 | echo "##############################################################" 71 | echo "## ##" 72 | echo "## Building a new version of oc, for one of the following ##" 73 | echo "## platforms with fix for boot2docker using v17.03: ##" 74 | echo "## ##" 75 | echo "## linux/amd64 or darwin/amd64 or windows/amd64 ##" 76 | echo "## ##" 77 | echo "##############################################################" 78 | echo 79 | 80 | # validate args, expecting 'linux' | 'windows' | 'osx'. 81 | if [ $# -eq 1 ]; then 82 | echo "Validating argument: $1" 83 | echo 84 | if [ $1 == "linux" ]; then 85 | echo "Starting build of oc with fix for Linux systems..." 86 | echo 87 | build_os "linux" 88 | elif [ $1 == "windows" ]; then 89 | echo "Starting build of oc with fix for Windows systems..." 90 | echo 91 | build_os "windows" 92 | elif [ $1 == "osx" ]; then 93 | echo "Starting build of oc with fix for osX systems..." 94 | echo 95 | build_os "darwin" 96 | else 97 | print_docs 98 | exit 99 | fi 100 | elif [ $# -gt 1 ]; then 101 | print_docs 102 | echo 103 | exit 104 | else 105 | # no arguments, prodeed with default host. 106 | print_docs 107 | echo 108 | exit 109 | fi 110 | 111 | echo 112 | echo "Login to OpenShift and wait for the build to finish and find your deployed oc tool..." 113 | echo 114 | -------------------------------------------------------------------------------- /support/ocp-restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | clear 4 | 5 | echo 6 | echo "Restarting openshift docker machine..." 7 | echo 8 | 9 | docker-machine start openshift 10 | 11 | echo 12 | echo "Restarting OCP cluster..." 13 | echo 14 | oc cluster up --image=registry.access.redhat.com/openshift3/ose --host-data-dir=/var/lib/boot2docker/ocp-data --docker-machine=openshift --host-config-dir=/var/lib/boot2docker/ocp-config --use-existing-config=true --host-pv-dir=/var/lib/boot2docker/ocp-pv 15 | 16 | echo 17 | echo "OCP cluster restarted." 18 | echo 19 | -------------------------------------------------------------------------------- /support/ocp-stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | clear 4 | 5 | echo 6 | echo "Shutting down OCP cluster..." && $(oc cluster down --docker-machine=openshift) 7 | echo 8 | 9 | docker-machine stop openshift 10 | 11 | echo 12 | echo "OCP cluster stopped..." 13 | echo 14 | echo "To restart, use ocp-restart.sh in support directory." 15 | echo 16 | --------------------------------------------------------------------------------