forked from pennlabs/penn-courses
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
73 lines (64 loc) · 2.19 KB
/
main.ts
File metadata and controls
73 lines (64 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { Construct } from 'constructs';
import { App } from 'cdk8s';
import { DjangoApplication, PennLabsChart, ReactApplication, RedisApplication } from '@pennlabs/kittyhawk';
export class MyChart extends PennLabsChart {
constructor(scope: Construct) {
super(scope);
const backendImage = 'pennlabs/penn-degree-plan-backend';
const secret = 'penn-courses';
const ingressProps = {
annotations: {
['ingress.kubernetes.io/content-security-policy']: "frame-ancestors 'none';",
["ingress.kubernetes.io/protocol"]: "https",
["traefik.ingress.kubernetes.io/router.middlewares"]: "default-redirect-http@kubernetescrd"
}
}
new RedisApplication(this, 'redis', {
deployment: {
image: 'redis/redis-stack-server',
tag: '6.2.6-v6'
},
persistData: true,
});
new DjangoApplication(this, 'celery', {
deployment: {
image: backendImage,
secret,
cmd: ['celery', 'worker', '-A', 'PennCourses', '-Q', 'alerts,celery', '-linfo'],
},
djangoSettingsModule: 'PennCourses.settings.production',
});
new DjangoApplication(this, 'backend', {
deployment: {
image: backendImage,
secret,
replicas: 3,
},
djangoSettingsModule: 'PennCourses.settings.production',
ingressProps,
domains: [{ host: 'penncourseplan.com', paths: ["/api", "/admin", "/accounts", "/assets"] },
{ host: 'penncoursealert.com', paths: ["/api", "/admin", "/accounts", "/assets", "/webhook"] },
{ host: 'penncoursereview.com', paths: ["/api", "/admin", "/accounts", "/assets"] }],
});
new DjangoApplication(this, 'backend-asgi', {
deployment: {
image: backendImage,
cmd: ['/usr/local/bin/asgi-run'],
secret,
replicas: 1,
},
djangoSettingsModule: 'PennCourses.settings.production',
ingressProps,
domains: [{ host: 'penncoursereview.com', paths: ["/api/ws"] }],
});
new ReactApplication(this, 'degree-plan', {
deployment: {
image: 'pennlabs/pdp-frontend',
},
domain: { host: 'penndegreeplan.com', paths: ['/'] },
});
}
}
const app = new App();
new MyChart(app);
app.synth();