-
Notifications
You must be signed in to change notification settings - Fork 1
Setup prod/dev okd config #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mxmeinhold
wants to merge
7
commits into
develop
Choose a base branch
from
prod-okd
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
724f643
Remove NODE_ENV from dockerfile
mxmeinhold 37e3f16
Remove superfluous mkdir
mxmeinhold b9119c5
Create vote-dev deploy resources
mxmeinhold 970ffb4
Create deployment instructions
mxmeinhold 7c2f596
Correct service selectors
mxmeinhold 4c81f2f
Update Copyright year
mxmeinhold b4cdd00
s/Openshift/OpenShift/g
mxmeinhold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Deployment instructions | ||
|
|
||
| Vote is meant to be deployed on an OKD/OpenShift cluster. | ||
| This directory contains most of the files needed to do that, but doesn't include the config maps, since they contain secrets. | ||
| You'll need to create 2 config maps, `vote` and `vote-dev`, which should look rather like this, but with placeholders filled in: | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: <name of cm> | ||
| namespace: vote | ||
| data: | ||
| DB_URL: mongodb://<user>:<password>@tide.csh.rit.edu/vote?ssl=true | ||
| NODE_ENV: <env> | ||
| REACT_APP_BASE_API_URL: https://vote.csh.rit.edu | ||
| REACT_APP_SSO_AUTHORITY: https://sso.csh.rit.edu/auth/realms/csh | ||
| REACT_APP_SSO_CLIENT_ID: vote | ||
| ``` | ||
|
|
||
| Once you have all the files together, plop them in a directory and run `oc create -fr <directory>`, and you should see resources start to spin up. | ||
|
|
||
|
|
||
| ## Updating an existing deployment | ||
|
|
||
| Rather than `oc create`, you'll need `oc edit` or `oc replace`. | ||
| Please try to keep any changes synchronised with this repository. | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| apiVersion: build.openshift.io/v1 | ||
| kind: BuildConfig | ||
| metadata: | ||
| labels: | ||
| app: vote | ||
| name: vote-dev | ||
| namespace: vote | ||
| spec: | ||
| successfulBuildsHistoryLimit: 3 | ||
| failedBuildsHistoryLimit: 3 | ||
| triggers: | ||
| - type: "GitHub" | ||
| github: | ||
| secret: "vote" | ||
| - type: "ConfigChange" | ||
| source: | ||
| ref: develop | ||
| git: | ||
| uri: "https://github.com/ComputerScienceHouse/Vote.git" | ||
| output: | ||
| to: | ||
| kind: ImageStreamTag | ||
| name: vote:develop | ||
| runPolicy: SerialLatestOnly | ||
| strategy: | ||
| dockerStrategy: {} | ||
| type: Docker | ||
| # Lookup local images | ||
| lookupPolicy: | ||
| local: true | ||
| status: | ||
| tags: | ||
| - items: | ||
| tag: develop |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| kind: DeploymentConfig | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: vote-dev | ||
| labels: | ||
| app: vote | ||
| namespace: vote | ||
| spec: | ||
| replicas: 1 | ||
| revisionHistoryLimit: 10 | ||
| selector: | ||
| deploymentconfig: vote-dev | ||
| strategy: | ||
| type: Rolling | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: vote | ||
| deploymentconfig: vote-dev | ||
| spec: | ||
| containers: | ||
| - name: vote-http | ||
| image: vote-dev | ||
| envFrom: | ||
| - configMapRef: | ||
| name: vote-dev | ||
| livenessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: 8080 | ||
| initialDelaySeconds: 0 | ||
| timeoutSeconds: 1 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: 8080 | ||
| initialDelaySeconds: 0 | ||
| timeoutSeconds: 1 | ||
| triggers: | ||
| - type: ConfigChange | ||
| - type: ImageChange | ||
| imageChangeParams: | ||
| automatic: true | ||
| containerNames: | ||
| - vote-http | ||
| from: | ||
| kind: ImageStreamTag | ||
| name: vote:develop | ||
| namespace: vote |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| labels: | ||
| app: vote | ||
| name: vote-dev | ||
| namespace: vote | ||
| spec: | ||
| ports: | ||
| - name: 8080-tcp | ||
| port: 8080 | ||
| protocol: TCP | ||
| targetPort: 8080 | ||
| selector: | ||
| deploymentconfig: vote-dev | ||
| sessionAffinity: None | ||
| type: ClusterIP |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these values does the react app still just ignore this and pull from the .env for whatever reason? we probably need to fix that so that it actually will point to the dev service for dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I meant to ask you about that. Does dotenv get overridden by the actual environment? Looks like vote.cs.house is a wee bit broken, if I simulate loggint in as evals it's getting stuck. If flashes logged in and then goes back to redirecting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the .env file was part of the boilerplate and I don't really know where it pulls it in off the top of my head but I could look into that at some point. When we tried to remove it completely the variables were "undefined", so I don't think it's getting the actual environment at all for some reason, but I'm not sure why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'm gonna switch to homework for the rest of today, but we'll need to fix that before we're ready for 1.0.0 I think. I've set the dev build to build off this branch, so we can do a bit more testing on OKD if we need.