k8up-io / k8up

Kubernetes and OpenShift Backup Operator
https://k8up.io/
Apache License 2.0
717 stars 66 forks source link

Operation cannot be fulfilled on schedules.k8up.io \"prodk8up\": the object has been modified #1021

Open stevemayster opened 3 weeks ago

stevemayster commented 3 weeks ago

Description

Hello. Before i use k8up to make one time backup, now i try create a schedule. I take an example from docs and make a little changes

apiVersion: k8up.io/v1
kind: Schedule
metadata:
  name: k8up
spec:
  backend:
    s3:
      endpoint: http://minio:9000
      bucket: 
      accessKeyIDSecretRef:
        name: s3pwd
        key: username
      secretAccessKeySecretRef:
        name: s3pwd
        key: password
    repoPasswordSecretRef:
      name: restic-repository-password
      key: password
  backup:
    schedule: '00 15 1-5 * *'
    failedJobsHistoryLimit: 2
    successfulJobsHistoryLimit: 2
    promURL: https://prom.hostname.com
  check:
    schedule: '0 1 * * 1'
    promURL: https://prom.hostname.com
  prune:
    schedule: '0 1 * * 0'
    retention:
      keepLast: 5
      keepDaily: 14

So, i applied this config and got an error

2024-11-07T11:56:42Z    ERROR   k8up.operator   Reconciler error    {"controller": "schedule.k8up.io", "controllerGroup": "k8up.io", "controllerKind": "Schedule", "Schedule": {"name":"prodcatk8up","namespace":"default"}, "namespace": "default", "name": "prodcatk8up", "reconcileID": "012070c8-010d-4d3a-af9b-9e00de6d42ef", "error": "Operation cannot be fulfilled on schedules.k8up.io \"prodcatk8up\": the object has been modified; please apply your changes to the latest version and try again"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
    /home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:329
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
    /home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
    /home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:227

And nothing happened, schedule doesn't work

Also i have a question about timezones. I see time in pod in UTC but my worker node have UTC+1. What time i need to use in the scheduler?

Additional Context

No response

Logs

No response

Expected Behavior

Backup jobs started by scheduler right in time

Steps To Reproduce

No response

Version of K8up

4.8.1

Version of Kubernetes

1.30.1

Distribution of Kubernetes

kubeadm