k8up-io / k8up

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

kind: Schedules does not have same spec as kind: Backup, no Volume to map CaCert #983

Closed mortega89 closed 3 months ago

mortega89 commented 3 months ago

Description

Hi, I'm trying to apply this manifest:

apiVersion: k8up.io/v1 kind: Schedule metadata: name: k8up-mysql-db-2-am spec: volumes:

  • name: ca-tls secret: secretName: REDACTED defaultMode: 420 backend: tlsOptions: caCert: /mnt/ca/REDACTED.crt volumeMounts:
    • name: ca-tls mountPath: /mnt/ca/ repoPasswordSecretRef: name: k8up-mysql-restic-repo key: password s3: endpoint: https:/REDACTED bucket: test accessKeyIDSecretRef: name: k8up-mysql-s3-secret key: ACCESS_KEY_ID secretAccessKeySecretRef: name: k8up-mysql-s3-secret key: SECRET_KEY backup: schedule: '/2 ' failedJobsHistoryLimit: 5 successfulJobsHistoryLimit: 5 check: schedule: '0 3 1' prune: schedule: '0 3 * 0' retention: keepLast: 7

but it seems that the spec "volume" is missing in the CR. Error from server (BadRequest): error when creating "schedule-backup.yaml": Schedule in version "v1" cannot be handled as a Schedule: strict decoding error: unknown field "spec.volumes"

im not sure on how to proceed, the almost same CR kind: backup works without issue, if I remove Volumes it does not find the certificate and spawn an error on the operator pod.

apiVersion: k8up.io/v1 kind: Backup metadata: name: k8up-mysql-db-first-backup spec: volumes:

  • name: ca-tls secret: secretName: REDACTED defaultMode: 420 failedJobsHistoryLimit: 2 successfulJobsHistoryLimit: 2 backend: tlsOptions: caCert: /mnt/ca/REDACTED.crt volumeMounts:
    • name: ca-tls mountPath: /mnt/ca/ repoPasswordSecretRef: name: k8up-mysql-restic-repo key: password s3: endpoint: https://REDACTED bucket: test accessKeyIDSecretRef: name: k8up-mysql-s3-secret key: ACCESS_KEY_ID secretAccessKeySecretRef: name: k8up-mysql-s3-secret key: SECRET_KEY

thanks

Additional Context

No response

Logs

No response

Expected Behavior

Volumes key inside the CR

Steps To Reproduce

No response

Version of K8up

2.10

Version of Kubernetes

1.28

Distribution of Kubernetes

kind

mortega89 commented 3 months ago

after digging a lot, I understood that "volumes:" field is a child of "backup:" into the "schedule" resource.

Kind: schedule > backup > volumes: