Browse Source

Update documentation for running on a local cluster.

pull/160/head
Wade Barnes 7 years ago
parent
commit
54a8700c8a
2 changed files with 56 additions and 88 deletions
  1. +0
    -88
      openshift/MINISHIFT.md
  2. +56
    -0
      openshift/README.md

+ 0
- 88
openshift/MINISHIFT.md View File

@ -1,88 +0,0 @@
# A Quickstart Guide to Setting Up eDivorce on MiniShift
These instructions assume you have 2 EMPTY projects created in MiniShift:
- jag-csb-edivorce-tools (BUILD)
- jag-csb-edivorce-dev (DEV)
For Minishift deployments we won't bother setting up Jenkins or NGINX.
## Uploading Templates into OpenShift
1. Clone the project from Github, and then ```cd``` into the openshift/templates directory.
2. Log into the OpenShift console to get your command line token. Then log into OpenShift from the command line.
3. Upload the templates into OpenShift with the following commands
Tools templates
```
oc create -f edivorce-build-template.yaml -n jag-csb-edivorce-tools
```
Main eDivorce environment template
```
oc create -f edivorce-environment-template.yaml -n jag-csb-edivorce-dev
```
## Setting up the Tools Project
### Process the templates in the 'tools' project
#### These can be processed from the commandline
```
oc project jag-csb-edivorce-tools
oc process edivorce-build | oc create -f -
```
You can monitor the process of the build in the OpenShift console on Minishift. You'll need to wait for it to finish before you can start the next step.
## Setting up Dev
Tag the builds in the tools project so they can be deployed to dev
```
oc project jag-csb-edivorce-tools
```
Give the dev project access to Docker images stored in the tools project
```
oc project jag-csb-edivorce-dev
oc policy add-role-to-user system:image-puller system:serviceaccount:jag-csb-edivorce-dev:default -n jag-csb-edivorce-tools
oc policy add-role-to-user edit system:serviceaccount:jag-csb-edivorce-tools:default -n jag-csb-edivorce-dev
```
Deploy the Django app and the Postgresql DB (Read the section about "Important Configuration Options" above!)
```
oc process edivorce -v ENVIRONMENT_TYPE=minishift,PROXY_NETWORK=0.0.0.0/0 | oc create -f -
```
Edit the yaml for the edivorce-django deployment config through the web console
Find:
kind: ImageStreamTag
name: 'edivorce-django:deploy-to-dev'
Change to:
kind: ImageStreamTag
name: 'edivorce-django:latest'
Deploy Weasyprint
```
oc deploy weasyprint --latest
```
## Create a Route
Using the web console, create a new route called "minishift" in the jag-csb-edivorce-dev project. The only thing you need to change is the name. Otherwise just use default settings.
## Log into eDivorce
You should be able to find your route in the edivorce-django deployment of the jag-csb-edivorce-dev project. When you are prompted for a username and password you can use the password 'dovorce' with any username you choose.

+ 56
- 0
openshift/README.md View File

@ -27,6 +27,62 @@ Some useful commands to help you determine your current context:
* `oc project [NAME]` - Switch to a different project context.
* `oc projects` - Lists the projects available to you on the current server.
## Setting up a local OpenShift environment
If you are NOT setting up a local OpenShift environment you can skip over this section, otherwise read on.
Setting up a local OpenShift environment is not much different than setting up a hosted environment, there are just a few extra steps and then you can follow the same instructions in either case.
The following procedure uses the `oc cluster up` approach to provision a OpenShift Cluster directly in Docker, but you could just as easily use MiniShift which can be installed using your preferred package manager (`Chocolatey` or `Homebrew`).
### Change into the top level openshift folder
```
cd /<PathToWorkingCopy>/openshift
```
### Provision a local OpenShift Cluster
```
oc-cluster-up.sh
```
This will start your local OpenShift cluster using persistence so your configuration is preserved across restarts.
*To cleanly shutdown your local cluster use `oc-cluster-down.sh`.*
**Login** to your local OpenShift instance on the command line and the Web Console, using `developer` as both the username and password. To login to the cluster from the command line, you can get a login token from the Web Console: Login to the console. From the **?** dropdown select **Command Line Tools**. Click on the **Copy To Clipboard** icon next to the `oc login` line.
### Create a local set of OpenShift projects
```
generateLocalProjects.sh
```
**This command will only work on a local server context. It will fail if you are logged into a remote server.** This will generate four OpenShift projects; tools, dev, test, and prod. The tools project is used for builds and DevOps activities, and dev, test, and prod are a set of deployment environments.
If you need (or want) to reset your local environments you can run `generateLocalProjects.sh -D` to delete all of the OpenShift projects.
### Finish Up
You now have a local OpenShift cluster with a set of projects that mirror what you would have in the hosted **Pathfinder** environment.
You can now configure these project exactly as you would your hosted environment with one minor difference. You will need to fix the routes **after** you have run your deployment configurations.
Run the following script to create the default routes for your local environment:
```
updateRoutes.sh
```
### Local Override Options
When running locally your can override your build and deployment parameters by generating a set of local parameters.
To generate a set of local params, run;
```
genParams.sh -l
```
Local param files are ignored by Git, so you cannot accidentally commit them to the repository.
This allows you to do things like redirect your builds to use a different repository and/or branch.
To apply local settings while deploying your build and deployment configurations use the `-l` option with `genBuilds.sh` and `genDepls.sh`.
## 0. Build and publish the S2I image:
*TODO: Add this process to the build configurations...*


Loading…
Cancel
Save