forked from gerald1248/openshift-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-no-secret.yml
186 lines (186 loc) · 4.51 KB
/
template-no-secret.yml
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
apiVersion: v1
kind: Template
labels:
template: openshift-backup-app-no-secret-template
message: |-
A recurring backup job has been created.
For more information on using this template, see https://github.com/gerald1248/openshift-backup
metadata:
name: openshift-backup-app-no-secret-template
annotations:
description: |-
OpenShift cluster backup based on 'oc' and the experimental 2nd day operations backup script (no secret).
parameters:
- name: NAME
displayName: Name
description: Name of each API object
value: openshift-backup
- name: NAMESPACE
displayName: Project
description: The project that is created for the test runner
value: cluster-backup
- name: SCHEDULE
displayName: Schedule
description: Schedule determining when and how often tests are run
value: "15 0 * * *"
- name: CAPACITY
displayName: Persistent volume capacity
description: Attempt to bind to this persistent volume
value: "2Gi"
- name: BACKUP_RETAIN_DAYS
displayName: Backup retain backups (days)
description: How many days backups should be retained.
value: "7"
objects:
- kind: ServiceAccount
apiVersion: v1
metadata:
name: ${NAME}
namespace: ${NAMESPACE}
labels:
app: ${NAME}
- kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ${NAME}-cluster-reader
namespace: ${NAMESPACE}
labels:
app: ${NAME}
roleRef:
kind: ClusterRole
name: cluster-reader
subjects:
- kind: ServiceAccount
name: ${NAME}
userNames:
- "system:serviceaccount:${NAMESPACE}:${NAME}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ${NAME}
labels:
app: ${NAME}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: ${CAPACITY}
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: ${NAME}
namespace: ${NAMESPACE}
labels:
app: ${NAME}
spec:
triggers:
- type: ConfigChange
replicas: 1
selector:
app: ${NAME}
deploymentconfig: ${NAME}
template:
metadata:
labels:
app: ${NAME}
deploymentconfig: ${NAME}
spec:
serviceAccountname: ${NAME}
serviceAccount: ${NAME}
containers:
- name: ${NAME}
image: gerald1248/openshift-backup
resources:
limits:
cpu: 200m
memory: 1Gi
requests:
cpu: 100m
memory: 512Mi
env:
- name: OPENSHIFT_BACKUP_RETAIN_DAYS
value: ${BACKUP_RETAIN_DAYS}
- name: BACKUP_SECRETS
value: "false"
volumeMounts:
- name: ${NAME}-data
mountPath: /openshift-backup
volumes:
- name: ${NAME}-data
persistentVolumeClaim:
claimName: ${NAME}
- apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: ${NAME}
namespace: ${NAMESPACE}
labels:
app: ${NAME}
spec:
schedule: ${SCHEDULE}
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
serviceAccountname: ${NAME}
serviceAccount: ${NAME}
containers:
- name: ${NAME}
image: gerald1248/openshift-backup
resources:
limits:
cpu: 200m
memory: 1Gi
requests:
cpu: 100m
memory: 512Mi
args:
- /bin/sh
- -c
- openshift-backup
env:
- name: POD_NAMESPACE
value: ${NAMESPACE}
- name: OPENSHIFT_BACKUP_RETAIN_DAYS
value: ${BACKUP_RETAIN_DAYS}
volumeMounts:
- name: ${NAME}-data
mountPath: /openshift-backup
volumes:
- name: ${NAME}-data
persistentVolumeClaim:
claimName: ${NAME}
restartPolicy: Never
- kind: LimitRange
apiVersion: v1
metadata:
name: ${NAME}
namespace: ${NAMESPACE}
labels:
app: ${NAME}
spec:
limits:
- type: Container
default:
cpu: 400m
memory: 1Gi
defaultRequest:
cpu: 200m
memory: 512Mi
- kind: ResourceQuota
apiVersion: v1
metadata:
name: ${NAME}
namespace: ${NAMESPACE}
labels:
app: ${NAME}
spec:
hard:
pods: "4"
requests.cpu: 800m
requests.memory: 2Gi
limits.cpu: 1600m
limits.memory: 4Gi