homelab/deployment/ha-sync/rbac.yaml
Dan V 26db771279 ha-sync: add internal/kube package with CronJob/Lease management
- internal/kube/client.go: NewClient() with in-cluster + kubeconfig fallback
- internal/kube/cronjob.go: JobSpec, ApplyCronJob, DeleteCronJob, TriggerJob,
  GetLockStatus, SuspendCronJob, ListCronJobs, ImportFromCronJob
- Makefile/Dockerfile: add ha-sync-ctl build target
- rbac.yaml: add batch/cronjobs+jobs permissions and watch verb on leases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-08 23:38:32 +02:00

26 lines
698 B
YAML

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ha-sync-lease-manager
namespace: infrastructure
rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["create", "get", "update", "delete", "list", "watch"]
- apiGroups: ["batch"]
resources: ["cronjobs", "jobs"]
verbs: ["create", "get", "update", "patch", "delete", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ha-sync-lease-manager
namespace: infrastructure
subjects:
- kind: ServiceAccount
name: ha-sync
namespace: infrastructure
roleRef:
kind: Role
name: ha-sync-lease-manager
apiGroup: rbac.authorization.k8s.io