Skip to content

Commit 20232f5

Browse files
committed
Minimize difference between prod and preprod manifest trees
1 parent cc2ead2 commit 20232f5

File tree

5 files changed

+119
-145
lines changed

5 files changed

+119
-145
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
with:
2525
args: apply -f k8s/app.yaml
2626

27+
- name: Sync prod resources
28+
uses: steebchen/[email protected]
29+
with:
30+
args: apply -Rf k8s.prod
31+
2732
- name: Wait for deploy to complete
2833
uses: steebchen/[email protected]
2934
with:

.github/workflows/dockerpublish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ jobs:
9999
with:
100100
args: apply -f k8s/app.yaml
101101

102+
- name: Sync preprod resources
103+
uses: steebchen/[email protected]
104+
with:
105+
args: apply -Rf k8s.preprod
106+
102107
- name: Wait for deploy to complete
103108
uses: steebchen/[email protected]
104109
with:

k8s-preprod/app.yaml renamed to k8s.preprod/app-ingress.yaml

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,3 @@
1-
apiVersion: v1
2-
kind: Namespace
3-
metadata:
4-
name: chime
5-
6-
---
7-
8-
apiVersion: apps/v1
9-
kind: Deployment
10-
metadata:
11-
name: chime
12-
namespace: chime
13-
labels:
14-
app: chime
15-
spec:
16-
replicas: 15
17-
strategy:
18-
type: Recreate
19-
selector:
20-
matchLabels:
21-
app: chime
22-
template:
23-
metadata:
24-
labels:
25-
app: chime
26-
spec:
27-
containers:
28-
- image: docker.pkg.github.com/codeforphilly/chime/penn-chime:0.4.1
29-
name: chime
30-
ports:
31-
- containerPort: 8000
32-
name: http
33-
protocol: TCP
34-
imagePullSecrets:
35-
- name: regcred
36-
---
37-
38-
apiVersion: v1
39-
kind: Service
40-
metadata:
41-
name: chime
42-
namespace: chime
43-
labels:
44-
app: chime
45-
spec:
46-
selector:
47-
app: chime
48-
ports:
49-
- name: http
50-
port: 80
51-
protocol: TCP
52-
targetPort: 8000
53-
541
---
552

563
apiVersion: extensions/v1beta1
@@ -63,12 +10,12 @@ metadata:
6310
annotations:
6411
kubernetes.io/ingress.class: nginx
6512
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
13+
# allow requests larger than 1MiB
6614
nginx.ingress.kubernetes.io/proxy-body-size: "0"
6715
spec:
6816
tls:
6917
- hosts:
7018
- penn-chime.bus.phl.io
71-
- penn-chime-alt.bus.phl.io
7219
secretName: tls-secret
7320
rules:
7421
- host: penn-chime.bus.phl.io
@@ -78,6 +25,25 @@ spec:
7825
backend:
7926
serviceName: chime
8027
servicePort: 80
28+
29+
---
30+
31+
apiVersion: extensions/v1beta1
32+
kind: Ingress
33+
metadata:
34+
name: chime-alt
35+
namespace: chime
36+
annotations:
37+
kubernetes.io/ingress.class: nginx
38+
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
39+
# allow requests larger than 1MiB
40+
nginx.ingress.kubernetes.io/proxy-body-size: "0"
41+
spec:
42+
tls:
43+
- hosts:
44+
- penn-chime-alt.bus.phl.io
45+
secretName: tls-chime-alt
46+
rules:
8147
- host: penn-chime-alt.bus.phl.io
8248
http:
8349
paths:

k8s.prod/app-ingress.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
apiVersion: extensions/v1beta1
3+
kind: Ingress
4+
metadata:
5+
name: chime
6+
namespace: chime
7+
labels:
8+
app: chime
9+
annotations:
10+
kubernetes.io/ingress.class: nginx
11+
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
12+
# allow requests larger than 1MiB
13+
nginx.ingress.kubernetes.io/proxy-body-size: "0"
14+
spec:
15+
tls:
16+
- hosts:
17+
- penn-chime.phl.io
18+
secretName: tls-secret
19+
rules:
20+
- host: penn-chime.phl.io
21+
http:
22+
paths:
23+
- path: /
24+
backend:
25+
serviceName: chime
26+
servicePort: 80
27+
28+
---
29+
30+
apiVersion: extensions/v1beta1
31+
kind: Ingress
32+
metadata:
33+
name: chime-alt
34+
namespace: chime
35+
annotations:
36+
kubernetes.io/ingress.class: nginx
37+
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
38+
# allow requests larger than 1MiB
39+
nginx.ingress.kubernetes.io/proxy-body-size: "0"
40+
spec:
41+
tls:
42+
- hosts:
43+
- lke.penn-chime.phl.io
44+
secretName: tls-chime-alt
45+
rules:
46+
- host: lke.penn-chime.phl.io
47+
http:
48+
paths:
49+
- path: /
50+
backend:
51+
serviceName: chime
52+
servicePort: 80
53+
54+
---
55+
apiVersion: extensions/v1beta1
56+
kind: Ingress
57+
metadata:
58+
name: chime-static
59+
namespace: chime
60+
labels:
61+
app: chime
62+
annotations:
63+
nginx.ingress.kubernetes.io/proxy-buffering: "on" # Important!
64+
nginx.ingress.kubernetes.io/configuration-snippet: |
65+
proxy_cache static-cache;
66+
proxy_cache_valid 404 1m;
67+
proxy_cache_valid 200 10m;
68+
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
69+
proxy_cache_bypass $http_x_purge;
70+
proxy_cache_key $proxy_upstream_name$request_uri;
71+
proxy_cache_lock on;
72+
proxy_cache_use_stale updating;
73+
add_header X-Cache-Status $upstream_cache_status;
74+
spec:
75+
rules:
76+
- host: penn-chime.phl.io
77+
http:
78+
paths:
79+
- path: /static/
80+
backend:
81+
serviceName: chime
82+
servicePort: 80
83+
- host: lke.penn-chime.phl.io
84+
http:
85+
paths:
86+
- path: /static/
87+
backend:
88+
serviceName: chime
89+
servicePort: 80

k8s/app.yaml

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -50,94 +50,3 @@ spec:
5050
port: 80
5151
protocol: TCP
5252
targetPort: 8000
53-
54-
---
55-
56-
apiVersion: extensions/v1beta1
57-
kind: Ingress
58-
metadata:
59-
name: chime
60-
namespace: chime
61-
labels:
62-
app: chime
63-
annotations:
64-
kubernetes.io/ingress.class: nginx
65-
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
66-
# allow requests larger than 1MiB
67-
nginx.ingress.kubernetes.io/proxy-body-size: "0"
68-
spec:
69-
tls:
70-
- hosts:
71-
- penn-chime.phl.io
72-
secretName: tls-secret
73-
rules:
74-
- host: penn-chime.phl.io
75-
http:
76-
paths:
77-
- path: /
78-
backend:
79-
serviceName: chime
80-
servicePort: 80
81-
82-
---
83-
84-
apiVersion: extensions/v1beta1
85-
kind: Ingress
86-
metadata:
87-
name: chime-alt
88-
namespace: chime
89-
annotations:
90-
kubernetes.io/ingress.class: nginx
91-
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
92-
# allow requests larger than 1MiB
93-
nginx.ingress.kubernetes.io/proxy-body-size: "0"
94-
spec:
95-
tls:
96-
- hosts:
97-
- lke.penn-chime.phl.io
98-
secretName: tls-chime-alt
99-
rules:
100-
- host: lke.penn-chime.phl.io
101-
http:
102-
paths:
103-
- path: /
104-
backend:
105-
serviceName: chime
106-
servicePort: 80
107-
108-
---
109-
apiVersion: extensions/v1beta1
110-
kind: Ingress
111-
metadata:
112-
name: chime-static
113-
namespace: chime
114-
labels:
115-
app: chime
116-
annotations:
117-
nginx.ingress.kubernetes.io/proxy-buffering: "on" # Important!
118-
nginx.ingress.kubernetes.io/configuration-snippet: |
119-
proxy_cache static-cache;
120-
proxy_cache_valid 404 1m;
121-
proxy_cache_valid 200 10m;
122-
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
123-
proxy_cache_bypass $http_x_purge;
124-
proxy_cache_key $proxy_upstream_name$request_uri;
125-
proxy_cache_lock on;
126-
proxy_cache_use_stale updating;
127-
add_header X-Cache-Status $upstream_cache_status;
128-
spec:
129-
rules:
130-
- host: penn-chime.phl.io
131-
http:
132-
paths:
133-
- path: /static/
134-
backend:
135-
serviceName: chime
136-
servicePort: 80
137-
- host: lke.penn-chime.phl.io
138-
http:
139-
paths:
140-
- path: /static/
141-
backend:
142-
serviceName: chime
143-
servicePort: 80

0 commit comments

Comments
 (0)