-
Notifications
You must be signed in to change notification settings - Fork 2
/
crond-noroot-template-openshift.yaml
173 lines (159 loc) · 4.61 KB
/
crond-noroot-template-openshift.yaml
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
##comienzo Template
apiVersion: v1
kind: Template
metadata:
name: crond-openshift-mvilche
labels:
template: crond-openshift-mvilche
autor: "Martin_Fabrizzio_Vilche"
annotations:
openshift.io/display-name: "crond-openshift-mvilche"
iconClass: "icon-github"
description: >-
GO CROND TASKS NON ROOT - OPENSHIFT
Martin Fabrizzio Vilche.
https://github.com/mvilche.
openshift.io/provider-display-name: "Martin Fabrizzio Vilche"
openshift.io/documentation-url: "https://github.com/mvilche/crond-noroot.git"
openshift.io/support-url: "https://github.com/mvilche/crond-noroot.git"
message: >-
Los servicios iniciarán en un par de minutos...
Martin Fabrizzio Vilche
objects:
##################### CROND
- apiVersion: v1
data:
tasks: |-
# EJEMPLO DE TASKS
SHELL=/bin/bash
#### true | false
EMAIL_NOTIFICACION=false
* * * * * 1001 bash -c "sleep 5 && id >> /tmp/test-1"
#dia(*) hora(*) dia_del_mes(*) mes(*) dia_semana(*) id_usuario(1001) commando(sleep 5 && id >> /tmp/test-1)
config.ini: |-
Mailuser="[email protected]"
Mailpassword="password"
Mailhost="host.com.uy"
Mailport=25
Maildestinos="[email protected]"
Ambiente="TEST"
kind: ConfigMap
metadata:
name: go-tasks
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: "crond-tasks"
name: "crond-tasks"
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: crond-tasks
deploymentconfig: crond-tasks
strategy:
activeDeadlineSeconds: 21600
resources: {}
type: Recreate
template:
metadata:
labels:
app: crond-tasks
deploymentconfig: crond-tasks
spec:
containers:
- env:
- name: TIMEZONE
value: America/Montevideo
image: "crond-tasks:latest"
imagePullPolicy: Always
name: crond-tasks
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/crontabs
name: go-tasks-crontabs
- mountPath: /opt/config
name: go-tasks-config
livenessProbe:
exec:
command:
- bash
- '-c'
- pidof go-tasks
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
exec:
command:
- bash
- '-c'
- |
pidof go-tasks
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
volumes:
- configMap:
name: go-tasks
items:
- key: tasks
path: tasks
name: go-tasks-crontabs
- configMap:
name: go-tasks
items:
- key: config.ini
path: config.ini
name: go-tasks-config
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- crond-tasks
from:
kind: ImageStreamTag
name: "crond-tasks:latest"
type: ImageChange
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: crond-tasks
name: crond-tasks
spec:
completionDeadlineSeconds: 1800
output:
to:
kind: ImageStreamTag
name: crond-tasks:latest
source:
contextDir: .
git:
ref: master
uri: 'https://github.com/mvilche/crond-noroot.git'
type: Git
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
triggers:
- type: "ConfigChange"
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: crond-tasks
name: crond-tasks
spec: {}