-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpostgresql-backup-ephemeral-template.json
208 lines (208 loc) · 7.84 KB
/
postgresql-backup-ephemeral-template.json
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "postgresql-backup-persistent",
"creationTimestamp": null,
"annotations": {
"openshift.io/display-name": "PostgreSQL Backup",
"description": "PostgreSQL database backup container",
"iconClass": "icon-postgresql",
"tags": "database,postgresql,backup"
}
},
"message": "The backup container has been created in your project with app name: ${APP_NAME}.\n\n Database Name: ${POSTGRESQL_SERVICE_HOST}\n Username: ${POSTGRESQL_USER}\n Password: ${POSTGRESQL_PASSWORD}\n Backup directory: ${BACKUP_DATA_DIR}\n Backups to keep: ${BACKUP_KEEP}\n Cron job config: '${BACKUP_MINUTE} ${BACKUP_HOUR} * * *'\n\nFor more information about using this template, see https://github.com/appuio/postgresql-multidb-backup-container.",
"labels": {
"template": "postgresql-backup-persistent"
},
"objects": [{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "${APP_NAME}"
},
"stringData": {
"database-admin-password": "${POSTGRESQL_ADMIN_PASSWORD}"
}
}, {
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "postgresql-multidb-backup-container",
"creationTimestamp": null,
"labels": {
"app": "${APP_NAME}"
}
},
"spec": {
"tags": [{
"name": "${POSTGRESQL_VERSION}",
"annotations": {
"openshift.io/imported-from": "appuio/postgresql-multidb-backup-container:${POSTGRESQL_VERSION}"
},
"from": {
"kind": "DockerImage",
"name": "appuio/postgresql-multidb-backup-container:${POSTGRESQL_VERSION}"
},
"generation": null,
"importPolicy": {}
}]
},
"status": {
"dockerImageRepository": ""
}
}, {
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "postgresql-multidb-backup-container",
"creationTimestamp": null,
"labels": {
"app": "${APP_NAME}"
},
"annotations": {
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [{
"type": "ConfigChange"
}, {
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"postgresql-multidb-backup-container"
],
"from": {
"kind": "ImageStreamTag",
"name": "postgresql-multidb-backup-container:${POSTGRESQL_VERSION}"
}
}
}],
"replicas": 1,
"test": false,
"selector": {
"app": "${APP_NAME}",
"deploymentconfig": "postgresql-multidb-backup-container"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "${APP_NAME}",
"deploymentconfig": "postgresql-multidb-backup-container"
},
"annotations": {
"openshift.io/container.postgresql-multidb-backup-container.image.entrypoint": "[\"container-entrypoint\",\"/bin/sh\",\"-c\",\"./bin/run.sh\"]",
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"containers": [{
"name": "postgresql-multidb-backup-container",
"image": "appuio/postgresql-multidb-backup-container:${POSTGRESQL_VERSION}",
"ports": [{
"containerPort": 5432,
"protocol": "TCP"
}],
"env": [{
"name": "POSTGRESQL_ADMIN_PASSWORD",
"valueFrom": {
"secretKeyRef": {
"name": "${APP_NAME}",
"key": "database-admin-password"
}
}
}, {
"name": "POSTGRESQL_SERVICE_HOST",
"value": "${POSTGRESQL_SERVICE_HOST}"
}, {
"name": "POSTGRESQL_SERVICE_PORT",
"value": "${POSTGRESQL_SERVICE_PORT}"
}, {
"name": "BACKUP_DATA_DIR",
"value": "${BACKUP_DATA_DIR}"
}, {
"name": "BACKUP_KEEP",
"value": "${BACKUP_KEEP}"
}, {
"name": "BACKUP_MINUTE",
"value": "${BACKUP_MINUTE}"
}, {
"name": "BACKUP_HOUR",
"value": "${BACKUP_HOUR}"
}],
"resources": {},
"volumeMounts": [{
"name": "dbbackup",
"mountPath": "/opt/app-root/backup/"
}]
}]
}
}
},
"status": {}
}],
"parameters": [{
"name": "APP_NAME",
"displayName": "App Name",
"description": "App name for internal openshift labels",
"generate": "expression",
"from": "backup-[a-z0-9]{3}",
"required": true
}, {
"name": "POSTGRESQL_SERVICE_HOST",
"displayName": "Database Service Name",
"description": "The name of the OpenShift Service exposed for the database.",
"required": true
}, {
"name": "POSTGRESQL_SERVICE_PORT",
"displayName": "Database Service Port",
"description": "The port of the OpenShift Service exposed for the database.",
"value": "5432",
"required": true
}, {
"name": "POSTGRESQL_ADMIN_PASSWORD",
"displayName": "Postgresql Admin user password",
"description": "PostgreSQL Connection Password for the postgres user",
"generate": "expression",
"from": "[a-zA-Z0-9]{16}",
"required": true
}, {
"name": "POSTGRESQL_VERSION",
"displayName": "Version of PostgreSQL database",
"description": "Version of PostgreSQL database to be backed up (9.2, 9.4, 9.5 or latest).",
"value": "9.5",
"required": true
}, {
"name": "VOLUME_CAPACITY",
"displayName": "Volume Capacity",
"description": "Volume space available for data, e.g. 512Mi, 2Gi.",
"value": "1Gi",
"required": true
}, {
"name": "BACKUP_DATA_DIR",
"description": "where to store the Backups, typically this directory would be a persistent Volume",
"value": "/opt/app-root/backup/",
"required": true
}, {
"name": "BACKUP_KEEP",
"description": "how many Backups are kept",
"value": "5",
"required": true
}, {
"name": "BACKUP_MINUTE",
"description": "cron Minute (eg. 10) ",
"value": "10",
"required": true
}, {
"name": "BACKUP_HOUR",
"description": "cron Hour (eg. 11,19) every day at 11am and 7pm",
"value": "11,19",
"required": true
}]
}