File tree Expand file tree Collapse file tree 7 files changed +284
-0
lines changed
Expand file tree Collapse file tree 7 files changed +284
-0
lines changed Original file line number Diff line number Diff line change 1+ secrets.yaml
Original file line number Diff line number Diff line change 1+ ## Deployment
2+ This directory contains the kubernetes resources used to deploy selections.
3+ This should make redeploying selections should the namespace be deleted trivial.
4+
5+ Note that the secrets are not committed to github. When deploying, you will need to ensure the following exist:
6+
7+ ``` yaml
8+ apiVersion : v1
9+ items :
10+ - apiVersion : v1
11+ kind : ConfigMap
12+ # Define environment variables for dev
13+ metadata :
14+ name : dev
15+ namespace : selections
16+ - apiVersion : v1
17+ kind : ConfigMap
18+ # Define environment variables for prod
19+ metadata :
20+ name : prod
21+ namespace : selections
22+ - apiVersion : v1
23+ kind : Secret
24+ # Github webhook secret
25+ metadata :
26+ name : prod-github
27+ namespace : selections
28+ - apiVersion : v1
29+ kind : Secret
30+ # Github webhook secret
31+ metadata :
32+ name : dev-github
33+ namespace : selections
34+ kind : List
35+ ` ` `
36+
37+ Creating the selections project should only require the following (after you've created either ` secrets.yaml` or the secrets resources):
38+ ` ` ` bash
39+ oc new-project selections
40+ oc create -f *.yaml
41+ ` ` `
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ items :
3+ - apiVersion : build.openshift.io/v1
4+ kind : BuildConfig
5+ metadata :
6+ name : dev
7+ namespace : selections
8+ spec :
9+ failedBuildsHistoryLimit : 3
10+ output :
11+ to :
12+ kind : ImageStreamTag
13+ name : dev:latest
14+ namespace : selections
15+ runPolicy : Serial
16+ source :
17+ git :
18+ ref : develop
19+ uri : https://github.com/ComputerScienceHouse/csh-selections
20+ type : Git
21+ strategy :
22+ sourceStrategy :
23+ from :
24+ kind : ImageStreamTag
25+ name : python:3.8-ubi8
26+ namespace : openshift
27+ type : Source
28+ successfulBuildsHistoryLimit : 3
29+ triggers :
30+ - type : ImageChange
31+ - type : ConfigChange
32+ - github :
33+ secretReference :
34+ name : dev-github
35+ type : GitHub
36+ - apiVersion : build.openshift.io/v1
37+ kind : BuildConfig
38+ metadata :
39+ name : prod
40+ namespace : selections
41+ spec :
42+ failedBuildsHistoryLimit : 3
43+ output :
44+ to :
45+ kind : ImageStreamTag
46+ name : prod:latest
47+ namespace : selections
48+ runPolicy : Serial
49+ source :
50+ git :
51+ ref : master
52+ uri : https://github.com/ComputerScienceHouse/csh-selections
53+ type : Git
54+ strategy :
55+ sourceStrategy :
56+ from :
57+ kind : ImageStreamTag
58+ name : python:3.8-ubi8
59+ namespace : openshift
60+ type : Source
61+ successfulBuildsHistoryLimit : 3
62+ triggers :
63+ - type : ImageChange
64+ - type : ConfigChange
65+ - github :
66+ secretReference :
67+ name : prod-github
68+ type : GitHub
69+ kind : List
70+ metadata :
71+ resourceVersion : " "
72+ selfLink : " "
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ items :
3+ - apiVersion : apps/v1
4+ kind : Deployment
5+ metadata :
6+ annotations :
7+ image.openshift.io/triggers : |-
8+ [
9+ {
10+ "from": {
11+ "kind": "ImageStreamTag",
12+ "name": "dev:latest"
13+ },
14+ "fieldPath": "spec.template.spec.containers[0].image"
15+ }
16+ ]
17+ name : dev
18+ namespace : selections
19+ spec :
20+ replicas : 1
21+ revisionHistoryLimit : 3
22+ selector :
23+ matchLabels :
24+ app : selections-dev
25+ template :
26+ metadata :
27+ labels :
28+ app : selections-dev
29+ spec :
30+ containers :
31+ - envFrom :
32+ - configMapRef :
33+ name : dev
34+ image : image-registry.openshift-image-registry.svc:5000/selections/dev
35+ imagePullPolicy : Always
36+ name : selections
37+ ports :
38+ - containerPort : 8080
39+ protocol : TCP
40+ - apiVersion : apps/v1
41+ kind : Deployment
42+ metadata :
43+ annotations :
44+ image.openshift.io/triggers : |-
45+ [
46+ {
47+ "from": {
48+ "kind": "ImageStreamTag",
49+ "name": "prod:latest"
50+ },
51+ "fieldPath": "spec.template.spec.containers[0].image"
52+ }
53+ ]
54+ name : prod
55+ namespace : selections
56+ spec :
57+ replicas : 1
58+ revisionHistoryLimit : 3
59+ selector :
60+ matchLabels :
61+ app : selections-prod
62+ template :
63+ metadata :
64+ labels :
65+ app : selections-prod
66+ spec :
67+ containers :
68+ - envFrom :
69+ - configMapRef :
70+ name : prod
71+ image : image-registry.openshift-image-registry.svc:5000/selections/prod
72+ imagePullPolicy : Always
73+ name : selections
74+ ports :
75+ - containerPort : 8080
76+ protocol : TCP
77+ kind : List
78+ metadata :
79+ resourceVersion : " "
80+ selfLink : " "
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ items :
3+ - apiVersion : image.openshift.io/v1
4+ kind : ImageStream
5+ metadata :
6+ name : dev
7+ namespace : selections
8+ spec :
9+ lookupPolicy :
10+ local : true
11+ - apiVersion : image.openshift.io/v1
12+ kind : ImageStream
13+ metadata :
14+ name : prod
15+ namespace : selections
16+ spec :
17+ lookupPolicy :
18+ local : true
19+ kind : List
20+ metadata :
21+ resourceVersion : " "
22+ selfLink : " "
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ items :
3+ - apiVersion : route.openshift.io/v1
4+ kind : Route
5+ metadata :
6+ name : dev
7+ namespace : selections
8+ spec :
9+ host : selections-dev.csh.rit.edu
10+ port :
11+ targetPort : 8080
12+ tls :
13+ insecureEdgeTerminationPolicy : Redirect
14+ termination : edge
15+ to :
16+ kind : Service
17+ name : dev
18+ - apiVersion : route.openshift.io/v1
19+ kind : Route
20+ metadata :
21+ name : prod
22+ namespace : selections
23+ spec :
24+ host : selections.csh.rit.edu
25+ port :
26+ targetPort : 8080
27+ tls :
28+ insecureEdgeTerminationPolicy : Redirect
29+ termination : edge
30+ to :
31+ kind : Service
32+ name : prod
33+ kind : List
34+ metadata :
35+ resourceVersion : " "
36+ selfLink : " "
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ items :
3+ - apiVersion : v1
4+ kind : Service
5+ metadata :
6+ name : dev
7+ namespace : selections
8+ spec :
9+ ports :
10+ - port : 8080
11+ protocol : TCP
12+ targetPort : 8080
13+ selector :
14+ app : selections-dev
15+ type : ClusterIP
16+ - apiVersion : v1
17+ kind : Service
18+ metadata :
19+ name : prod
20+ namespace : selections
21+ spec :
22+ ports :
23+ - port : 8080
24+ protocol : TCP
25+ targetPort : 8080
26+ selector :
27+ app : selections-prod
28+ type : ClusterIP
29+ kind : List
30+ metadata :
31+ resourceVersion : " "
32+ selfLink : " "
You can’t perform that action at this time.
0 commit comments