mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-05-14 00:15:20 +00:00
41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
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 |