-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgres.zalando.ts
53 lines (50 loc) · 1.8 KB
/
postgres.zalando.ts
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
import { Construct } from 'constructs';
import * as pgop from './imports/acid.zalan.do'
export class PGZalandoChart extends Construct {
// uses the Zalando postgres operator
public readonly dbServiceName: string;
constructor(scope: Construct, id: string,) {
super(scope, id);
const db = new pgop.Postgresql(
this,
'db',
{
metadata: {
labels: {
'app.kubernetes.io/name': 'plone-postgresql',
'app.kubernetes.io/instance': 'postgresql',
'app.kubernetes.io/component': 'database',
'app.kubernetes.io/part-of': 'plone',
}
},
spec: {
numberOfInstances: 2,
allowedSourceRanges: ['10.0.0.0/8'],
postgresql: { version: pgop.PostgresqlSpecPostgresqlVersion.VALUE_15 },
volume: { size: '1Gi' },
databases: {
plone: 'plone',
},
teamId: 'plone',
users: {
plone: [
pgop.PostgresqlSpecUsers.SUPERUSER,
pgop.PostgresqlSpecUsers.CREATEDB,
],
},
resources: {
limits: {
cpu: '1000m',
memory: '1Gi',
},
requests: {
cpu: '300m',
memory: '400Mi',
},
},
}
}
);
this.dbServiceName = db.metadata.name as string;
}
}