-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-mesh-checker-cronjob.yml
51 lines (49 loc) · 1.36 KB
/
k8s-mesh-checker-cronjob.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
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
name: k8-mesh-checker
labels:
kubernetes.io/cluster-service: "true"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: default
name: k8-mesh-checker
subjects:
- kind: ServiceAccount
name: k8-mesh-checker
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: k8-mesh-checker
namespace: default
spec:
concurrencyPolicy: Forbid
schedule: "*/5 * * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: k8-mesh-checker
restartPolicy: Never
containers:
- name: centos
image: centos
args:
- /bin/sh
- -c
- yum -y install git wget ; git clone https://github.com/fxpester/k8s-mesh-checker ; wget https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl ; chmod +x /usr/local/bin/kubectl ; ./k8s-mesh-checker/check-network.sh 36721 no yes
env:
- name: TELEGRAM_TOKEN
value: "xxxxxxx"
- name: TELEGRAM_CHAT
value: "xxxxxxx"