mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-05-14 08:35:22 +00:00
uptimekuma for kubernetes
This commit is contained in:
41
roles/uptime-kuma/files/uptime-kuma-cronjob-monitors.yaml
Normal file
41
roles/uptime-kuma/files/uptime-kuma-cronjob-monitors.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: uptime-kuma-sync
|
||||
namespace: monitoring
|
||||
spec:
|
||||
schedule: "0 * * * *" # cada hora
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
serviceAccountName: uptime-kuma-sync
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: sync
|
||||
image: python:3.12-slim
|
||||
command: ["bash", "-c", "apt-get update -q && apt-get install -y -q curl && curl -LO https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/ && python /scripts/sync.py"]
|
||||
env:
|
||||
- name: USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: uptime-kuma-api-secret
|
||||
key: USERNAME
|
||||
- name: PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: uptime-kuma-api-secret
|
||||
key: PASSWORD
|
||||
- name: UPTIME_KUMA_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: uptime-kuma-api-secret
|
||||
key: UPTIME_KUMA_URL
|
||||
volumeMounts:
|
||||
- name: script
|
||||
mountPath: /scripts
|
||||
volumes:
|
||||
- name: script
|
||||
configMap:
|
||||
name: uptime-kuma-sync-script
|
||||
defaultMode: 0755
|
||||
Reference in New Issue
Block a user