-
Notifications
You must be signed in to change notification settings - Fork 0
/
cronjob.yaml
37 lines (37 loc) · 913 Bytes
/
cronjob.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
apiVersion: v1
kind: ServiceAccount
metadata:
name: restarter
namespace: paasdocs-preview
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: run-pod-restart
subjects:
- kind: ServiceAccount
name: restarter
namespace: paasdocs-preview
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: ocidocs-rollout-restart-cronjob
namespace: paasdocs-preview
spec:
schedule: "*/30 * * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
serviceAccountName: restarter
containers:
- name: ocidocs-rollout-restart-job
image: bitnami/kubectl:1.20
command: ['kubectl', 'rollout' ,'restart', 'deployment/ocidocs-preview', '-n', 'paasdocs-preview']
restartPolicy: OnFailure